【发布时间】:2019-08-01 06:51:48
【问题描述】:
我在这里 https://developer.paypal.com/docs/checkout/reference/customize-sdk 使用新的 PayPal Javascript 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');
【问题讨论】:
标签: javascript paypal