2017 © Pedro Peláez
 

library sdk

image

agile-pay/sdk

  • Sunday, November 5, 2017
  • by a-colaneri
  • Repository
  • 1 Watchers
  • 0 Stars
  • 11 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

Code climate

Install

$ composer require agile-pay/sdk

Usage

$agilePay = new \AgilePay\Sdk\AgilePay([
    'api_key' => '',
    'api_secret' => ''
]);

Gateways

To create a new gateway :

$gateway = $agilePay->gateway()->create('stripe', [
    'secret_key' => ''
]);

The response will contain a gateway reference which is used to perform transactions against the gateway, (*1)

$gateway->reference;

Payment methods

To create a new payment method type of gateway token:

In this case the payment method will be retained with the provided gateway, please check the availability of transaction store in the gateways, (*2)

Gateways list -> http://docs.agilepay.io/#!/gateway, (*3)

Gateway token -> http://docs.agilepay.io/#!/payment-method-create-gateway-token, (*4)

$paymentMethod = $agilePay->paymentMethod()->createGatewayToken($gateway->reference, [
    'number' => '',
    'holder_name' => '',
    'cvv' => '',
    'expiry_month' => '', //mm
    'expiry_year' => '',  //yy
]);

The response will contain a payment method token which is used to perform transactions against the payment method, (*5)

$paymentMethod->token;

Transactions

Auth (Charge a credit card with a payment method type of gateway token):

$transaction = $agilePay->transaction()
                ->setPaymentMethod($paymentMethod->token;)
                ->auth(500, 'eur'); //Charging 5.00 euros

The response will contain a reference which can be used for second steps transactions such as void, capture and refund, (*6)

$transaction->reference;

Void (Cancel an authorized transaction):

$response = $agilePay->transaction($transaction->reference)->void();

Capture (Settle an authorized transaction):

$response = $agilePay->transaction($transaction->reference)->capture();

Credit (Refund a settled transaction):

$response = $agilePay->transaction($transaction->reference)->credit();

The Versions

05/11 2017

dev-master

9999999-dev

  Sources   Download

MIT

The Requires

 

The Development Requires

by Alessandro Colaneri

05/11 2017

v1.0.2

1.0.2.0

  Sources   Download

MIT

The Requires

 

The Development Requires

by Alessandro Colaneri

29/10 2017

v1.0.1

1.0.1.0

  Sources   Download

MIT

The Requires

 

The Development Requires

by Alessandro Colaneri

22/10 2017

v1.0.0

1.0.0.0

  Sources   Download

MIT

The Requires

 

The Development Requires

by Alessandro Colaneri

26/09 2017

v1.0.0-beta

1.0.0.0-beta

  Sources   Download

MIT

The Requires

 

The Development Requires

by Alessandro Colaneri