0

I have a custom button that is calling paypal, standard checkout method. It's just like this: Passing price variable to PayPal with custom button

If the customer uses a credit card and paypal accept, then paypal redirect to my site and I "mark" the product as paid. But, after a while the bank reject it. How can I get this information? If I'm using standard checkout.

Community
  • 1
  • 1
Lücks
  • 3,806
  • 2
  • 40
  • 54

1 Answers1

1

Sounds like you're getting an e-check that hasn't cleared. Then a couple of days later when the payment should clear it fails for some reason.

The best way to handle this is to utilize Instant Payment Notification. Once configured, it will POST transaction data to a listener script that you have setup. This script can receive that data and update your database, send out email notifications, or anything else you want to automate based on different transaction types.

In the case of e-check the IPN data would have a payment_status of Pending, and then when that payment status changes you would get another IPN with the same transaction ID, but the new status. That way you can wait to deliver goods until the payment status of any transaction is actually Completed as opposed to anything else.

Drew Angell
  • 25,968
  • 5
  • 32
  • 51
  • Hi! Thanks Andrew. I have two more questions about this 1) How can I identify the transaction when I send the user to paypal's checkout website? 2) How can I test the button? I can't find how to set the environment – Lücks Oct 03 '14 at 13:56
  • With payments standard you could use the "invoice" parameter to include your own invoice/order ID which would be returned in IPN, or you could also use the "custom" parameter, which again would be returned in IPN as well. To setup the sandbox create an account at http://developer.paypal.com, and then go into the Dashboard, and then into Accounts. That's where you create sandbox accounts. You'll need 1 buyer and 1 seller (at least). You'll have separate API credentials for your sandbox seller, so use those just like you would a live account, but the API endpoint will be the sandbox. – Drew Angell Oct 03 '14 at 20:23