Kevin van der Burgt
Kevin van der Burgt

Reputation: 29

PayPal detect insufficient funds

We have a little problem in our system, we allow customers to pay using PayPal which is great!

But in the following situation we have this issue:

  1. A customer pays us using PayPal.
  2. We send the product to our customer when the transaction has completed.

A few days later, PayPal refuses to pay us because the customer have his PayPal account connected with his bank account. And the funds on that bank account is too low.

So, is there a way to let PayPal know us when this happens through API/URL call to our server ?

Upvotes: 0

Views: 764

Answers (1)

Drew Angell
Drew Angell

Reputation: 26056

As Dagon mentioned, IPN is the best way to handle this.

You'll setup a listener script on your server, and every time a transaction happens on your PayPal account, the PayPal server will POST data about that account to your listener script. You'll get different parameters depending on the type of transaction that occurs. You can see a list of the types and parameters here.

You can build your email notifications, database updates, etc. into your IPN script to fully automate post-payment processing tasks.

So, in the example you've provided, what would happen is when the transaction first takes place the IPN would be triggered with a payment_status of Pending, and then you'd also see a parameter called pending_reason with a value of echeck. This tells you the payment was made, but it's an echeck which takes time to clear, so the status again is Pending instead of Completed.

A few days later when that payment does clear (or fails) you'd get another IPN with an updated payment_status. Only upon receiving an actual COMPLETED payment_status would you then would you deliver the order.

Again, this can all be automated within your IPN script.

Upvotes: 2

Related Questions