我使用最新的 checkout.js 进行快速结账,但不需要显示任何送货地址。由于它是数字商品,文档说我需要将 noshipping 设置为 1。但是,我无法弄清楚它是如何进入 javascript 的。
我关注了 basic integration步骤,然后使用 REST API 执行支付,以便我可以向我的服务器收费。
我已经尝试在 javascript 中到处添加 noshipping:1 来创建付款,但没有成功。这是它的样子(忽略编译问题,因为我只是想展示我是如何尝试添加 noshipping:1 信息的):
payment: function() {
var env = this.props.env;
var client = this.props.client;
return paypal.rest.payment.create(env, client, {
transactions: [
{
amount: { total: '4.99', currency: 'USD' }
DOESNT WORK-->noshipping: 1
}
],
DOESNT WORK-->noshipping: 1
});
},
有谁知道如何使用最新的 checkout.js 正确传递 noshipping 信息?
最佳答案
好的,看来他们终于添加了对此的支持。它看起来像这样:
payment: {
transactions: [
{
amount: { total: '19.99', currency: 'USD' }
// Possibly there is also a 'custom' field we can specify here;
// https://stackoverflow.com/questions/46320753/
}
],
application_context: {
shipping_preference: 'NO_SHIPPING'
}
}
关于paypal - 如何使用 Express Checkout checkout.js v4 指定 NoShipping 1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41843282/