Skip to content
This repository has been archived by the owner on Aug 18, 2020. It is now read-only.
/ php-payment Public archive

An unified payment library for PHP that supports Paypal, Authorize.net and 2Checkout.

Notifications You must be signed in to change notification settings

phpfour/php-payment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

PHP Payment

A payment library for PHP that supports Paypal, Authorize.net and 2Checkout.

  • Easy to integrate
  • Supports single order checkout
  • Unified interface for all payment gateways
  • Template for redirection page

Usage

Initiating a paypal checkout

$paypal = \Rbs\Payment\Factory::factory('Paypal');

$paypal->setAccountIdentifier('[email protected]');
$paypal->setCurrency('USD');
$paypal->setSingleItem('T-shirt', 4.99, "1001");

$paypal->setReturnOnSuccessUrl('http://phpfour.com/payment/paypal_success.php');
$paypal->setReturnOnFailureUrl('http://phpfour.com/payment/paypal_failure.php');
$paypal->setNotificationUrl('http://phpfour.com/payment/paypal_ipn.php');

$paypal->proceed();

Verifying paypal IPN response

$paypal = \Rbs\Payment\Factory::factory('Paypal');
$client = \Rbs\Payment\Http\Client();

$paypal->populate($_POST);
$paypal->setHttpClient($client);

$status = $paypal->verify();

More updates coming soon.

Dependencies

To run the unit tests, you must have the following excellent libraries installed via PEAR:

About

An unified payment library for PHP that supports Paypal, Authorize.net and 2Checkout.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages