Adding Credit Card on Checkout and saving order/order details
I have to add credit card payment from a company not supported by your software. Therefore I have to do all the checkout pages manually. Just to understand the process correctly:
1 I have the order overview page with the cart, the address data and the selected payment method (in this example cc-payment)
2 the client clicks on the "Pay"button
3 I send the total amount and all the needed IDs to the cc-company checkout page
4 the client enters his cc-data on the cc-company website
5 the cc-company send a success (or an error) key, and all the other ids back to a confirm (or error) page on my shop-website
6 I update the order/order details on the database on my confirm page "when the page loads"
7 I send confirmation emails
8 I remove all the sessions
Is this the correct way/process?
What is not clear to me: how do I know that the return data belongs to the correct order? Do I have to save the order data after point 3 to the database first with a (not yet paid) flag and after the cc-company calls my confirm page, I filter the order and set the "not yet paid" flag to "Paid"?
Thanks for any information on this.