dann95/g2a-sdk is a Laravel package for g2a sdk.
It currently has 1 GitHub stars and 139 downloads on Packagist (latest version 0.1.0).
Install it with composer require dann95/g2a-sdk.
Discover more Laravel packages by dann95
or browse all Laravel packages to compare alternatives.
Last updated
This SDK is an unofficial software with no warranties by G2A PAY ®, you can check more about G2A in: https://www.g2a.com/
You can install the sdk via Composer. Run the following command:
composer require dann95/g2a-sdk
To use the bindings, use Composer's autoload:
require_once('vendor/autoload.php');
Due some API limitations from G2A, this SDK is restricted to few operations, see the table below to know what this SDK can do. API means that this is available on this SDK
EMAIL means that is only available by e-mail contact
DASHBOARD means that is only available in merchant dashboard
| create | query | refund | |:-:|:-:|:-:| | API | API | EMAIL |
| create | cancel | query | refund | list transactions | |:-:|:-:|---|---|---| | API | DASHBOARD | DASHBOARD | EMAIL | DASHBOARD |
Setting up credentials be like:
$hash = '485d733d-7937-414a-8d42-6781397b1c0a';
$mail = '[email protected]';
$secret = 'pSO_-N%GZDGfpLu!a5qOUnA>T7QqOro?4?z~Lt5u@LKgg>X247PYvZX8gwy~YY=c';
$env = 'SANDBOX';
$sdk = new \G2A\Sdk(
$hash,
$mail,
$secret,
$env
);
Insert the provider into providers array in config/app.php
'providers' => [
// previous providers
\G2A\Integrations\Laravel\G2aServiceProvider::class,
// next providers
]
Then run the following command:
php artisan vendor:publish --tag=g2a
Edit the file configs/g2a.php, you will have something like this
prefer use env() helper instead of strings to save your credentials
<?php
/**
* to obtain hash and secret, go to:
* https://www.test.pay.g2a.com/setting/merchant (in case of SANDBOX)
* https://www.pay.g2a.com/setting/merchant (in case of PRODUCTION)
* email is your account e-mail.
*/
return [
'hash' => '',
'secret' => '',
'email' => '',
'environment' => 'SANDBOX', // SANDBOX || PRODUCTION
];
Now when you do, it will give you a fresh instance of SDK using settings on config/g2a.php:
$sdk = app('G2A');
Or, when inside a Controller/any part of Laravel where Auto Dependency Injection is available:
class FooBarController extends Controller
{
public function checkout(\G2A\Sdk $sdk)
{
dd($sdk);
}
}
Feel free to contribute to this repository.