Beispiel #1
0
 /**
  * Call DoAuthorize
  *
  * @param int $amount
  * @param \Magento\Framework\DataObject $payment
  * @param string $parentTransactionId
  * @return \Magento\Paypal\Model\Api\AbstractApi
  */
 protected function _callDoAuthorize($amount, $payment, $parentTransactionId)
 {
     $apiData = $this->_pro->getApi()->getData();
     foreach ($apiData as $k => $v) {
         if (is_object($v)) {
             unset($apiData[$k]);
         }
     }
     $this->_checkoutSession->setPaypalTransactionData($apiData);
     $this->_pro->resetApi();
     $api = $this->_setApiProcessableErrors()->setAmount($amount)->setCurrencyCode($payment->getOrder()->getBaseCurrencyCode())->setTransactionId($parentTransactionId)->callDoAuthorization();
     $payment->setAdditionalInformation($this->_authorizationCountKey, $payment->getAdditionalInformation($this->_authorizationCountKey) + 1);
     return $api;
 }