Skip to content

Etherscan.io driver for the Omnipay PHP payment processing library

License

Notifications You must be signed in to change notification settings

michaelstivala/omnipay-etherscan

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Omnipay: Etherscan.io gateway

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

Installation

composer require financialplugins/omnipay-etherscan

Usage

Initialize

This step is required before using other methods.

$gateway = Omnipay::create('Etherscan');
   
$gateway->initialize([
    'api_key' => '...',
    'network' => 'main' // kovan or ropsten can also be used
]);

Fetch Address Balance

$response = $gateway->fetchBalance(['address' => '0xAAAAAAAAAA...'])->send();

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

Fetch Contract (ERC20 token) Address Balance

$response = $gateway->fetchTokenBalance([
    'address' => '0xAAAAAAAAAA...',
    'contract_address' => '0xAAAAAAAAAA...'
])->send();

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

Fetch Transaction Info

$response = $gateway->fetchTransaction(['transactionReference' => '0xAAAAAAAAAA...'])->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.

About

Etherscan.io driver for the Omnipay PHP payment processing library

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%