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
Python package and CLI for user-friendly integration with SAS Viya

sasctl A user-friendly Python interface for SAS Viya. Full documentation: https://sassoftware.github.io/python-sasctl Table of Contents Overview Prere

SAS Software 30 Dec 14, 2022
Modern, privacy-friendly, and detailed web analytics that works without cookies or JS.

Modern, privacy-friendly, and cookie-free web analytics. Getting started » Screenshots • Features • Office Hours Motivation There are a lot of web ana

R. Miles McCain 2.1k Jan 3, 2023
A hyper-user friendly bot framework built on hikari

Framework A hyper-user friendly bot framework built on hikari. Framework is based off the blocking discord library disco, In both modularity and struc

Vincent 1 Jan 10, 2022
Cookies is a project inspired by python cookiecutter but used for terraform generation.

Introduction Cookies is a project inspired by python cookiecutter but used for terraform generation. How to run your terraform After you download your

Digger 6 Mar 14, 2022
Based on falcondai and fenhl's Python snowflake tool, but with documentation and simliarities to Discord.

python-snowflake-2 Based on falcondai and fenhl's Python snowflake tool, but with documentation and simliarities to Discord. Docs make_snowflake This

null 2 Mar 19, 2022
OpenSea Bulk Uploader And Trader 100000 NFTs (MAC WINDOWS ANDROID LINUX) Automatically and massively upload and sell your non-fungible tokens on OpenSea using Python Selenium

OpenSea Bulk Uploader And Trader 100000 NFTs (MAC WINDOWS ANDROID LINUX) Automatically and massively upload and sell your non-fungible tokens on OpenS

ERC-7211 3 Mar 24, 2022
A simple but useful Discord Selfbot with essential features, made with discord.py-self.

Discord Selfbot Xyno Discord Selfbot Xyno is a simple but useful selfbot for Discord. It has currently limited useful features but it will be updated

Amit Pathak 7 Apr 24, 2022
Simple bot to receive feedback,same as livegram bot but with more features & full control over bot

Kontak Simple bot to receive feedback,same as livegram bot but with more features & full control over bot Deploy to VPS

Mahin Ahmed 2 Dec 16, 2021
A bot can play all variants, but standard are abit weak, so if you need strongest you can change fsf instead of stockfish_14_Dev

MAINTAINERS Drdisrespect1 and drrespectable lichess-bot Engine communication code taken from https://github.com/ShailChoksi/lichess-bot by ShailChoksi

RPNS Nimsilu 1 Dec 12, 2021
An Auto-Grinding bot made for Pokemeow. Efficient but not many features yet

PokeGrinder ?? This is an Auto-Grinding bot made for Pokemeow. Efficient but not many features yet. Supported features This bot can currently handle :

Xombie 9 Feb 1, 2022
Neofetch/pfetch, but for weather

Wfetch Neofetch/pfetch, but for weather Features Information about the weather outside: Weather condition Temperature Humidity Pressure Wind Sunrise-s

G_cat 72 Nov 18, 2022
A Discord Token Grabber/Stealer But It's in One Line of Coding

Discord-Token-Grabber-But-In-One-Line That's a Discord Token Grabber/Stealer But It's in One Line of Coding! The Name Says All <3

YoSoyAngi 2 Jan 11, 2022
The worst but simplest webhook bot for GitHub and Matrix.

gh-bot gh-bot is maybe the worst (but simplest) Matrix webhook bot for Github. Example of commits: Example of workflow finished: Setting up Server You

Jae Lo Presti 4 Aug 18, 2022
A script to find the people whom you follow, but they don't follow you back

insta-non-followers A script to find the people whom you follow, but they don't follow you back Dependencies: python3 libraries - instaloader, getpass

Ritvik 5 Jul 3, 2022
Wordy is a Wordle-like Discord bot but with a twist.

Wordy Discord Bot Wordy is a Wordle-like Discord bot but with a twist. It already supports 6 languages from the beginning: English, Italian, French, G

The Coding Channel 2 Sep 6, 2022
Transcript-Extractor-Bot - Yet another Telegram Voice Recognition bot but using vosk and supports 20+ languages

transcript extractor Yet another Telegram Voice Recognition bot but using vosk a

null 6 Oct 21, 2022
Official Python client for the MonkeyLearn API. Build and consume machine learning models for language processing from your Python apps.

MonkeyLearn API for Python Official Python client for the MonkeyLearn API. Build and run machine learning models for language processing from your Pyt

MonkeyLearn 157 Nov 22, 2022
Public API client for GETTR, a "non-bias [sic] social network," designed for data archival and analysis.

GoGettr GoGettr is an API client for GETTR, a "non-bias [sic] social network." (We will not reward their domain with a hyperlink.) GoGettr is built an

Stanford Internet Observatory 72 Dec 14, 2022
Telegram Google Translater Bot Can Translate Any Language To Your Selected Language

?? TELEGRAM GOOGLE TRANSLATER ?? • ⚡ INSTALLING ⚡ • • ✅ OFFICIAL SUPPORTS ✅ •

⚝ANKIT KUMAR⚝ 2 Jan 16, 2022