Skip to main content

Python SDK for the QvaPay API

Project description

Python SDK for the QvaPay API

Banner

Non official, but friendly QvaPay library for the Python language.

License: MIT Test codecov Version Last commit GitHub commit activity Github Stars Github Forks Github Watchers GitHub contributors All Contributors

Setup

You can install this package by using the pip tool and installing:

pip install qvapay

Or

easy_install qvapay

Sign up on QvaPay

Create your account to process payments through QvaPay at qvapay.com/register.

Using the client

First, import the QvaPayClient class and create your QvaPay client using your app credentials.

from qvapay.v1 import QvaPayClient

client = QvaPayClient(app_id, app_secret)

It is also possible to use the QvaPayAuth class (which by default obtains its properties from environment variables or from the content of the .env file) and the static method QvaPayClient.from_auth to initialize the client.

from qvapay.v1 import QvaPayAuth, QvaPayClient

client = QvaPayClient.from_auth(QvaPayAuth())

Use context manager

The recommended way to use a client is as a context manager. For example:

[async] with QvaPayClient(...) as client:
    # Do anything you want
    ...

Get your app info

info = client.get_info()

Get your account balance

balance = client.get_balance()

Create an invoice

transaction = client.create_invoice(
    amount=10,
    description='Ebook',
    remote_id='EE-BOOk-123' # example remote invoice id
)

Get transaction

transaction = client.get_transaction(id)

Get transactions

transactions = client.get_transactions(page=1)

Async features

You can also use the asynchronous version of the methods simply by appending _async to the method name at the end. For example:

info = await client.get_info_async()

You can also read the QvaPay API documentation: qvapay.com/docs.

Migration guide

0.1.0 -> 0.2.0

  • user_id of Transaction model was removed
  • paid_by_user_id of Transaction model was removed

0.0.3 -> 0.1.0

  • from qvapay.v1 import * instead of from qvapay import *
  • QvaPayClient instead of Client
  • client.get_info instead of client.info
  • client.get_balance instead of client.balance
  • client.get_transactions instead of client.transactions

Contributors ✨

Thanks goes to these wonderful people (emoji key):


Carlos Lugones

💻

Ozkar L. Garcell

💻

Leynier Gutiérrez González

💻

Jorge Alejandro Jimenez Luna

💻

This project follows the all-contributors specification. Contributions of any kind welcome!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qvapay-0.2.0.tar.gz (10.3 kB view hashes)

Uploaded Source

Built Distribution

qvapay-0.2.0-py3-none-any.whl (11.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page