我在这里玩弄新的 PayPal Javascript SDK 按钮 https://developer.paypal.com/docs/checkout/reference/customize-sdk
我们的应用销售数字商品,不需要送货地址。有什么办法可以关闭它吗?
// render paypal buttons
paypal.Buttons({
createOrder: function (data, actions) {
// Set up the transaction
return actions.order.create({
purchase_units: [{
amount: {
value: $scope.total
}
}],
application_context: {
shipping_preference: "NO_SHIPPING"
}
});
},
onApprove: function (data, actions) {
// Capture the funds from the transaction
return actions.order.capture().then(function (details) {
// Show a success message to your buyer
alert('Transaction completed by ' + details.payer.name.given_name + ' order ID: ' + data.orderID);
});
}
}).render('#paypal-button-container');
最佳答案
是的,您需要传递 shipping_preference
对象。
array(
'shipping_preference' => 'NO_SHIPPING'
),
关于javascript - 如何使用新的 PayPal JavaScript SDK 关闭发货,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55093706/