Python SDK for the QvaPay API
Project description
Python SDK for the QvaPay API
Non official, but friendly QvaPay library for the Python language.
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())
Get your app info
info = client.get_info()
Or
info = await client.get_info_async()
Get your account balance
balance = client.get_balance()
Or
balance = await client.get_balance_async()
Create an invoice
transaction = client.create_invoice(
amount=10,
description='Ebook',
remote_id='EE-BOOk-123' # example remote invoice id
)
Or
transaction = await client.create_invoice_async(
amount=10,
description='Ebook',
remote_id='EE-BOOk-123' # example remote invoice id
)
Get transaction
transaction = client.get_transaction(id)
Or
transaction = await client.get_transaction_async(id)
Get transactions
transactions = client.get_transactions(page=1)
Or
transactions = await client.get_transactions_async(page=1)
You can also read the QvaPay API documentation: qvapay.com/docs.
Migration guide
0.0.3 -> 0.1.0
from qvapay.v1 import *
instead offrom qvapay import *
QvaPayClient
instead ofClient
client.get_info
instead ofclient.info
client.get_balance
instead ofclient.balance
client.get_transactions
instead ofclient.transactions
Contributors ✨
Thanks goes to these wonderful people (emoji key):
Carlos Lugones 💻 |
Ozkar L. Garcell 💻 |
Leynier Gutiérrez González 💻 |
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.