g4/gateway

gateway php library

3.2.0 2024-02-20 09:13 UTC

README

gateway - php library

Install

Via Composer

composer require g4/gateway

Usage

use G4\Gateway\Options;
use G4\Gateway\Http;

$options = new Options();
$options
    ->addHeader('Accept', 'application/json')   // optional
    ->setTimeout(30)                            // optional
    ->setSslVerifyPeer(true);                   // optional
    
$http = new Http('http://api.url', $options)
$http
    ->setServiceName('maps');                   // optional

$response = $http->get(['id' => 123]);          // post(), put(), delete()

echo $response->getCode();
echo $response->getBody();

Development

Install dependencies

$ make install

Run tests

$ make unit-tests

License

(The MIT License) see LICENSE file for details...