Jump to content


This topic is now archived and is closed to further replies.


Advice needed for Online Shop checkout process

Recommended Posts

For the life of me I can't seem to get my head around the procedure I need to follow in order to accomplish the following...

My online shop uses PayPal for the payment gateway. So a user can add items to their cart, and then go to the checkout page where they can confirm everything. If the user is happy, they click on the confirm button which *should* do the following:

[blockquote]Execute MySQL code to create an invoice.
Retrieve the invoice number from the DB.
Submit the details to the PayPal gateway, including the invoice number for post-back via IPN.[/blockquote]
Whereafter the normal PayPal process kicks in, and the user can login and pay. They are then re-directed to a thankyou page, etc.

Now I know that I can post the data to an intermediary script, strip out the stuff I need, write it to the DB, populate a form with hidden fields, and then auto-submit the form to PayPal using Javascript. However, I want to be able to do this without relying on Javascript being turned on in the browser. Granted, it will degrade quite gracefully, as the submit button will be shown if Javascript is turned off.

I thought about sending headers to the PayPal gateway after doing the DB stuff, but I am not sure whether it will work, as the user sort of needs to get to the PayPal script at the same time as their POST data if you know what I mean. If you use headers, it just sits there on a blank screen, while the headers have happily been sent, and the user doesn't get to the PayPal login page.

Any ideas, or am I just going to have to do the Javascript method?

Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.