/**
  * @param \Magento\Payment\Gateway\Http\TransferInterface $transferObject
  * @return null
  */
 public function placeRequest(\Magento\Payment\Gateway\Http\TransferInterface $transferObject)
 {
     $request = $transferObject->getBody();
     // call lib
     $service = new \Adyen\Service\Modification($this->_client);
     try {
         $response = $service->cancelOrRefund($request);
     } catch (\Adyen\AdyenException $e) {
         $response = null;
     }
     return $response;
 }
 /**
  * Cancel or Refund payment on Adyen
  *
  * @param \Magento\Payment\Model\InfoInterface $payment
  * @return mixed
  * @throws \Magento\Framework\Exception\LocalizedException
  */
 public function cancelOrRefund(\Magento\Payment\Model\InfoInterface $payment)
 {
     $pspReference = $this->_getPspReference($payment);
     $merchantAccount = $this->_adyenHelper->getAdyenAbstractConfigData("merchant_account");
     $request = array("merchantAccount" => $merchantAccount, "reference" => $payment->getOrder()->getIncrementId(), "originalReference" => $pspReference);
     // call lib
     $service = new \Adyen\Service\Modification($this->_client);
     $result = $service->cancelOrRefund($request);
     if ($result['response'] != '[cancelOrRefund-received]') {
         // something went wrong
         throw new \Magento\Framework\Exception\LocalizedException(__('The refund action failed'));
     }
     return $result;
 }