views:

168

answers:

1

I need to submit my cart to paypal in a <form />, (using the web payments standard option).

Rather than draw the contents of this form to the page, and have the 'place order' button post directly to paypal.com, is it possible to have the 'place order' button post back to me, for me to then post the cart, and redirect the user to the correct location?

If not the only option i could see would be to post the cart to paypal myself, retrieve some unique id, and then redirect the user to a page with this unique id, however i dont think 'web payments standard' supports this.

A: 

Paypal uses whats called IPN (Instant Payment Notification). You should have all your customer's data saved with some kind of identifier. Post your form to paypal including the identifier. They will post the results back to a page you have designated. This will allow you to match the results they are sending you with your saved data via your identifier so you can now process the order.

Copy Paste Code Sample: http://forums.asp.net/t/92314.aspx

used2could
So it's not possible to complete an action just before the user is directed to the payment gateway?
ajbeaven
Oh okay i see what you mean now. Perhaps using some javascript to execute a "synchronous" http post to your server and when that javascript function returns have it execute the form so that it posts to paypal like normal. Notice i said synchronous not asynchronous. This can be done very easily with jQuery.
used2could