07-24-2023, 09:43 AM
Can anybody help with this short question.
I am trying to pass a JS variable into the PayPal create order function,
but I am not sure how to pass it into the function correctly.
Function Below:
createOrder: function(data, actions) {
var ppcaught=document.getElementById('ppinput').value
return actions.order.create({
purchase_units: [{"description":'ppcaught' <?php echo json_encode($orderdetails); ?>,"amount":{"currency_code":"GBP","value":19.99}}]
});
},
I am trying to pass a JS variable into the PayPal create order function,
but I am not sure how to pass it into the function correctly.
Function Below:
createOrder: function(data, actions) {
var ppcaught=document.getElementById('ppinput').value
return actions.order.create({
purchase_units: [{"description":'ppcaught' <?php echo json_encode($orderdetails); ?>,"amount":{"currency_code":"GBP","value":19.99}}]
});
},