首页 > 解决方案 > Paypal 结帐 - 识别客户/附加订单 ID

问题描述

我目前正在按照https://developer.paypal.com/docs/checkout/integrate/#实施 paypal Checkout

我可以发送付款等没问题。但是,我如何识别付款人?

 createOrder: function(data, actions) {
  // This function sets up the details of the transaction, including the amount and line item details.
  return actions.order.create({
    purchase_units: [{
      amount: {
          value: '1.0'
      }
    }]
  });
}

.create 不允许我附加订单 ID 或用户 ID。在贝宝仪表板中,我只能看到名称和金额。

标签: paypalcheckout

解决方案


在你onApprove的功能,里面actions.order.capture(

console.log(data);

信息将在那里为您服务。

您可以在此处的演示中看到用于更改的示例:https ://developer.paypal.com/demo/checkout/#/pattern/client


推荐阅读