Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Checking if paypal payment was successful

I have downloaded sample code from paypal to allow me to use parallel payments via their sandbox accounts. When I run parallel.php, I get redirected to paypal's sandbox login page.

How am I supposed to know "server side" that the payment has been made successfully, so I can update my database records?

like image 940
oshirowanen Avatar asked Feb 25 '23 15:02

oshirowanen


2 Answers

I believe you have to work with PayPals IPN system. This will basically send a confirmation to your server that tells you it has gone through.

https://www.paypal.com/ipn

like image 143
4imble Avatar answered Mar 07 '23 04:03

4imble


Paypal lets you register a notification url which is part of the IPN (instant payment notification IIRC) system. So if someone pays by a delayed payment (such as a bank transfer) the transaction will update days later. You need to have an application (web page) on your server that can be called by Paypal with transaction details to update a payment.

You'll need to create an initial transaction record in your system when paypal redirects back to you so refer to their documentation for that. I'd also recommend looking at either OSCommerce or Zen cart for an idea of how they do it as they support the same kind of thing.

like image 25
Simon Avatar answered Mar 07 '23 04:03

Simon