Harry Beasant
Harry Beasant

Reputation: 1014

Catching form data before POST, PayPal Form

I basically have a normal looking form for a POST to PayPal, for payments. I have seen other sites, be able to post to an internal page and then redirect to the PayPal checkout page.

The reason I need to do this is because one of the form inputs has a user generated value. Therefore I need to post the data to an internal PHP script, save the relevant data and then redirect the user to the checkout page on PayPal.

How would I go about doing this?

Regards, Harry

Upvotes: 2

Views: 382

Answers (1)

quickshiftin
quickshiftin

Reputation: 69581

If you want to POST to your server first though and have it forward the request to PayPal is through CURL. Checkout this class from wp-e-commerce it pretty much shows you an entire implementation.

Another way you could do it would be to use Javascript. Submit the first component to your server with one AJAX request. Then (after success response from first request) submit the PayPal form to PayPal programmatically.

Upvotes: 3

Related Questions