Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

PayPal IPN (Instant Payment Notification) handling PHP library. PayPal NVP/SOAP API integration guide following the article, and learn more.

License

NotificationsYou must be signed in to change notification settings

sudiptpa/paypal-ipn

Repository files navigation

PayPal Instant Payment Notification Listener driver for PHP

StyleCIBuild StatusLatest Stable VersionTotal DownloadsLicense

Requirements

This package requires PHP >=5.5

Installation

This package is installed viaComposer. To install, simply add itto yourcomposer.json file:

  composer require sudiptpa/paypal-ipn

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

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

And run composer to update your dependencies:

$ 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.

Using ArrayListener by passing array of Data

require__DIR__.'/vendor/autoload.php';usePayPal\IPN\Event\IPNInvalid;usePayPal\IPN\Event\IPNVerificationFailure;usePayPal\IPN\Event\IPNVerified;usePayPal\IPN\Listener\Http\ArrayListener;$listener =newArrayListener;/*   * 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

usePayPal\IPN\Event\IPNInvalid;usePayPal\IPN\Event\IPNVerificationFailure;usePayPal\IPN\Event\IPNVerified;usePayPal\IPN\Listener\Http\InputStreamListener;$listener =newInputStreamListener;$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 arewelcome and will be fullycredited.

Contributions can be made via a Pull Request onGithub.

Testing

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

Support

If you are having general issues with the package, feel free to drop me and emailsudiptpa@gmail.com

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

License

This package is open-sourced software licensed under theMIT license.

About

PayPal IPN (Instant Payment Notification) handling PHP library. PayPal NVP/SOAP API integration guide following the article, and learn more.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp