PHP code example of ynievespuntonetsurl / qvapay-sdk-php

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

    

ynievespuntonetsurl / qvapay-sdk-php example snippets




use  YnievesPuntoNetSURL\QvaPay\Client;
try {
    $qvapay = new Client([
        'app_id' => 'XXX', 
        'app_secret' => 'XXX',
        'version' => '1'
    ]);
} catch (\Exception $e) {
    echo $e->getMessage();
}

try {
    print_r($qvapay->info());
} catch (\Exception $e) {
    echo $e->getMessage();
}

try {
    $invoice = $qvapay->create_invoice([
        'amount' => 10,
        'description' => 'Ebook',
        'remote_id' => 'EE-BOOk-123',
        'signed' => 1
    ]);
    print_r($invoice);
} catch (\Exception $e) {
    echo $e->getMessage();
}

try {
    print_r($qvapay->transactions());
} catch (\Exception $e) {
    echo $e->getMessage();
}

try {
    print_r($qvapay->get_transaction($uuid));
} catch (\Exception $e) {
    echo $e->getMessage();
}

try {
    echo $qvapay->balance();
} catch (\Exception $e) {
    echo $e->getMessage();
}
bash
composer