PHP code example of rocketr / rocketr-payments-php

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

    

rocketr / rocketr-payments-php example snippets






\RocketrPayments\RocketrPayments::setApiKey('API_CLIENT_ID', 'API_SECRET'); //From https://rocketr.net/merchants/api-keys
$o = new \RocketrPayments\Order();

$o->setPaymentMethod(\RocketrPayments\PaymentMethods::BitcoinPayment);
$o->setAmount(12.31);
$o->setBuyerEmail('[email protected]');
$o->addCustomField('internal_id', '2195342212');
$o->setIpnUrl('https://rocketr.net/webhook.php');

$result = $o->createOrder();

echo 'Please send ' . $result['paymentInstructions']['amount']  . $result['paymentInstructions']['currencyText'] . ' to ' . $result['paymentInstructions']['address'];
shell
composer