PHPackages                             dann95/g2a-sdk - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Payment Processing](/categories/payments)
4. /
5. dann95/g2a-sdk

ActiveLibrary[Payment Processing](/categories/payments)

dann95/g2a-sdk
==============

G2A SDK

0.1.0(8y ago)11391MITPHP

Since Jan 30Pushed 8y ago1 watchersCompare

[ Source](https://github.com/dann95/g2a-php-sdk)[ Packagist](https://packagist.org/packages/dann95/g2a-sdk)[ RSS](/packages/dann95-g2a-sdk/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (1)Dependencies (3)Versions (3)Used By (0)

G2A PAY PHP-SDK
===============

[](#g2a-pay-php-sdk)

[![Latest Stable Version](https://camo.githubusercontent.com/c684afc4f63e57ac6d9218833a5c03dd9bad59f88f8de8eb444e00fc2e6bac99/68747470733a2f2f706f7365722e707567782e6f72672f64616e6e39352f6732612d73646b2f762f737461626c65)](https://packagist.org/packages/dann95/g2a-sdk)[![Total Downloads](https://camo.githubusercontent.com/c023e6ef7d0ae696d0dc91c3014a50d829efe4d3d7a3864a3a8e5a789152110a/68747470733a2f2f706f7365722e707567782e6f72672f64616e6e39352f6732612d73646b2f646f776e6c6f616473)](https://packagist.org/packages/dann95/g2a-sdk)[![Latest Unstable Version](https://camo.githubusercontent.com/70c1d27dd8a8f43a026c04cf727cb09208da597871f9b38a0ae07c7c2bcb4ba5/68747470733a2f2f706f7365722e707567782e6f72672f64616e6e39352f6732612d73646b2f762f756e737461626c65)](https://packagist.org/packages/dann95/g2a-sdk)[![License](https://camo.githubusercontent.com/b028ee2ed5c61b62d2fee782fabdf6c7460ce8176f97055ce4cfe9fe41a4db68/68747470733a2f2f706f7365722e707567782e6f72672f64616e6e39352f6732612d73646b2f6c6963656e7365)](https://packagist.org/packages/dann95/g2a-sdk)[![Build Status](https://camo.githubusercontent.com/38d080de30839231f4cefb03dd21cb13dfd78a5993d79ce27f3cdbda1d22786f/68747470733a2f2f7472617669732d63692e6f72672f64616e6e39352f6732612d7068702d73646b2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/dann95/g2a-php-sdk)[![StyleCI](https://camo.githubusercontent.com/7334bc81f8b18fb230087585d0ec580d2ce5dd6fddc0b5b29e2395542c36f629/68747470733a2f2f7374796c6563692e696f2f7265706f732f3131383132363535322f736869656c643f6272616e63683d6d6173746572)](https://styleci.io/repos/118126552)[![composer.lock](https://camo.githubusercontent.com/8521ea82babdd5c7aee17311eac344c08c2dca31352e31c9611473e040af3085/68747470733a2f2f706f7365722e707567782e6f72672f64616e6e39352f6732612d73646b2f636f6d706f7365726c6f636b)](https://packagist.org/packages/dann95/g2a-sdk)

This SDK is an unofficial software with no warranties by G2A PAY ®, you can check more about G2A in:

Contents
--------

[](#contents)

- [Requirements](#requirements)
- [Installation](#composer)
- [Available resources](#available-resources)
- [Getting started](#getting-started)
    - [Checkout sample](samples/checkout.php)
    - [IPN Verify sample](samples/ipn.php)
    - [Subscription sample](samples/subscription.php)
    - [Query payment sample](samples/query-transaction.php)
- [Laravel integration](#laravel-integration-optional-integration)
- [Project goals/todo](#goalstodo)
- [Contribute](#contribute)

Requirements
------------

[](#requirements)

- PHP 7.0 and later.
- Guzzle 6

Composer
--------

[](#composer)

You can install the sdk via [Composer](http://getcomposer.org/). Run the following command:

```
composer require dann95/g2a-sdk
```

To use the bindings, use Composer's [autoload](https://getcomposer.org/doc/00-intro.md#autoloading):

```
require_once('vendor/autoload.php');
```

Available resources
-------------------

[](#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

EMAIL means that is only available by e-mail contact

DASHBOARD means that is only available in merchant dashboard

### Payments

[](#payments)

createqueryrefundAPIAPIEMAIL### Subscriptions

[](#subscriptions)

createcancelqueryrefundlist transactionsAPIDASHBOARDDASHBOARDEMAILDASHBOARDGetting Started
---------------

[](#getting-started)

### Normal Integration

[](#normal-integration)

Setting up credentials be like:

```
$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)

[](#laravel-integration-optional-integration)

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**

```
