0
我已經在我的asp.net網頁中實現了paypal checkout express按鈕。我怎樣才能將orderTotal傳遞給金額:{total:'0.01',currency:'USD'}。默認情況下它是'0.01'我想要顯示實際的orderTotal。 這是我的代碼 paypal.Button.render({如何在PayPal中傳遞總額至(金額:{total:'0.01',currency:'USD'})
env: 'sandbox', // sandbox | production
// PayPal Client IDs - replace with your own
// Create a PayPal app: https://developer.paypal.com/developer/applications/create
client: {
sandbox: 'AZDxjDScFpQtjWTOUtWKbyN_bDt4OgqaF4eYXlewfBP4-8aqX3PiV8e1GWU6liB2CUXlkA59kJXE7M6R',
//production: 'AVSYgEO5SUewyQ_We4dW5uCXyEZHgcFDfKK15gCqsd7o0edVH5UOhtHK7n2uqkFQOYtjJt0vvemfgNwg'
},
// Show the buyer a 'Pay Now' button in the checkout flow
commit: true,
// payment() is called when the button is clicked
payment: function (data, actions) {
// Make a call to the REST api to create the payment
return actions.payment.create({
payment: {
transactions: [
{
amount: { total: '0.01', currency: 'USD' }
}
]
}
});
},
commit: true,
// onAuthorize() is called when the buyer approves the payment
onAuthorize: function (data, actions) {
// Make a call to the REST api to execute the payment
return actions.payment.execute().then(function() {
//window.alert('Payment Complete!');
onPaypalAuthorize();
});
}
}, '#paypal-button-container');