financialplugins/omnipay-trongrid

Trongrid driver for the Omnipay payment processing library

1.1 2020-12-19 10:49 UTC

This package is auto-updated.

Last update: 2024-04-29 04:27:50 UTC


README

Trongrid.io driver for the Omnipay PHP payment processing library.

Installation

composer require financialplugins/omnipay-trongrid

Usage

Initialize

This step is required before using other methods.

$gateway = Omnipay::create('Trongrid');
   
$gateway->initialize([
    'network' => 'api.trongrid.io' // 'api.shasta.trongrid.io'
]);

Fetch Address Balance

$response = $gateway->fetchBalance(['address' => '4158b637e78d6f2069a50976c4e3719a1d8bea7cea'])->send();

if ($response->isSuccessful()) {
    $data = $response->getData();
} else {
    $errorMessage = $response->getMessage();
}

Note that the account balance is returned in SUN, not decimal.

Fetch Transaction Info

$response = $gateway->fetchTransaction(['transaction_id' => '109a0ea9b4c50f15f6a73ee823dabafe020471b6fcb4340059252bd19fd6320f'])->send();

if ($response->isSuccessful()) {
    $data = $response->getData();
} else {
    $errorMessage = $response->getMessage();
}

Support

If you are having general issues with Omnipay, we suggest posting on Stack Overflow. Be sure to add the omnipay tag so it can be easily found.

If you want to keep up to date with release anouncements, discuss ideas for the project, or ask more detailed questions, there is also a mailing list which you can subscribe to.

If you believe you have found a bug, please report it using the GitHub issue tracker, or better yet, fork the library and submit a pull request.