Jump to content

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?
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.