gmwebs Posted May 27, 2006 Share Posted May 27, 2006 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? Quote Link to comment https://forums.phpfreaks.com/topic/10611-advice-needed-for-online-shop-checkout-process/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.