FAO Ben - Shopping Cart Payment
You may be able to throw some light or want to throw some on light on the rather interesting thread/s going on in the Wappler forum about 'shopping carts' - data store, etc
Some posters have quite correctly highlighted the issue of sending the 'product price' via the client-side generated js form, as it's been well known for years it is open to manipulation.
Other posters have said you should get and check the price from your database BUT that, as far as I know, makes zero difference as you will always end up with a client-side generated form containing prices BEFORE it gets sent to your payment gateway - same problem - form prices can be easily manipulated.
The only secure way I know is to send the data from the payment form to the payment gateway of your choice and then get the form variables back from the payment gateway THEN check the prices in your database. If the prices match then you send the variables back to the payment gateway for processing. If the prices don't match then the variables are not sent back to the payment gateway and the payment is rejected, quite a more complex workflow to consider.
Brad seemed to be particularly alarmed by this raised 'security' issue BUT currently his ticket website uses the 'unsecure' process of sending the initial js form data, which anyone can manipulate by looking at the source code or using the browser inspection tools, where the form data can easily be altered.
Obviously this posses issues and makes the whole process far more complex. I've seen developers (including myself) try to disguise the process by inserting the payment form on a 'self-sending' page with just a processing message appearing in the browser but its still easy to stop the browser and gain access to the form code, especiallly in cases where there is a time lag contacting the gateway provider.
Which brings me to the point. How much of an issue is this. Should the seller not be checking their end that they are only sending goods out which match with the orders coming in? I can see a big issue if the product being sold is a digitally download but if the order needs manual overseeing and distributing how much of an issue is it. I mean if I went to a shop and tried to pass over a fiver for something which cost a tenner and the cashier didnt check I'd provided the correct money..........how is the web different, apart form in a few unique circumstances.
Just trying to kick around a few thoughts to be considered on the subject, any thoughts from yourself?
If anyone else wants to chime in please do so.
