Skip to main content

Payment providers API wrapper

Project description


PyPayment
PyPayment

Payment providers API wrapper

PyPI Python 3 Tests DeepSource

DocumentationProvidersInstallationQuickstartContributingLicense

PyPayment is a Python wrapper for API of different payment providers. It is designed to be a simple and easy to use library for developers to integrate payment into their applications.

Main idea is to provide a unified interface for different payment providers.

For more details see documentation.

Providers:

Installation

Install the current version with PyPI

pip install -U pypayment

Quickstart

Choose payment provider and authorize. For example, for Qiwi

from pypayment import QiwiPayment

QiwiPayment.authorize("my_secret_key")

Create a payment and get it's url

from pypayment import Payment, QiwiPayment

payment: Payment = QiwiPayment(amount=100) # E.x. commission is 10%

print(payment.url)  # https://oplata.qiwi.com/form/?invoice_uid=payment_unique_id

Wait for payment to be completed and get it's income

Use update() method to update payment's status and income

from pypayment import PaymentStatus

while payment.status != PaymentStatus.PAID:
    input("Press Enter to update payment status and income")
    payment.update()

print("Payment is completed!")
print(payment.income)  # 90.0

Summary

from pypayment import Payment, QiwiPayment, PaymentStatus

QiwiPayment.authorize("my_secret_key")

payment: Payment = QiwiPayment(amount=100) # E.x. commission is 10%
print(payment.url)  # https://oplata.qiwi.com/form/?invoice_uid=payment_unique_id

while payment.status != PaymentStatus.PAID:
    input("Press Enter to update payment status")
    payment.update()

print("Payment is completed!")
print(payment.income)  # 90.0

Contributing

Bug reports and/or pull requests are welcome

License

The module is available as open source under the terms of the Apache License, Version 2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pypayment-1.6.0.tar.gz (12.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pypayment-1.6.0-py3-none-any.whl (17.1 kB view details)

Uploaded Python 3

File details

Details for the file pypayment-1.6.0.tar.gz.

File metadata

  • Download URL: pypayment-1.6.0.tar.gz
  • Upload date:
  • Size: 12.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.17

File hashes

Hashes for pypayment-1.6.0.tar.gz
Algorithm Hash digest
SHA256 76718297383ece4507b97b13cc2cf940d4def2c82c7a60e5455b165f9fa0e124
MD5 f646164ddf442f3afc3da29caec72e0a
BLAKE2b-256 1db1c896067cde86595eb5ade851c5594fc3381f5302a357a56e13e04a1b9d74

See more details on using hashes here.

File details

Details for the file pypayment-1.6.0-py3-none-any.whl.

File metadata

  • Download URL: pypayment-1.6.0-py3-none-any.whl
  • Upload date:
  • Size: 17.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.17

File hashes

Hashes for pypayment-1.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9fd82095d045df888cf84ff130e4ea424550c8de31e166983031c8304a007465
MD5 0243fe413299349cb7d46ad1accf0934
BLAKE2b-256 54496e0ca1587f7e806aabf7874cde55063d7a20b65ff0243eae443129f35dee

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page