rcastera/payment-api

Payment API

Installs: 1

Dependents: 0

Stars: 6

Watches: 2

Forks: 2

Language: PHP

v1.0.1 2014-02-02 01:58 UTC

README

The PaymentAPI allows you to easily process e-commerce transactions without having to worry about all the backend details of connecting and setting up the cURL options.

  • An extremely easy API.
  • Extensible to add many different payment gateways.
  • Consumes gateway api's using the Guzzle client.

Supported gateways

There are several gateways (Stripe, Authorize.net and Paypal to name a few) and more will be added but, if you need one that isn't supported yet, feel free to contribute. See supported gateways.

Setup

Add a composer.json file to your project:

{
  "require": {
      "rcastera/payment-api": "v1.0.0"
  }
}

Then provided you have composer installed, you can run the following command:

$ composer.phar install

That will fetch the library and its dependencies inside your vendor folder. Then you can add the following to your .php files in order to use the library (if you don't already have one).

require 'vendor/autoload.php';

Then you need to use the relevant class, and instantiate the gateway.

Example

require 'vendor/autoload.php';

use rcastera\PaymentAPI\Factory\PaymentFactory;
use rcastera\PaymentAPI\Exception\PaymentException;
use rcastera\PaymentApi\Util\PaymentUtil;

$authorize = PaymentFactory::get('Authorize.Aim');

Utility class

There's a utility class that's included for convenince. Learn more about the Utility class

Contributing

  1. Fork it.
  2. Create a branch (git checkout -b my_branch)
  3. Commit your changes (git commit -am "Added something")
  4. Push to the branch (git push origin my_branch)
  5. Create an Issue with a link to your branch
  6. Enjoy a refreshing Coke and wait