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

Overview

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 AsyncQvaPayClient (or SyncQvaPayClient) class and create your QvaPay asynchronous (or synchronous) client using your app credentials.

from qvapay.v1 import AsyncQvaPayClient

client = AsyncQvaPayClient(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 AsyncQvaPayClient.from_auth (or SyncQvaPayClient.from_auth) to initialize the client.

from qvapay.v1 import AsyncQvaPayClient, QvaPayAuth

client = AsyncQvaPayClient.from_auth(QvaPayAuth())

Use context manager

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

async with AsyncQvaPayClient(...) as client:
    # Do anything you want
    ...

or

with SyncQvaPayClient(...) as client:
    # Do anything you want
    ...

Get your app info

# Use await when using AsyncQvaPayClient
# With SyncQvaPayClient it is not necessary.
info = await client.get_info()

Get your account balance

# Use await when using AsyncQvaPayClient
# With SyncQvaPayClient it is not necessary.
balance = await client.get_balance()

Create an invoice

# Use await when using AsyncQvaPayClient
# With SyncQvaPayClient it is not necessary.
transaction = await client.create_invoice(
    amount=10,
    description='Ebook',
    remote_id='EE-BOOk-123' # example remote invoice id
)

Get transaction

# Use await when using AsyncQvaPayClient
# With SyncQvaPayClient it is not necessary.
transaction = await client.get_transaction(id)

Get transactions

# Use await when using AsyncQvaPayClient
# With SyncQvaPayClient it is not necessary.
transactions = await client.get_transactions(page=1)

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

For developers

The _sync folders were generated automatically executing the command unasync qvapay tests.

The code that is added in the _async folders is automatically transformed.

So every time to make a change you must run the command unasync qvapay tests to regenerate the folders _sync with the synchronous version of the implementation.

Improve tests implementation and add pre-commit system to ensure format and style.

Migration guide

0.2.0 -> 0.3.0

  • QvaPayClient was divided into two classes: AsyncQvaPayClient and SyncQvaPayClient. Both classes have the same methods and properties, with the difference that the methods in AsyncQvaPayClient are asynchronous and in SyncQvaPayClient are synchronous.

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

💻

Reinier Hernández

🐛

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

Comments
  • get_transaction está fallando

    get_transaction está fallando

    Describe the bug A la hora de obtener una transacción da error

    To Reproduce

    client = QvaPayClient(app_id=settings.QVAPAY_APP_ID, app_secret=settings.QVAPAY_APP_SECRET)
    transaction = client.get_transaction(transaction_id)
    

    Esto lanza un error en transaction_detail.py en la línea 28 a la hora de crear un PaidBy ya que este espera un username, logo y name pero está recibiendo estos parámetros:

    'paid_by': {
        'uuid': 'fasdfasdf',
        'username': 'ragnarok',
        'name': 'Reinier',
        'lastname': 'Hernández',
        'bio': 'I ♥ python',
        'logo': 'profiles/logo.webp',
        'kyc': 0
      },
    

    Adjunto traceback Captura de pantalla de 2021-10-29 23-47-39

    bug 
    opened by ragnarok22 17
  • feat: add context manager; updated README

    feat: add context manager; updated README

    I just added a context manager for better readability while changing the way they create client requests, this way you can improve performance when making multiple requests in a row. I also removed some repetitive parts of the README. Thanks

    enhancement 
    opened by jorgeajimenezl 7
  • Fix transaction model and other things

    Fix transaction model and other things

    Changes

    • change UUID by str in remote_id of transaction model
    • change url of banner in README.md
    • add commitizen dev dependency for generate CHANGELOG.md
    • bump version to 0.1.0 (to 0.1.0 and not to 0.0.4 because of existing breaking changes)
    bug documentation 
    opened by leynier 6
  • Add support for async functions and other things

    Add support for async functions and other things

    Changes

    • Add support for async
    • Tests with 100% of code coverage
    • Remove dataclasses-json dependency
    • Add convection files for communities like CODE_OF_CONDUCT.md and others
    • Add new banner and badges to README.md
    • Update the content of README.md with new methods
    • Remove setup.py and requirements.txt files because they are not necessary with poetry
    • GitHub Action for CI (check pythonic style and run tests)
    • GitHub Action for auto-publish in PyPi and GitHub Release when tag with v*.. be pushed
    • Add migration guide section to README.md

    Breaking changes

    • 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

    Tests:

    For the tests to pass correctly, it is necessary that they can access the app_id and the app_secret:

    • Remotely in the settings of GitHub repository two Action Secrets must be set: QVAPAY_APP_ID and QVAPAY_APP_SECRET
    • Locally you must have a file placed in the root of the project called .env with the following structure
    QVAPAY_APP_ID=...
    QVAPAY_APP_SECRET=...
    

    Publish

    To publish correctly in PyPi, two Action Secrets must be set in the settings of GitHub repository: PYPI_USERNAME and PYPI_PASSWORD

    Coverage

    For the Coverage report in the README and in the PR it is necessary to log in to codecov.io and activate the repository, in addition to installing the Codecov GitHub App

    Note

    In the migration guide in the README, when the new version is published, the version must be specified, right now it is set to 0.x.x

    documentation enhancement 
    opened by leynier 4
  • Proposal for version 0.2.0

    Proposal for version 0.2.0

    Breaking changes

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

    The reason is that the API stopped sending those properties.

    Features

    • Context manager for use async with and with syntax for improving performance in multiples requests. Thanks to @jorgeajimenezl #10
    • Testing with code coverage of 100%. Thanks to @leynier

    Resolve #9

    enhancement 
    opened by leynier 2
  • Improvements to actual library

    Improvements to actual library

    Description

    Improves actual library, with more pythonic and clean code, use of sync/async http library for compatibility, typings and data validation.

    Checklist

    • [x] Improved models attrs with actual values from API.
    • [x] using dataclasses refs PEP 557.
    • [x] using httpx instead of requests library.
    • [x] Improved absolute imports.
    • [x] Using dataclasses-json as serialization mechanism, each model has to_json() method.
    • [x] PEP8 improvements as code style for future PRs

    Previews

    Screenshot_20210830_151738-1

    Screenshot_20210830_152053

    TODO

    • [x] Test suite
    • [ ] Documentation
    • [ ] async support, thru attribute in Client instance, Example:
    client = Client(app_id, app_secret, version=1, async=True)
    
    • [ ] Better error handling
    • [ ] Environment vars support for app_id and app_secret
    enhancement 
    opened by codeshard 2
  • chore(deps): bump httpx from 0.20.0 to 0.23.0

    chore(deps): bump httpx from 0.20.0 to 0.23.0

    Bumps httpx from 0.20.0 to 0.23.0.

    Release notes

    Sourced from httpx's releases.

    Version 0.23.0

    0.23.0 (23rd May, 2022)

    Changed

    • Drop support for Python 3.6. (#2097)
    • Use utf-8 as the default character set, instead of falling back to charset-normalizer for auto-detection. To enable automatic character set detection, see the documentation. (#2165)

    Fixed

    • Fix URL.copy_with for some oddly formed URL cases. (#2185)
    • Digest authentication should use case-insensitive comparison for determining which algorithm is being used. (#2204)
    • Fix console markup escaping in command line client. (#1866)
    • When files are used in multipart upload, ensure we always seek to the start of the file. (#2065)
    • Ensure that iter_bytes never yields zero-length chunks. (#2068)
    • Preserve Authorization header for redirects that are to the same origin, but are an http-to-https upgrade. (#2074)
    • When responses have binary output, don't print the output to the console in the command line client. Use output like <16086 bytes of binary data> instead. (#2076)
    • Fix display of --proxies argument in the command line client help. (#2125)
    • Close responses when task cancellations occur during stream reading. (#2156)
    • Fix type error on accessing .request on HTTPError exceptions. (#2158)

    Version 0.22.0

    0.22.0 (26th January, 2022)

    Added

    Fixed

    • Don't perform unreliable close/warning on __del__ with unclosed clients. (#2026)
    • Fix Headers.update(...) to correctly handle repeated headers (#2038)

    Version 0.21.3

    0.21.3 (6th January, 2022)

    Fixed

    • Fix streaming uploads using SyncByteStream or AsyncByteStream. Regression in 0.21.2. (#2016)

    Version 0.21.2

    0.21.2 (5th January, 2022)

    Fixed

    • HTTP/2 support for tunnelled proxy cases. (#2009)
    • Improved the speed of large file uploads. (#1948)

    Version 0.21.1

    ... (truncated)

    Changelog

    Sourced from httpx's changelog.

    0.23.0 (23rd May, 2022)

    Changed

    • Drop support for Python 3.6. (#2097)
    • Use utf-8 as the default character set, instead of falling back to charset-normalizer for auto-detection. To enable automatic character set detection, see the documentation. (#2165)

    Fixed

    • Fix URL.copy_with for some oddly formed URL cases. (#2185)
    • Digest authentication should use case-insensitive comparison for determining which algorithm is being used. (#2204)
    • Fix console markup escaping in command line client. (#1866)
    • When files are used in multipart upload, ensure we always seek to the start of the file. (#2065)
    • Ensure that iter_bytes never yields zero-length chunks. (#2068)
    • Preserve Authorization header for redirects that are to the same origin, but are an http-to-https upgrade. (#2074)
    • When responses have binary output, don't print the output to the console in the command line client. Use output like <16086 bytes of binary data> instead. (#2076)
    • Fix display of --proxies argument in the command line client help. (#2125)
    • Close responses when task cancellations occur during stream reading. (#2156)
    • Fix type error on accessing .request on HTTPError exceptions. (#2158)

    0.22.0 (26th January, 2022)

    Added

    Fixed

    • Don't perform unreliable close/warning on __del__ with unclosed clients. (#2026)
    • Fix Headers.update(...) to correctly handle repeated headers (#2038)

    0.21.3 (6th January, 2022)

    Fixed

    • Fix streaming uploads using SyncByteStream or AsyncByteStream. Regression in 0.21.2. (#2016)

    0.21.2 (5th January, 2022)

    Fixed

    • HTTP/2 support for tunnelled proxy cases. (#2009)
    • Improved the speed of large file uploads. (#1948)

    0.21.1 (16th November, 2021)

    Fixed

    • The response.url property is now correctly annotated as URL, instead of Optional[URL]. (#1940)

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) You can disable automated security fix PRs for this repo from the Security Alerts page.
    dependencies 
    opened by dependabot[bot] 1
  • feat: split implementation in two classes

    feat: split implementation in two classes

    [BREAKING CHANGES] QvaPayClient was divided into two classes: AsyncQvaPayClient and SyncQvaPayClient. Both classes have the same methods and properties, with the difference that the methods in AsyncQvaPayClient are asynchronous and in SyncQvaPayClient are synchronous.

    The _sync folders were generated automatically executing the command unasync qvapay tests.

    The code that is added in the _async folders is automatically transformed.

    So every time to make a change you must run the command unasync qvapay tests to regenerate the folders _sync with the synchronous version of the implementation.

    Improve tests implementation and add pre-commit system to ensure format and style.

    enhancement 
    opened by leynier 1
  • Async operations

    Async operations

    As mentioned in #1, we need to add support for async operations.

    client = Client(app_id, app_secret, version=1, async=True)
    

    aioqvapay based on this lib, is already doing this, we should join efforts.

    https://github.com/leynier/aioqvapay

    enhancement 
    opened by CarlosLugones 0
  • chore(deps): bump certifi from 2021.10.8 to 2022.12.7

    chore(deps): bump certifi from 2021.10.8 to 2022.12.7

    Bumps certifi from 2021.10.8 to 2022.12.7.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) You can disable automated security fix PRs for this repo from the Security Alerts page.
    dependencies 
    opened by dependabot[bot] 0
Releases(v0.3.0)
  • v0.3.0(Nov 1, 2021)

    Breaking changes

    QvaPayClient was divided into two classes: AsyncQvaPayClient and SyncQvaPayClient. Both classes have the same methods and properties, with the difference that the methods in AsyncQvaPayClient are asynchronous and in SyncQvaPayClient are synchronous.

    The _sync folders were generated automatically executing the command unasync qvapay tests.

    The code that is added in the _async folders is automatically transformed.

    So every time to make a change you must run the command unasync qvapay tests to regenerate the folders _sync with the synchronous version of the implementation.

    Improve tests implementation and add pre-commit system to ensure format and style.

    Thanks to @leynier for #12 and #14. Also thanks to @ragnarok22 for reporting bug #13.

    Released to PyPi

    https://pypi.org/project/qvapay/

    Source code(tar.gz)
    Source code(zip)
    qvapay-0.3.0-py3-none-any.whl(13.63 KB)
    qvapay-0.3.0.tar.gz(10.96 KB)
  • v0.2.0(Sep 17, 2021)

    Breaking changes, including fixes and new features.

    Breaking changes

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

    The reason is that the API stopped sending those properties. Thanks to @leynier.

    Features

    • Context manager for use async with and with syntax for improving performance in multiples requests. Thanks to @jorgeajimenezl #10.
    • Testing with code coverage of 100%. Thanks to @leynier.

    Released to PyPi

    https://pypi.org/project/qvapay/

    Source code(tar.gz)
    Source code(zip)
    qvapay-0.2.0-py3-none-any.whl(11.26 KB)
    qvapay-0.2.0.tar.gz(9.99 KB)
  • v0.1.0(Sep 5, 2021)

    Breaking changes, tests, coverage, GitHub actions, support for async and more in #7 #8, thanks to @leynier for the huge contributions.

    Also, thanks to @codeshard for engaging in the project discussion.

    Changes

    • Add support for async
    • Tests with 100% of code coverage
    • Remove dataclasses-json dependency
    • Add convection files for communities like CODE_OF_CONDUCT.md and others
    • Add new banner and badges to README.md
    • Update the content of README.md with new methods
    • Remove setup.py and requirements.txt files because they are not necessary with poetry
    • GitHub Action for CI (check pythonic style and run tests)
    • GitHub Action for auto-publish in PyPi and GitHub Release when tag with v*.. be pushed
    • Add migration guide section to README.md
    • Change UUID by str in remote_id of transaction model
    • Change url of banner in README.md
    • Add commitizen dev dependency for generate CHANGELOG.md
    • Bump version to 0.1.0 (to 0.1.0 and not to 0.0.4 because of existing breaking changes)

    Breaking changes

    • 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

    Tests:

    For the tests to pass correctly, it is necessary that they can access the app_id and the app_secret:

    • Locally, you must have a file placed in the root of the project called .env with the following structure
    QVAPAY_APP_ID=...
    QVAPAY_APP_SECRET=...
    

    Released to PyPi: https://pypi.org/project/qvapay/

    Source code(tar.gz)
    Source code(zip)
    qvapay-0.1.0-py3-none-any.whl(10.97 KB)
    qvapay-0.1.0.tar.gz(9.48 KB)
  • v0.0.3(Aug 30, 2021)

    • Improvements by @codeshard via #1: added dataclasses, replaced requests with httpx, absolute imports, using dataclases-json and coding style also improved.
    • Added contributors using all-contributors.org spec.
    • Added funding.

    Released to PyPi: https://pypi.org/project/qvapay/

    image

    Source code(tar.gz)
    Source code(zip)
Owner
Carlos Lugones
Startups maker. Podcaster, writer and criptoenthusiast. Teaching what I learn in my path, while boosting others' growth.
Carlos Lugones
Running Performance Calculator

Running Performance Calculator 👉 Have you ever wondered if you ran 10km at 2000

Davide Liu 6 Oct 26, 2022
Market calendar RESTful API with holiday, late open, and early close. Over 50+ unique exchange calendars for global equity and futures markets.

Trading Calendar Market calendar RESTful API with holiday, late open, and early close. Over 50+ unique exchange calendars for global equity and future

Apptastic Software 1 Feb 03, 2022
Python Telegram Bot Template

Python Telegram Bot Template Concepts Customizable python-telegram-bot template implementing code refactoring to streamline development process: handl

Jansen A. Simanullang 1 Jan 25, 2022
A taskbar clock for secondary taskbars on Windows 11

ElevenClock A taskbar clock for secondary taskbars on Windows 11. When microsoft's engineers were creating Windows 11, they forgot to add a clock on t

Martí Climent 1.7k Jan 07, 2023
Este programa tem como objetivo o cadastro dos usuários. Assim, caso a autenticação seja feita, permitir que o usuário entre em determinado sistema ou programa.

LoginPy Este programa tem como objetivo o cadastro dos usuários. Assim, caso a autenticação seja feita, permitir que o usuário entre em determinado si

Jonas Carvalho 4 Dec 23, 2021
The implementation of Learning Instance and Task-Aware Dynamic Kernels for Few Shot Learning

INSTA: Learning Instance and Task-Aware Dynamic Kernels for Few Shot Learning This repository provides the implementation and demo of Learning Instanc

11 Jan 02, 2023
Access Undenied parses AWS AccessDenied CloudTrail events, explains the reasons for them, and offers actionable remediation steps. Open-sourced by Ermetic.

Access Undenied on AWS Access Undenied parses AWS AccessDenied CloudTrail events, explains the reasons for them, and offers actionable fixes. Access U

Ermetic 204 Jan 02, 2023
Simple Discord bot for the Collectez community.

Harvey - Discord Bot Simple Discord bot for the Collectez community. Features Ping the current status of Collectez's Teztools node. Steal emojis from

delintkhaum 1 Dec 26, 2021
Tamil Voicechat UserBot. Powerd By TamilBots. Https://T.me/TamilSupport

Tamil Voicechat UserBot A Telegram UserBot to Play music 🎶 in Voice Chats. It's recommended to use an USA number.(if your real number is suspended I'

Tamil Bots 78 Nov 01, 2022
Asynchronous Guilded API wrapper for Python

Welcome to guilded.py, a discord.py-esque asynchronous Python wrapper for the Guilded API. If you know discord.py, you know guilded.py. Documentation

shay 115 Dec 30, 2022
Hydro Quebec API wrapper.

HydroQC Hydro Quebec API wrapper. This is a package to access some functionalities of Hydro Quebec API that are not documented. Documentation https://

Olivier BEAU 9 Dec 02, 2022
A decentralized messaging daemon built on top of the Kademlia routing protocol.

parakeet-message A decentralized messaging daemon built on top of the Kademlia routing protocol. Now that you are done laughing... pictures what is it

Jonathan Abbott 3 Apr 23, 2022
A simple telegram bot to forward files from one channel to other.

Forward_2.0 Bot to forward messages from one channel to other without admin permission in source channel. Can be used for both private and Public chan

SUBIN 56 Dec 29, 2022
Activate exitlag trial accounts

Exitlag Account Activator Activate exitlag trial accounts (unlimited trial accounts) ⭐ If you want to support me, follow me on github and star the pro

Benjamin 173 Nov 10, 2022
471 Dec 24, 2022
A Flask inspired, decorator based API wrapper for Python-Slack.

A Flask inspired, decorator based API wrapper for Python-Slack. About Tangerine is a lightweight Slackbot framework that abstracts away all the boiler

Nick Ficano 149 Jun 30, 2022
This is a crypto trading bot that scans the Binance Annoucements page for new coins, and places trades on Gateio

gateio-trading-bot-binance-announcements This Gateio x Binance cryptocurrency trading bot scans the Binance Announcements page and picks up on new coi

Andrei 1.2k Jan 01, 2023
Pycardano - A lightweight Cardano client in Python

PyCardano PyCardano is a standalone Cardano client written in Python. The librar

151 Dec 31, 2022
Estimate the total emissions for popular CryptoArt platforms.

cryptoart-footprint Estimate the total CO2 footprint for popular CryptoArt platforms. The goal is to accurately quantify the ecological damage of Ethe

Kyle McDonald 182 Oct 12, 2022
streamlit translator is used to detect and translate between languages created using gTTS, googletrans, pillow and streamlit python packages

Streamlit Translator Streamlit Translator is a simple translator app to detect and translate between languages. Streamlit Translator gets text and lan

Siva Prakash 5 Apr 05, 2022