本文整理匯總了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);
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
}