PHP code example of alekseyblymin / omnipay-bitbanker

1. Go to this page and download the library: Download alekseyblymin/omnipay-bitbanker library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

alekseyblymin / omnipay-bitbanker example snippets


    composer 

use Omnipay\Omnipay;

$gateway = Omnipay::create('bitBanker');

$gateway->setApiKey('1234');

//Включение тестового режима
$gateway->setTestMode(true);

$response = $gateway->purchase([
    "payment_currencies" => ["BTC"],
    "currency" => "RUB",
    "amount" => 5000,
    "description" => "покупка ноутбука модель ACer..",
    "header" => "Фирма",
    "is_convert_payments" => false,
    "data" => "{}",
])->send();

if ($response->isSuccessful()){

    echo $response->getInvoiceId();
    echo $response->getInvoiceLink();
    
} else {

    echo $response->getMessage();
    
}

use Omnipay\Omnipay;

$gateway = Omnipay::create('bitBanker');

$gateway->setApiKey('1234')
        ->setSecretKey('4321');
        
//Данные которые использовались при создании счета
$response = $gateway->completePurchase([
    "transactionId" => "321dd",
    "currency" => "RUB",
    "amount" => 5000,
    "description" => "покупка ноутбука модель ACer..",
    "header" => "Фирма",
]);

$response->getTransactionId();

if ($response->isSuccessful()) {
    print_r($response->getAmount());
    print_r($response->getCurrency());
}