PHP code example of 9pay / wallet

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

    

9pay / wallet example snippets


    $path = '/app/config';

return array(
    'url'     => 'https://example.com',
    'api_key' => 'api_key',
    'version' => '2.1'
);

return array(
    'url'     => 'https://example.com',
    'api_key' => 'api_key',
    'version' => '2.1'
);

$config = array(
    'url'     => 'https://example.com',
    'api_key' => 'api_key',
    'version' => '2.1'
);

use Ninepay\Api\Wallet;

$config = array(
    'url'     => 'https://example.com',
    'api_key' => 'api_key',
    'version' => '2.1'
);

$wallet = new Wallet($config);

$attr = array(
    'payment_no'  => '123456',
    'amount'      => '10000',
    'description' => 'This is test order',
    'return_url'  => 'https://example.com'
);

$res = $wallet->create($attr);

  $wallet = new Wallet($path, 'sand');