#Chuplag
1 messages · Page 1 of 1 (latest)
So I trying to add a stripe payment but the thing is the price of the product is fully dynamic. So I can't pre define the product price on stripe. Which is why am trying to use https://stripe.com/docs/payments/integration-builder but how do I grab the final price of the product and pass it on to stripe payment?
are you using Checkout or PaymentIntents? ('prebuilt Checkout page' or 'custom payment form') , and which would you want to use?
I am using "Custom payment form"
then the amount is decided by what you pass to amount when creating the PaymentIntent on your backend server.
we have that calculateOrderAmount function as a placeholder for the business code you would write to decide that (like pulling it from your shopping cart or database etc)
The thing is the site is Umbraco site and I have used JavaScript to calculate the form.
And when loading the page it shows me an error with client.js file which I assume is happening because of purchase JSON bit
yep this is something you have to debug some more, https://support.stripe.com/questions/how-to-fix-syntaxerror-unexpected-token-in-json-at-position-0 has some tips.
Could we pass the final price with JavaScript?
well you can but bear in mind the security implications