当前位置: 首页>>代码示例>>PHP>>正文


PHP Payment::getAdditionalInformation方法代码示例

本文整理汇总了PHP中Magento\Sales\Model\Order\Payment::getAdditionalInformation方法的典型用法代码示例。如果您正苦于以下问题:PHP Payment::getAdditionalInformation方法的具体用法?PHP Payment::getAdditionalInformation怎么用?PHP Payment::getAdditionalInformation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Magento\Sales\Model\Order\Payment的用法示例。


在下文中一共展示了Payment::getAdditionalInformation方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: createPaymentToken

 /**
  * @param Payment $payment
  * @param string $token
  * @throws LocalizedException
  * @return void
  */
 protected function createPaymentToken(Payment $payment, $token)
 {
     /** @var PaymentTokenInterface $paymentToken */
     $paymentToken = $this->paymentTokenFactory->create();
     $paymentToken->setGatewayToken($token);
     $paymentToken->setTokenDetails(json_encode($payment->getAdditionalInformation(Transparent::CC_DETAILS)));
     $paymentToken->setExpiresAt($this->getExpirationDate($payment));
     $this->getPaymentExtensionAttributes($payment)->setVaultPaymentToken($paymentToken);
 }
开发者ID:rafaelstz,项目名称:magento2,代码行数:15,代码来源:Transparent.php

示例2: _placeOrder

 /**
  * Place an order with authorization or capture action
  *
  * @param Payment $payment
  * @param float $amount
  * @return $this
  */
 protected function _placeOrder(Payment $payment, $amount)
 {
     $order = $payment->getOrder();
     /** @var \Magento\Paypal\Model\Billing\Agreement $billingAgreement */
     $billingAgreement = $this->_agreementFactory->create()->load($payment->getAdditionalInformation(\Magento\Paypal\Model\Payment\Method\Billing\AbstractAgreement::TRANSPORT_BILLING_AGREEMENT_ID));
     $cart = $this->_cartFactory->create(array('salesModel' => $order));
     $proConfig = $this->_pro->getConfig();
     $api = $this->_pro->getApi()->setReferenceId($billingAgreement->getReferenceId())->setPaymentAction($proConfig->getConfigValue('paymentAction'))->setAmount($amount)->setCurrencyCode($payment->getOrder()->getBaseCurrencyCode())->setNotifyUrl($this->_urlBuilder->getUrl('paypal/ipn/'))->setPaypalCart($cart)->setIsLineItemsEnabled($proConfig->getConfigValue('lineItemsEnabled'))->setInvNum($order->getIncrementId());
     // call api and import transaction and other payment information
     $api->callDoReferenceTransaction();
     $this->_pro->importPaymentInfo($api, $payment);
     $api->callGetTransactionDetails();
     $this->_pro->importPaymentInfo($api, $payment);
     $payment->setTransactionId($api->getTransactionId())->setIsTransactionClosed(0);
     if ($api->getBillingAgreementId()) {
         $order->addRelatedObject($billingAgreement);
         $billingAgreement->setIsObjectChanged(true);
         $billingAgreement->addOrderRelation($order);
     }
     return $this;
 }
开发者ID:pavelnovitsky,项目名称:magento2,代码行数:28,代码来源:Agreement.php

示例3: _placeOrder

 /**
  * Place an order with authorization or capture action
  *
  * @param Payment $payment
  * @param float $amount
  * @return $this
  */
 protected function _placeOrder(Payment $payment, $amount)
 {
     $order = $payment->getOrder();
     // prepare api call
     $token = $payment->getAdditionalInformation(ExpressCheckout::PAYMENT_INFO_TRANSPORT_TOKEN);
     $cart = $this->_cartFactory->create(['salesModel' => $order]);
     $api = $this->getApi()->setToken($token)->setPayerId($payment->getAdditionalInformation(ExpressCheckout::PAYMENT_INFO_TRANSPORT_PAYER_ID))->setAmount($amount)->setPaymentAction($this->_pro->getConfig()->getValue('paymentAction'))->setNotifyUrl($this->_urlBuilder->getUrl('paypal/ipn/'))->setInvNum($order->getIncrementId())->setCurrencyCode($order->getBaseCurrencyCode())->setPaypalCart($cart)->setIsLineItemsEnabled($this->_pro->getConfig()->getValue('lineItemsEnabled'));
     if ($order->getIsVirtual()) {
         $api->setAddress($order->getBillingAddress())->setSuppressShipping(true);
     } else {
         $api->setAddress($order->getShippingAddress());
         $api->setBillingAddress($order->getBillingAddress());
     }
     // call api and get details from it
     $api->callDoExpressCheckoutPayment();
     $this->_importToPayment($api, $payment);
     return $this;
 }
开发者ID:pradeep-wagento,项目名称:magento2,代码行数:25,代码来源:Express.php

示例4: _getSecureSilentPostHash

 /**
  * Return secure hash value for silent post request
  *
  * @param \Magento\Sales\Model\Order\Payment $payment
  * @return string
  */
 protected function _getSecureSilentPostHash($payment)
 {
     return $payment->getAdditionalInformation($this->_secureSilentPostHashKey);
 }
开发者ID:Doability,项目名称:magento2dev,代码行数:10,代码来源:Payflowlink.php

示例5: getAdditionalInformation

 /**
  * {@inheritdoc}
  */
 public function getAdditionalInformation($key = null)
 {
     $pluginInfo = $this->pluginList->getNext($this->subjectType, 'getAdditionalInformation');
     if (!$pluginInfo) {
         return parent::getAdditionalInformation($key);
     } else {
         return $this->___callPlugins('getAdditionalInformation', func_get_args(), $pluginInfo);
     }
 }
开发者ID:CSYE6225,项目名称:UnixSysProgramming,代码行数:12,代码来源:Interceptor.php


注:本文中的Magento\Sales\Model\Order\Payment::getAdditionalInformation方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。