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
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
Repositório para meu Discord Bot pessoal

BassetinhoBot Escrevi o código usando o Python 3.8.3 e até agora não tive problemas rodando nas versões mais recentes. Repositório para o Discord Bot

Vinícius Bassete 1 Jan 04, 2022
Bypass Hcaptcha Purely based on http requests, Creates unlocked discord accounts if used correctly

hcaptcha-bypass-discord Bypass HCAPTCHA purely based on http requests Works for discord dosen't create locked accounts :)) HOW TO USE ◉ add the hcapby

Avenger 80 Dec 22, 2022
A Recommendation System For Diabetes Detection And Treatment

Diabetes-detection-tg-bot A Recommendation System For Diabetes Detection And Treatment Данная система помогает определить наличие или отсутствие сахар

Alexander Kanonirov 1 Nov 22, 2021
Make a command interpreter that manages AirBnb objects

AirBnB Clone Project Description This is part 1 of our AirBnb Clone project. The purpose of this project is to make a command interpreter that manages

Firdaus H. Salim 1 Nov 14, 2021
Telegram Bot to store Posts and Documents and it can Access by Special Links.

Telegram Bot to store Posts and Documents and it can Access by Special Links. I Guess This Will Be Usefull For Many People..... 😇 . Features Fully cu

REX BOTZ 1 Dec 23, 2021
VC-Music , Playing music without bot.

VC-Userbot A Telegram Userbot to play or streaming Audio and Video songs / files in Telegram Voice Chats. It's made with PyTgCalls and Pyrogram Requir

RioProjectX 8 Aug 04, 2022
Pancakeswap Sniper BOT - TORNADO CASH Proxy (MAC WINDOWS ANDROID LINUX) A fully decentralized protocol for private transactions

TORNADO CASH Proxy Pancakeswap Sniper BOT 2022-V1 (MAC WINDOWS ANDROID LINUX) ⭐️ A fully decentralized protocol for private transactions ⭐️ AUTO DOWNL

Crypto Trader 1 Jan 05, 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
Disco is an extensive and extendable Python 2.x/3.x library for the Discord API.

disco Disco is an extensive and extendable Python 2.x/3.x library for the Discord API. Disco boasts the following major features: Expressive, function

1 Nov 18, 2021
python script to buy token from pancakeswap

pancakeswapBot python script to buy token from pancakeswap Change your privatekey!!! on line 58 (signed_txn = web3.eth.account.sign_transaction(pancak

206 Dec 31, 2022
thumbor is an open-source photo thumbnail service by globo.com

Survey If you use thumbor, please take 1 minute and answer this survey? It's only 2 questions and one is multiple choice!!! thumbor is a smart imaging

Thumbor (by @globocom) 9.3k Dec 31, 2022
❄️ Don't waste your money paying for new tokens, once you have used your tokens, clean them up and resell them!

TokenCleaner Don't waste your money paying for new tokens, once you have used your tokens, clean them up and resell them! If you have a very large qua

0xVichy 59 Nov 14, 2022
It's a discord.py simulator.

DiscordPySimulator It's a discord.py simulator. ⚠️ Things to fix Context As you may know, discord py commands provide the context as the first paramet

Juan Sebastián 11 Oct 24, 2022
Reddit bot that uses sentiment analysis

Reddit Bot Project 2: Neural Network Boogaloo Reddit bot that uses sentiment analysis from NLTK.VADER WIP_WIP_WIP_WIP_WIP_WIP Link to test subreddit:

TpK 1 Oct 24, 2021
聚合空间测绘搜索(Fofa,Zoomeye,Quake,Shodan,Censys,BinaryEdge)

#Search-Tools Search-Tools集合比较常见的网络空间探测引擎 Fofa,Zoomeye,Quake,Shodan,Censys,BinaryEdge 简单说明 ICO搜索目前只有Fofa,Shodan,Quake支持 代理设置是防止在API请求过于频繁,或者在实战中,好多红队打

311 Dec 16, 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
WILSON Cloud Respwnder is a Web Interaction Logger Sending Out Notifications with the ability to serve custom content in order to appropriately respond to client-issued requests.

WILSON Cloud Respwnder What is this? WILSON Cloud Respwnder is a Web Interaction Logger Sending Out Notifications (WILSON) with the ability to serve c

48 Oct 31, 2022
Repo-cloner - Script takes user public liked repos and clone it to a local folder

Liked repos cloner Script takes user public liked repos and clone it to a local

Aleksei 2 Jun 18, 2022
A basic API to scrape Craigslist.

CLAPI A basic API to scrape Craigslist. Most useful for viewing posts across a broad geographic area or for viewing posts within a specific timeframe.

45 Jan 05, 2023