Code Monkey home page Code Monkey logo

pypayment's Introduction


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

pypayment's People

Contributors

timnekk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

void0x

pypayment's Issues

YooMoney

Add yoomoney support via public API

PayOk AuthorizationError

Authorization error Pay Ok if there are no transactions in the account. Transactions are validated before creating a test transaction.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.