PayPal buy button using their javascript

I want to implement PayPal onto a checkout page and it seems the easiest way is using their javascript code found here:

https://developer.paypal.com/docs/business/checkout/set-up-standard-payments/

This works as expected with hard-coded price but I can’t seem to set the value from a variable. What’s the syntax I should be using?

Problem solved. This is what I was looking for:

value: dmx.parse('session1.data.sessTotal')

3 Likes

Thanks for this, had to adjust a little for using an SPA, so landed up with
value: dmx.parse('content.session1.data.sessTotal')