dev-master
9999999-devGo Pague PHP Library
MIT
The Requires
- php >=7.0.1
- guzzlehttp/guzzle ~6.0
The Development Requires
by Bruno Ferme Gasparin
library gopague
Wallogit.com
2017 © Pedro Peláez
Go Pague PHP Library
PHP 7.0.1 and later., (*1)
You can install the bindings via Composer. Run the following command:, (*2)
composer require gopague/gopague-php
To use the go pague classes, use Composer's autoload:, (*3)
require_once('vendor/autoload.php');
This library require the following extension in order to work properly:, (*4)
curl, although you can use your own non-cURL client if you preferjson (JSON handler)mbstring (Multibyte String)If you use Composer, these dependencies should be handled automatically. If you install manually, you'll want to make sure that these extensions are available., (*5)
First you need set the email and password of the user to login to Go Pague API., (*6)
GoPague\Http\Client::setEmail('myemail@foo.bar')
GoPague\Http\Client::setPassword('secret');
Now you can use the resource binding classes to interact with Go Pague API., (*7)
// gets the list of banks $banks = GoPague\Bank::all();
Note: See
Resource Binding Classessection to know all classes and methods available., (*8)
The binding classes will automatically use the previous given email and password to login and autenticate to the API before the first API request., (*9)
But if you want to autenticate to API manually, just use:, (*10)
$credential = GoPague\Http\Client::login('myemail@foo', 'secret');
// gets the list of banks
$banks = GoPague\Bank::all();
// ...
You can access the Logged User data any time just calling the method:, (*11)
$credencial = GoPague\Http\Client::credential(); echo $credential->token; // the Authenticated Token echo $credential->userId; // the Authenticated User Id echo $credential->clientIds; // The client ids linked to the Authenticted User
@todo, (*12)
Install dependencies:, (*13)
``` bash composer install, (*14)
## Tests Install dependencies as mentioned above (which will resolve [PHPUnit](http://packagist.org/packages/phpunit/phpunit)), then you can run the test suite: ```bash ./vendor/bin/phpunit
The GoPague PHP Library is open-sourced software licensed under the MIT license., (*15)
Go Pague PHP Library
MIT
library gopague