Exemplo n.º 1
0
 /**
  * Import direct payment results to payment
  *
  * @param \Magento\Paypal\Model\Api\Nvp $api
  * @param Payment $payment
  * @return void
  */
 protected function _importResultToPayment($api, $payment)
 {
     $payment->setTransactionId($api->getTransactionId())->setIsTransactionClosed(0);
     $this->_pro->importPaymentInfo($api, $payment);
 }
Exemplo n.º 2
0
 /**
  * Import payment info to payment
  *
  * @param Nvp $api
  * @param Payment $payment
  * @return void
  */
 protected function _importToPayment($api, $payment)
 {
     $payment->setTransactionId($api->getTransactionId())->setIsTransactionClosed(0)->setAdditionalInformation(ExpressCheckout::PAYMENT_INFO_TRANSPORT_REDIRECT, $api->getRedirectRequired());
     if ($api->getBillingAgreementId()) {
         $payment->setBillingAgreementData(['billing_agreement_id' => $api->getBillingAgreementId(), 'method_code' => \Magento\Paypal\Model\Config::METHOD_BILLING_AGREEMENT]);
     }
     $this->_pro->importPaymentInfo($api, $payment);
 }
Exemplo n.º 3
0
 /**
  * Import payment info to payment
  *
  * @param Api\Nvp $api
  * @param \Magento\Sales\Model\Order\Payment $payment
  * @return void
  */
 protected function _importToPayment($api, $payment)
 {
     $payment->setTransactionId($api->getPaypalTransactionId())->setIsTransactionClosed(0)->setAdditionalInformation(Express\Checkout::PAYMENT_INFO_TRANSPORT_REDIRECT, $api->getRedirectRequired() || $api->getRedirectRequested())->setIsTransactionPending($api->getIsPaymentPending())->setTransactionAdditionalInfo(Payflow\Pro::TRANSPORT_PAYFLOW_TXN_ID, $api->getTransactionId());
     $payment->setPreparedMessage(__('Payflow PNREF: #%1.', $api->getTransactionId()));
     $this->_paypalInfoFactory->create()->importToPayment($api, $payment);
 }
Exemplo n.º 4
0
 /**
  * Import refund results to payment
  *
  * @param \Magento\Paypal\Model\Api\Nvp $api
  * @param \Magento\Sales\Model\Order\Payment $payment
  * @param bool $canRefundMore
  * @return void
  */
 protected function _importRefundResultToPayment($api, $payment, $canRefundMore)
 {
     $payment->setTransactionId($api->getPaypalTransactionId())->setIsTransactionClosed(1)->setShouldCloseParentTransaction(!$canRefundMore)->setTransactionAdditionalInfo(self::TRANSPORT_PAYFLOW_TXN_ID, $api->getTransactionId());
     $payment->setPreparedMessage(__('Payflow PNREF: #%1.', $api->getTransactionId()));
     $this->_infoFactory->create()->importToPayment($api, $payment);
 }