Ejemplo n.º 1
0
 /**
  * Perform the payment review
  *
  * @param Mage_Payment_Model_Info $payment
  * @param string $action
  * @return bool
  */
 public function reviewPayment(Mage_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;
 }
Ejemplo n.º 2
0
 /**
  * Deny payment
  * @param Mage_Payment_Model_Info $payment
  * @return mixed
  */
 public function denyPayment(Mage_Payment_Model_Info $payment)
 {
     $transactionId = $payment->getLastTransId();
     if (!$transactionId) {
         return false;
     }
     $request = $this->_getApiRequest();
     $this->_setAdditionalRequestParameters($request, $payment);
     $request->setData('transaction_id', $transactionId)->setData('order_id', $payment->getOrder()->getIncrementId());
     $api = $this->_getApi()->doDeny($request);
     $this->_importResultToPayment($payment, $api->getResponse());
     $apiResponse = $api->getResponse();
     return $apiResponse;
 }