That's fine and standard way most people implement. If gateway supports - you could pass in the order id or a custom field - unique order id - that you can check again once payment goes through and compare with current session or even use to update the corresponding order or payment in the database
Mar 14, 2019
1
Level 4
feedback to my shopping cart logic
Hello, I would appreciate feedback to logic behind my shopping cart. At /stage1 user fills data like name address etc. which i store as temporary session. Then I redirect him to /stage2 with key to that session. At /stage2 is payment wall. With JS I catch the key and store it locally then retrieve it and insert it to hidden input. After clicking "pay" I retrieve session in controller using key from hidden input to pair the user's data with payment.
Level 15
Please or to participate in this conversation.