Reputation: 67
Ive written a checkout form. I fill out the form data and now its time to take the data to checkout. I can insert the data into mySQL, etc...
I dont have much experience in online checkout procedures. My question is what steps or procedure is next after the form is filled out?
I know the customer will be sent to PayPal. So should I go ahead and enter the data into mySQL as unpaid or something and then send them to PayPal? Then once the transaction is complete, the transaction data be sent back to the form where it would then update the mySQL data and send the customer to a receipt?
Im looking to build a standard checkout.
Upvotes: 2
Views: 2086
Reputation: 26056
I would recommend calculating everything about the order and saving it in your database prior to sending the user over to PayPal. This way you can include your Order ID in the PayPal payment info so you can easily cross-reference transactions between PayPal and your own system.
If you want to keep things as simple as possible you can go with PayPal Payments Standard. I would recommend the cart upload method if you plan on using that.
If you prefer web service API's I would recommend Express Checkout. This will give you more freedom to customize the checkout experience to suit your needs.
Either way, I would recommend handling post-payment processing using Instant Payment Notification (IPN). This will allow you to update your database, hit 3rd party web services, send out customized email receipts, etc. in real-time. It will also allow you to correctly handle pending payments that need to clear, like e-checks, in which case you'd get 1 IPN for the pending payment and another IPN when that payment actually clears. This way you can make sure to only process the order when the payment is completed.
Upvotes: 0
Reputation: 1944
We can define a standard e-commerce checkout like the following (assuming that you are using paypal):
Also check this paypal express checkout sample code: https://github.com/hrendoh/PayPal-Express-Checkout-example
Upvotes: 1