PayPal JavaScript SDK:我无法动态设置金额值



我需要将"value": 22更改为变量precioServicio的值,但无法更改。

var precioServicio = document.getElementById("precioServicio");
createOrder: function(data, actions) {
return actions.order.create({
purchase_units: [{"amount":{"currency_code":"USD","value":22}}] //PRECIO A PAGAR
});
},

将硬编码数字22替换为。。。precioServiciodocument.getElementById("precioServicio")

您可以使用purchase_units:[{quot;amount":{">

最新更新