ynievespuntonetsurl/qvapay-sdk-php

This PHP library facilitates the integration of the Qvapay API

v1.0.2 2022-10-29 22:52 UTC

This package is auto-updated.

Last update: 2024-10-29 05:54:13 UTC


README

Banner

Latest Version on Packagist MIT Licensed Tests Check & fix styling Total Downloads

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 ynievespuntonetsurl/qvapay-sdk-php

Usage

  • First, import the Client class and create your QvaPay client using your app credentials.
require_once __DIR__ . '/vendor/autoload.php';

use  YnievesPuntoNetSURL\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',
        'signed' => 1
    ]);
    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.