PHP code example of payger / php-sdk

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

    

payger / php-sdk example snippets


$args = array(
		'from'   => 'USD',
		'to'     => 'BTC',
		'amount' => 3.00
	);
$response = Payger::get( 'merchants/exchange-rates', $args );
`
$args = array (
		'externalId'        => '001',
		'description'       => 'Description',
        'paymentCurrency'	    => 'BTC',
        'productCurrency'    => 'USD',
        'source'            => 'Your Website',
		'outputAmount'	    => 3.0,
        'buyerName'	        => 'Buyer Name',
		'buyerEmailAddress'	=> 'Buyer Address',
		'callback'          => array( 'url' => 'Callback URL', 'method' => 'POST' ),
	);

$response = Payger::post( 'merchants/payments/', $args );
`