Passing a Variable into PayPal initPayButton Function (Paypal Payments)

Viewed 3

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}}]
          });
        },
0 Answers
Related