carlosmls1 / avangate-php-rest-api-client
Installs: 4
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 10
pkg:composer/carlosmls1/avangate-php-rest-api-client
Requires
- php: ^5.6
- guzzlehttp/guzzle: 6.*
This package is auto-updated.
Last update: 2025-09-29 02:58:31 UTC
README
This is a simple client built on top of Guzzle.
Usage
Initialize by calling:
$client = new Client([ 'code' => MERCHANT_CODE, 'key' => MERCHANT_APIKEY, 'base_uri' => 'https://api.avangate.com/3.0/' ]);
Use as a Guzzle client
try { $response = $client->get('orders/?StartDate=2015-01-01'); $orderListing = json_decode($response->getBody()->getContents()); print_r($orderListing); } catch (\GuzzleHttp\Exception\ClientException $e) { $contents = json_decode($e->getResponse()->getBody()->getContents()); var_dump($contents->message); } catch (\Exception $e) { var_dump($e->getMessage()); }