Php library for Qvapay API
This PHP library facilitates the integration of the Qvapay API.
Sign up on QvaPay
Create your account to process payments through QvaPay at https://qvapay.com/register.
Requirements
- PHP version >= 7.3
- Composer
Installation
You can install the package via composer:
composer require ovillafuerte94/qvapay-php-library
Usage
- First, import the Client class and create your QvaPay client using your app credentials.
require_once __DIR__ . '/vendor/autoload.php';
use Qvapay\Client;
try {
$qvapay = new Client([
'app_id' => 'XXX',
'app_secret' => 'XXX',
'version' => '1'
]);
} catch (\Exception $e) {
echo $e->getMessage();
}
- Get your app info
try {
print_r($qvapay->info());
} catch (\Exception $e) {
echo $e->getMessage();
}
- Create an invoice
try {
$invoice = $qvapay->create_invoice([
'amount' => 10,
'description' => 'Ebook',
'remote_id' => 'EE-BOOk-123' # example remote invoice id
]);
print_r($invoice);
} catch (\Exception $e) {
echo $e->getMessage();
}
- Get transactions
try {
print_r($qvapay->transactions());
} catch (\Exception $e) {
echo $e->getMessage();
}
- Get transaction
try {
print_r($qvapay->get_transaction($uuid));
} catch (\Exception $e) {
echo $e->getMessage();
}
- Get your account balance
try {
echo $qvapay->balance();
} catch (\Exception $e) {
echo $e->getMessage();
}
You can also read the QvaPay API documentation: https://qvapay.com/docs.
Testing
composer test
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.