I have been looking into integrate stripe into Wappler.
I am trying to keep it 100% Wappler (other than the JS scripts needed provided on the stripe website) so no PHP coded CURL requests etc, just Server Side API calls
Been a bit of a process but I seem to have got things working
The process I am using is that the checkout generates the stipeToken which is passed to a server connect action which then passes the token to Stripe via an API call.
The data returned is then inserted into a database table
That part woks surprisingly well
Ironically the most problematic part of the process has been passing variable checkout totals from he checkout (via Stripe Elements) to the server action
I have it working using a hidden field within the checkout such as
i was using the same method and was also thinking about the same topic. But also stripe use it in their examples. I mean alot of shops could be just manipulated with Browser Dev Tools with wrong amounts.
You could Hash the amount and then hash it back before storing. Also you could mask the name „payment amount“…
I would advice to set and send the amount server-side to Stripe, a user could change the value of the hidden input to 1 and only pay 1 cent for the product. You probably only want to submit the Product ID, user info and the Stripe token, with that you create the data required for the charge server-side with a database query to get the correct amount.
Thanks @patrick, that is a decent workaround, i was really uncomfortable about using hidden fields as they seems a huge security risk, that would get around the issue.
The standard checkout exposes the prices but protects against injection by omitting the name attribute and handling it all by .js as below
I am sure there must be a way of passing this value securely,. i suspect it will need a customised javascript solution (not my strong point) which i cant currently work out but your suggestion will be a decent workaround…
To be honest, once this issue is resolved then the API interactions are pretty straight forward