rcastera / payment-api
Payment API
Requires
- php: >=5.3.0
- guzzle/guzzle: ~3.7
Requires (Dev)
- phpunit/phpunit: 3.7.*
This package is not auto-updated.
Last update: 2024-12-17 07:13:14 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
- Fork it.
- Create a branch (
git checkout -b my_branch
) - Commit your changes (
git commit -am "Added something"
) - Push to the branch (
git push origin my_branch
) - Create an Issue with a link to your branch
- Enjoy a refreshing Coke and wait