PHP code example of pacerit / bitbaypay-api-php

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

    

pacerit / bitbaypay-api-php example snippets


$client = new BitBayPay();

$parameters = [
    BitBayPayInterface::PARAMETER_DESTINATION_CURRENCY => 'PLN',
    BitBayPayInterface::PARAMETER_PRICE                => '1000',
    BitBayPayInterface::PARAMETER_ORDER_ID             => 'randomstring',
    // This parameters below, are not :PARAMETER_FAILURE_CALLBACK_URL => '',
    // BitBayPayInterface::PARAMETER_NOTIFICATIONS_URL    => '',
];

$response = $client->setPublicKey("YOUR_PUBLIC_KEY")
    ->setPrivateKey("YOUR_PRIVATE_KEY")
    ->createPayment($parameters);

[
    "paymentId" => "8418c539-f271-4287-b252-d3e3ee12f455",
    "url"       => "https://checkout.bitbay.net/payment/8418c539-f271-4287-b252-d3e3ee12f455"
]
shell script
composer