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
livestream-chat: Overlay para chats de livestreams

livestream-chat Overlay para chats de livestreams. Inicialmente para rodar dentro do browser do obs-studio. TODO: Issues iniciais Suporte a API do You

Eduardo Mendes 10 Dec 16, 2022
📷 Instagram Bot - Tool for automated Instagram interactions

InstaPy Tooling that automates your social media interactions to “farm” Likes, Comments, and Followers on Instagram Implemented in Python using the Se

Tim Großmann 13.5k Dec 01, 2021
Backlog API v2 Client Library for Python

BacklogPy - Backlog API v2 Client Library for Python BacklogPy is Backlog API v2 Client Library for Python 2/3 Install You can install the client libr

Koudai Aono 7 Dec 16, 2022
Fetching tweets and integrating it with Kafka and PySpark

KafkaPySpark Zookeeper bin/zookeeper-server-start.sh config/zookeeper.properties Kafka Server bin/kafka-server-start.sh config/server.properties Kafka

Priyansh 2 Dec 29, 2021
A modular Telegram Python bot running on python3 with a sqlalchemy database

Nao Tomori Robot Found Me On Telegram As Nao Tomori 🌼 A modular Telegram Python bot running on python3 with a sqlalchemy database. How to setup/deplo

Sena 84 Jan 04, 2023
The EscapePod Python SDK for Cyb3rVector's EscapePod Extension Proxy

EscapePod Extension SDK for Python by cyb3rdog This is the EscapePod Python SDK for Cyb3rVector's EscapePod Extension Proxy. With this SDK, you can: m

cyb3rdog 3 Mar 07, 2022
This repository contains modules that extend / modify parts of Odoo ERP

Odoo Custom Addons This repository contains addons that extend / modify parts of Odoo ERP. Addons list account_cancel_permission Only shows the button

Daniel Luque 3 Dec 28, 2022
Slack->DynamDB->Some applications

slack-event-subscriptions About The Project Do you want to get simple attendance checks? If you are using Slack, participants can just react on a spec

UpstageAI 26 May 28, 2022
A bot to view Garfield comics directly from Discord and get updates of the comics automatically

Garfield-Bot A bot to view Garfield comics directly from Discord and get updates of the comics automatically. Instructions to use the bot: Invite the

Raghav Sharma 3 Feb 13, 2022
Python client for the LightOn Muse API

lightonmuse Python bindings to production-ready intelligence primitives powered by state-of-the-art language models. Create. Process. Understand. Lear

LightOn 12 Apr 10, 2022
See trending stock tickers on Reddit and check Stock perfomance

See trending stock tickers on Reddit and check Stock perfomance

Abbas 1.5k Jan 06, 2023
Python wrapper to simplify calls to AncestryDNA API.

AncestryDNA API wrapper Ancestry exposes an undocumented REST API for its DNA features. This Python wrapper inventories the available calls, and expos

Matt 2 Jun 10, 2022
A smooth and powerful Telegram Userbot made to make Telegram easier.

| Xᴇɴᴏ Bᴏᴛ Is One Of The Fastest & Smoothest Bot On Telegram Based on Telethon|

SimpleBoy 1 Dec 01, 2021
❄️ 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
🤖 A discord bot for Dota2 community

BOTA BOT-A is a free Discord Dota 2 bot which provides comprehensive Information of every Dota 2 characters and exciting features for the community. P

Bendang 23 Jun 29, 2022
Yandex OSINT tool

YaSeeker Description YaSeeker - an OSINT tool to get info about any Yandex account using email or login. It can find: Fullname Photo Gender Yandex UID

HowToFind 110 Jan 03, 2023
Una herramienta para transmitir mensajes automáticamente a múltiples grupos de chat

chat-broadcast Una herramienta para transmitir mensajes automáticamente a múltiples grupos de chat Setup Librerías Necesitas Python 3 con la librería

Seguimos 2 Jan 09, 2022
A supabase client for python

supabase-client A Supabase client for Python. This mirrors the design of supabase-js Full documentation: https://keosariel.github.io/2021/08/08/supaba

kenneth gabriel 11 Dec 19, 2022
A Telegram Userbot to play Audio and Video songs / files in Telegram Voice Chats

TG-MusicPlayer A Telegram Userbot to play Audio and Video songs / files in Telegram Voice Chats. It's made with PyTgCalls and Pyrogram Requirements Py

4 Jul 30, 2022
Python wrapper for Gmailnator

Python wrapper for Gmailnator

h0nda 11 Mar 19, 2022