webguru221 / paytrust-php
PayTrust88 API Client
dev-master
2019-01-22 07:56 UTC
Requires
- php: >=5.3.3
- guzzlehttp/guzzle: ~6.0
This package is auto-updated.
Last update: 2025-06-22 21:51:59 UTC
README
Setup
Composer:
composer require "webguru221/paytrust-php:dev-master"
Quickstart
Examples Using Factory
All following examples assume this step.
// The only required value is the 'key' $paytrust = new PayTrust\Factory([ 'key' => 'demo', 'base_url' => 'https://api.paytrust88.com' // default ]);
Note: You can prevent any error handling provided by this package by passing following options into client creation routine:
$paytrust = new PayTrust\Factory([ 'key' => 'demo', 'base_url' => 'https://api.paytrust88.com' // default ], null, [ 'http_errors' => false // pass any Guzzle related option to any request, e.g. throw no exceptions ], false // return Guzzle Response object for any ->request(*) call );
By setting http_errors
to false, you will not receive any exceptions at all, but pure responses.
For possible options, see http://docs.guzzlephp.org/en/latest/request-options.html.
Example Without Factory
<?php require 'vendor/autoload.php'; use PayTrust\Http\Client; use PayTrust\Resources\Contacts; $client = new Client(['key' => 'demo']); $transaction = new Transaction($client); $response = $transaction->start($params);
Status
If you see something not planned, that you want, make an issue and there's a good chance I will add it.
- Transaction:
- Payout:
- Banking:
- Report: