【发布时间】:2020-10-13 10:43:13
【问题描述】:
这是我的代码。我想使用固定整数值而不是“package_select”。我该怎么做...
<script>
paypal.Buttons({
createOrder: function(data, actions) {
// This function sets up the details of the transaction, including the amount and line item details.
return actions.order.create({
purchase_units: [{
amount: {
value: document.getElementById("package_select").value
}
}]
});
},
onApprove: function(data, actions) {
// This function captures the funds from the transaction.
return actions.order.capture().then(function(details) {
// This function shows a transaction success message to your buyer.
alert('Transaction completed by ' + details.payer.name.given_name);
});
}
}).render('#paypal-button-container');
//This function displays Smart Payment Buttons on your web page.
</script>
【问题讨论】:
-
我认为他们的意思是
value: 3
标签: javascript ajax paypal-subscriptions