2017 © Pedro Peláez
 

library g2a-sdk

G2A SDK

image

dann95/g2a-sdk

G2A SDK

  • Sunday, February 4, 2018
  • by thusk
  • Repository
  • 1 Watchers
  • 1 Stars
  • 15 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 7 % Grown

The README.md

G2A PAY PHP-SDK

Latest Stable Version Total Downloads Latest Unstable Version License Build Status StyleCI composer.lock, (*1)

This SDK is an unofficial software with no warranties by G2A PAY ®, you can check more about G2A in: https://www.g2a.com/, (*2)

Contents

Requirements

  • PHP 7.0 and later.
  • Guzzle 6

Composer

You can install the sdk via Composer. Run the following command:, (*3)

composer require dann95/g2a-sdk

To use the bindings, use Composer's autoload:, (*4)

require_once('vendor/autoload.php');

Available resources

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, (*5)

EMAIL means that is only available by e-mail contact, (*6)

DASHBOARD means that is only available in merchant dashboard, (*7)

Payments

create query refund
API API EMAIL

Subscriptions

create cancel query refund list transactions
API DASHBOARD DASHBOARD EMAIL DASHBOARD

Getting Started

Normal Integration

Setting up credentials be like:, (*8)

$hash   = '485d733d-7937-414a-8d42-6781397b1c0a';
$mail   = 'merchant@my-test-store.com';
$secret = 'pSO_-N%GZDGfpLu!a5qOUnA>T7QqOro?4?z~Lt5u@LKgg>X247PYvZX8gwy~YY=c';
$env    = 'SANDBOX';
$sdk = new \G2A\Sdk(
    $hash,
    $mail,
    $secret,
    $env
);

Laravel integration (optional integration)

Insert the provider into providers array in config/app.php, (*9)

'providers' => [
    // previous providers
     \G2A\Integrations\Laravel\G2aServiceProvider::class,   
    // next providers
]

Then run the following command:, (*10)

php artisan vendor:publish --tag=g2a

Edit the file configs/g2a.php, you will have something like this, (*11)

prefer use env() helper instead of strings to save your credentials, (*12)

<?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:, (*13)


$sdk = app('G2A');

Or, when inside a Controller/any part of Laravel where Auto Dependency Injection is available:, (*14)

class FooBarController extends Controller
{
    public function checkout(\G2A\Sdk $sdk)
    {
        dd($sdk);
    }
}

Goals/Todo

  • [ ] 100% Unit coverage
  • [ ] Use abstraction of HttpClient instead of Guzzle
  • [ ] Do a Legacy version, for php 5.4+
  • [ ] Full error detailed Exceptions and Entities
  • [ ] Release first stable version (1.0.0)

Contribute

Feel free to contribute to this repository., (*15)

The Versions

04/02 2018

dev-master

9999999-dev

G2A SDK

  Sources   Download

MIT

The Requires

 

The Development Requires

by Daniel Rubin

laravel payment sdk g2a pay g2a

01/02 2018

dev-entity-errors

dev-entity-errors

G2A SDK

  Sources   Download

MIT

The Requires

 

The Development Requires

by Daniel Rubin

laravel payment sdk g2a pay g2a

30/01 2018

0.1.0

0.1.0.0

G2A SDK

  Sources   Download

MIT

The Requires

 

The Development Requires

by Daniel Rubin

laravel payment sdk g2a pay g2a

30/01 2018

dev-analysis-8QYvaZ

dev-analysis-8QYvaZ

G2A SDK

  Sources   Download

MIT

The Requires

 

The Development Requires

by Daniel Rubin

laravel payment sdk g2a pay g2a

26/01 2018

dev-analysis-qrle0Z

dev-analysis-qrle0Z

G2A SDK

  Sources   Download

MIT

The Requires

 

The Development Requires

by Daniel Rubin

laravel payment sdk g2a pay g2a