Magento 2-以编程方式获取订单PayPal信息

我正在开发一个自定义模块,可在付款后将以下数据传递到外部系统。
PayPal Express结帐-上次相关ID
PayPal Express结帐-最后交易ID

应该看到sales_ordersales_order_payment表。

该信息位于sales_order_payment表的extra_information

select additional_information from sales_order_payment
additional_information: a:11:{s:15:"paypal_payer_id";s:13:"S3N79BW9ASCXQ";s:18:"paypal_payer_email";s:25:"developer-buyer@qooar.com";s:19:"paypal_payer_status";s:8:"verified";s:21:"paypal_correlation_id";s:13:"689b01d290375";s:32:"paypal_express_checkout_payer_id";s:13:"S3N79BW9ASCXQ";s:29:"paypal_express_checkout_token";s:20:"EC-7F776218LS594863N";s:12:"method_title";s:23:"PayPal Express Checkout";s:41:"paypal_express_checkout_redirect_required";N;s:29:"paypal_protection_eligibility";s:10:"Ineligible";s:21:"paypal_payment_status";s:9:"completed";s:21:"paypal_pending_reason";s:4:"None";}

从您的订单对象中,我们可以付款:

$paymentAdditionalInfo = $order->getPayment()->getAdditionalInformation();

// get PayPal express checkout token
$token = $paymentAdditionalInfo['paypal_express_checkout_token'];

// get PayPal correlation ID
$correlationId = $paymentAdditionalInfo['paypal_correlation_id'];

版权属于: sbboke版权所有。

转载时必须以链接形式注明作者和原始出处及本声明。

张贴在magento2教程标签:

相关文章

0 0 投票数
文章评分
订阅评论
提醒
0 评论
最旧
最新 最多投票
内联反馈
查看所有评论