This repository has been archived by the owner on Jun 20, 2019. It is now read-only.
karlforshaw/Zend-Paypal-Notification
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Example code: class PaypalNotificationController extends Zend_Controller_Action { public function init() { /* Initialize action controller here */ } public function indexAction() { $primaryPaypal = 'me@myemailprovider.com'; $ipn = new Application_Model_PaypalNotification($_POST, $primaryPaypal); if ($ipn->validate()) { if ($ipn->isCompleted()) { // Check if already processed $paypalMapper = new Application_Model_PayPalMapper(); // Check reciever email if (! $ipn->isInMyPocket()) throw new Exception( 'Receiver email is not mine!' ); // Does the payment amount cover the invoice cost? if (! $ipn->isCorrectAmount($correctAmount)) throw new Exception('Incorrect amount paid!'); // Process payment } elseif ($ipn->isReversed()) { // TODO Ban user! } } else throw new Exception( 'IPN didnt validate' ); } }
About
A Paypal IPN model for Zend Framework
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published