Beispiel #1
0
 /**
  * Perform the payment review
  *
  * @param \Magento\Payment\Model\Info $payment
  * @param string $action
  * @return bool
  */
 public function reviewPayment(\Magento\Payment\Model\Info $payment, $action)
 {
     $api = $this->getApi()->setTransactionId($payment->getLastTransId());
     // check whether the review is still needed
     $api->callGetTransactionDetails();
     $this->importPaymentInfo($api, $payment);
     if (!$this->getInfo()->isPaymentReviewRequired($payment)) {
         return false;
     }
     // perform the review action
     $api->setAction($action)->callManagePendingTransactionStatus();
     $api->callGetTransactionDetails();
     $this->importPaymentInfo($api, $payment);
     return true;
 }