Skip to content

Latest commit

 

History

History
34 lines (29 loc) · 1.17 KB

File metadata and controls

34 lines (29 loc) · 1.17 KB

AddPay PHP REST Client

This is a standard, off the shelf HTTP REST CLIENT that does AddPay authentication behind the scenes for every API call, zero maintenance is required. You pass the desired payload across as a simple array, no complex object involved.

Why?

  • Data parsing is consistent, the body will always be returned as a generic object class even in the event of a failure.
  • Simple, 1-line API calls.
  • No magic, everything is transparent and standardized. REST.
  • No low-level code. You don't have to deal with the pains of curl options.
  • No maintenance. If a new endpoint is created, simply add your new line: Api::get($newEndpoint); or for a post use (Api::post($endPoint)->send())->body and you're done.

How To

See the exmaples for full usage, or if that isn't clear enough to you:

  • Instantiate the AddPay HTTP Library once-off:
require('package/src/bootstrap');

use \AddPay\Api;

addpay([
  'client_id'       => 'client_id_here',
  'client_secret'   => 'client_secret_here',
  'client_live'     => false
]);
  • Call any API endpoint:
$restCall = Api::get('/transactions')->send();
  • Getting the result:
$restCall->body;