PHP Class for verifying PayPal IPN messages
PHP Class for verifying PayPal Instant Payment Notification (IPN) messages.
Use the PaypalIPN
class in your project to handle the encoding of POST data, post back to PayPal, and parsing of the response from PayPal., (*1)
To install this package using composer:, (*2)
composer require overint/php-paypal-ipn
use overint\PaypalIPN; $ipn = new PaypalIPN(); $ipn->useSandbox(); $verified = $ipn->verifyIPN(); if ($verified){ //process IPN }
useSandbox
function.This code is intended for web developers. You should understand how the IPN process works conceptually and you should understand when and why you would be using IPN. Reading the PayPal Instant Payment Notification Guide is a good place to start., (*3)
You should also have a [PayPal Sandbox Account][2] with a test buyer account and a test seller account. When logged into your sandbox account there is an IPN simulator under the 'Test Tools' menu which you can used to test your IPN listener., (*4)
Once you have your sandbox account setup, you simply create a PHP script that
will be your IPN listener. In that script, use the PaypalIPN
class as shown
above in the example use case., (*5)