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
A Discord.py bot which can adjust a voice channel's bitrate depending on the number of users connected.

discord_bitrate_bot A Discord.py bot which can adjust a voice channel's bitrate depending on the number of users connected. Programmed to be run on a

1 Feb 10, 2022
My personal discord bot using discord.py

Rara-chan My personal discord bot that I use for stuff that I find interesting. Features Responds to certain messages ChatBot capabilities NHentai scr

Mikask 3 Nov 06, 2022
Automatically detect changes made to the official Telegram sites.

🕷 Telegram Web Crawler This project is developed to automatically detect changes made to the official Telegram sites. This is necessary for anticipat

Il'ya 115 Dec 31, 2022
A Simple Advance Auto Filter Bot Complete Rewritten Version Of Adv-Filter-Bot

Adv Auto Filter Bot This Is Just An Simple Advance Auto Filter Bot Complete Rewritten Version Of Adv-Filter-Bot.. Just Sent Any Text As Query It Will

TeamShadow 4 Dec 10, 2021
Webservice that notifies users on Slack when a change in GitLab concern them.

Gitlab Slack Notifier Webservice that notifies users on Slack when a change in GitLab concern them. Setup Slack Create a Slack app, go to "OAuth & Per

Heuritech 2 Nov 04, 2021
A maintained fork of Danny's discord.py

Nextcord A modern, easy-to-use, feature-rich, and async-ready API wrapper for Discord written in Python. Fork notice This is a fork of discord.py, whi

977 Jan 05, 2023
=>|<= the MsgRoom bot for Windows 96

=|= bot A MsgRoom bot in Python 3 for Windows96.net. The bot joins as =|=, if parameter name_lasts is not true and default_name is =|=. The full

Larry Holst 2 Jun 07, 2022
Watches your earnings on EarnApp and notifies you when you earned balance or received an payout.

EarnApp-Earning-Monitor Watches your earnings on EarnApp and notifies you when you earned balance or received an payout. Installation Install Python3

Yariya 21 Oct 17, 2022
toldium is a modular, fast, reliable and customizable multiplatform bot library for your communities

toldium The easy multiplatform bot toldium is a modular, fast, reliable and customizable multiplatform bot library for your communities, from a commun

Stockdroid Fans 5 Nov 03, 2021
An Amazon Product Scraper built using scapy module of python

Amazon Product Scraper This is an Amazon Product Scraper built using scapy module of python Features it scrape various things Product Title Product Im

Sudhanshu Jha 1 Dec 13, 2021
McTrade is a bot exploiting Binance API, open source! built in python !

Open Source Crypto Trading Bot using Binance API Report Bug · Request Feature Table of Contents About The Project Built With Getting Started Prerequis

Raphael Cohen 5 Jul 17, 2022
RDMAss - A Python Discord bot creating an interaction with RDM API

RDMAss A Python Discord bot creating an interaction with RDM API. Features Assig

5 Sep 21, 2022
Save data from Instagram takeout to a SQLite database

instagram-to-sqlite Save data from a Instagram takeout to a SQLite database. Mise En Place git clone https://github.com/gavindsouza/instagram-to-sqlit

gavin 8 Dec 13, 2022
This is a telegram bot built using the Oxford Dictionary API

Oxford Dictionaries Telegram Bot This is a telegram bot built using the Oxford Dictionary API Source: Oxford Dictionaries API Documentation Install En

Abhijith N T 2 Mar 18, 2022
Migration Manager (MM) is a very small utility that can list source servers in a target account and apply mass launch template modifications.

Migration Manager Migration Manager (MM) is a very small utility that can list source servers in a target account and apply mass launch template modif

Cody 2 Nov 04, 2021
Personal Discord Python Bot based on Discord.py

Personal Discord bot using the discord.py library by Rapptz

2 Dec 14, 2022
Optimus Prime - A modular Telegram group management and drive clone bot running on Python with sqlalchemy database

Optimus Prime Bot . 🤖 A modular Telegram group management and drive clone bot r

9 Jun 01, 2022
LimitatiBot - A simple telegram bot to establish a conversation with a user without having to use private chats

🤖 LimitatiBot [0.2] LimitatiBot is a simple telegram bot to establish a convers

xMrPente 9 Dec 27, 2022
Attempting to create a framework for Discord Slash commands... yes

discord_slash.py Attempting to create a framework for Discord Slash commands... yes Installation pip install slashpy Documentation Coming soon™ Why is

AlexFlipnote 11 Mar 24, 2021
EthSema - Binary translator for Ethereum 2.0

EthSema is a novel EVM-to-eWASM bytecode translator that can not only ensure the fidelity of translation but also fix commonly-seen vulnerabilities in smart contracts.

weimin 8 Mar 01, 2022