views:

36

answers:

2

Hi,
I am using paypal standard as my payment gateway.
My problem is that, in Paypal Standard payment method,

I have done my code as below:

When user click on return to merchant button from paypal then user return to the site with order data , and on that page my order entry will be inserted in my DB.

So my problem occur when someone pays but don't click on return to merchant link.

So in this case customer gets paid, but due to no entry my DB its not working proper.

Hope I am clear to all.

Thanks Avinash

+1  A: 

You have to set up a callback IPN that listens for PayPal's response when the check out has been completed. This script can then handle the data entry portion. A great place to start is PayPal and its developer network.

Your solution, as you already noticed, is sub-optimal and error-prone (anything that relies on certain user behavior is to some extend).

Jan Kuboschek
not getting properly, How can i do this my paypal hidden fields form.???
Avinash
Jan Kuboschek
A: 

Digesting the IPN with a listener is pretty much the same as what you would be doing on you PDT success/return page so I usually just do both. Having just the IPN will ensure data integrity but since its nice to have a PDT success page that has some logic in it that welcomes the user back and ensures them that their transaction was successful by breaking down the message, you might as well just do your order processing there as well. Just keep track of the transaction IDs so nothing gets processed twice.

jumpdart
But the user doesn't HAVE to return to the success site, which is why the IPN listener is crucial and absolutely mandatory.
Jan Kuboschek
fo sho! just sayin its nice to use the PDT as well
jumpdart