[英]Paypal smart button checkout without shipping
我正在使用带有以下代码的 Paypal 智能支付按钮:
window.paypal.Buttons({
createOrder: function(data, actions) {
return actions.order.create({
purchase_units: [{
amount: {
value: this.price,
currency: "USD"
}
}]
});
},
...
}
除了它在结帐窗口要求用户提供送货地址这一事实之外,它工作正常,我想摆脱它,因为这是数字商品而不是实体商品。 我怎样才能做到这一点? 我试过做no_shipping: 1
和类似的无济于事。
您可以像这样使用application_context和 shipping_preference
return actions.order.create({
"application_context": {
shipping_preference: "NO_SHIPPING",
},
purchase_units: [{
amount: {value: "0.1"},
},],
});
想通了,您需要使用您之前创建的付款体验在服务器端创建付款而不是订单。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.