PHP code example of noname9 / api-php

1. Go to this page and download the library: Download noname9/api-php 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/ */

    

noname9 / api-php example snippets


$provider = new B2Binpay\Provider(
    'API_KEY',
    'API_SECRET'
);

$provider = new B2Binpay\Provider(
    'API_KEY',
    'API_SECRET',
    true
);

$bill = $provider->createBill(
    WALLET_ID,
    '0.00000001',
    'BTC',
    LIFETIME
);

$billCheck = $provider->getBill($bill->id);

$rates = $provider->getRates('USD');

$amount = $provider->convertCurrency('100', 'USD', 'BTC', $rates);

$amount = $provider->addMarkup($amount, 'BTC', 10);

$wallet = $provider->getWallet(WALLET_ID);

$bill = $provider->createBill(
    WALLET_ID,
    '0.00000001',
    'BTC',
    LIFETIME,
    TRACKING_ID,
    'https://my.callback.url/'
);

header('HTTP/1.1 200 OK');
exit('OK');

if (empty($headers['Authorization']) || ($headers['Authorization'] !== $provider->getAuthorization())) {
    header('HTTP/1.1 401 Unauthorized');
    exit();
}

    $ composer