2017 © Pedro Peláez
 

library paypal-ipn

PayPal IPN (Instant Payment Notification) handling driver for PHP.

image

sudiptpa/paypal-ipn

PayPal IPN (Instant Payment Notification) handling driver for PHP.

  • Wednesday, July 18, 2018
  • by sudiptpa
  • Repository
  • 2 Watchers
  • 4 Stars
  • 2,596 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 1 Open issues
  • 7 Versions
  • 44 % Grown

The README.md

PayPal IPN

PayPal Instant Payment Notification Listener driver for PHP, (*1)

StyleCI Build Status Latest Stable Version Total Downloads License, (*2)

Requirements

This package requires PHP >=5.5, (*3)

Installation

This package is installed via Composer. To install, simply add it to your composer.json file:, (*4)

  composer require sudiptpa/paypal-ipn

If you really need to work on guzzle 5.* pull version below., (*5)

  composer require sudiptpa/paypal-ipn:1.0.x-dev

And run composer to update your dependencies:, (*6)

$ curl -s http://getcomposer.org/installer | php
$ php composer.phar update

Basic Usage

The following are 2 different methods provided by the package to handle PayPal IPN., (*7)

Using ArrayListener by passing array of Data

  require __DIR__.'/vendor/autoload.php';

  use PayPal\IPN\Event\IPNInvalid;
  use PayPal\IPN\Event\IPNVerificationFailure;
  use PayPal\IPN\Event\IPNVerified;
  use PayPal\IPN\Listener\Http\ArrayListener;

  $listener = new ArrayListener;

  /*
   * Payload received from PayPal end.
   */
  $data = array(
      'foo' => 'bar',
      'bar' => 'baz',
  );

  $listener->setData($data);

  $listener = $listener->run();

  $listener->onInvalid(function (IPNInvalid $event) {
      $ipnMessage = $event->getMessage();

     // IPN message was was invalid, something is not right! Do your logging here...
  });

  $listener->onVerified(function (IPNVerified $event) {
      $ipnMessage = $event->getMessage();

      // IPN message was verified, everything is ok! Do your processing logic here...
  });

  $listener->onVerificationFailure(function (IPNVerificationFailure $event) {
      $error = $event->getError();

      // Something bad happend when trying to communicate with PayPal! Do your logging here...
  });

  $listener->listen();

Using InputStreamListener

  use PayPal\IPN\Event\IPNInvalid;
  use PayPal\IPN\Event\IPNVerificationFailure;
  use PayPal\IPN\Event\IPNVerified;
  use PayPal\IPN\Listener\Http\InputStreamListener;

  $listener = new InputStreamListener;

  $listener = $listener->run();

  $listener->onInvalid(function (IPNInvalid $event) {
      $ipnMessage = $event->getMessage();

      // IPN message was was invalid, something is not right! Do your logging here...
  });

  $listener->onVerified(function (IPNVerified $event) {
      $ipnMessage = $event->getMessage();

      // IPN message was verified, everything is ok! Do your processing logic here...
  });

  $listener->onVerificationFailure(function (IPNVerificationFailure $event) {
      $error = $event->getError();

      // Something bad happend when trying to communicate with PayPal! Do your logging here...
  });

  $listener->listen();

Contributing

Contributions are welcome and will be fully credited., (*8)

Contributions can be made via a Pull Request on Github., (*9)

Testing

PayPal provide an Instant Payment Notification (IPN) simulator here: https://developer.paypal.com/docs/classic/ipn/integration-guide/IPNSimulator/, (*10)

Support

If you are having general issues with the package, feel free to drop me and email sudiptpa@gmail.com, (*11)

If you believe you have found a bug, please report it using the GitHub issue tracker, or better yet, fork the library and submit a pull request., (*12)

License

This package is open-sourced software licensed under the MIT license., (*13)

The Versions

18/07 2018

dev-3.0-upgrade

dev-3.0-upgrade

PayPal IPN (Instant Payment Notification) handling driver for PHP.

  Sources   Download

MIT

The Requires

 

The Development Requires

paypal ipn

18/07 2018

dev-master

9999999-dev

PayPal IPN listener driver for PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

paypal ipn

18/07 2018

v2.0.1

2.0.1.0

PayPal IPN listener driver for PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

paypal ipn

18/07 2018

dev-patch-1

dev-patch-1

PayPal IPN listener driver for PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

paypal ipn

02/01 2017

2.0.0

2.0.0.0

PayPal IPN listener driver for PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

paypal ipn

02/01 2017

1.0.x-dev

1.0.9999999.9999999-dev

PayPal IPN listener driver for PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

paypal ipn

02/01 2017

1.0.1

1.0.1.0

PayPal IPN listener driver for PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

paypal ipn