Skip to content

Latest commit

 

History

History
84 lines (56 loc) · 3.17 KB

README.md

File metadata and controls

84 lines (56 loc) · 3.17 KB

NowPay-Python

CodeQL Pylint Python application Upload Python Package codecov Black Code style: black

This repo is for the python package called "nowpay"

A Python wrapper for the NOWPayments API.

The api call descriptions are from the official documentation.

Getting Started

Before using the NOWPayments API, sign up for a API key here.

If you want to use the Sandbox, request your API key here.

To install the wrapper, enter the following into the terminal.

pip install nowpay

Every api call requires this api key. Make sure to use this key when getting started.

from nowpay import NOWPayments

now_pay = NOWPayments(API_KEY)

status = now_pay.status()

Sandbox is used in the same way in correspondence with the documentation as follows.

from nowpay import NOWPayments

now_pay = NOWPayments(SANDBOX_API_KEY, True)

status = now_pay.status()

How to use the IPN

export_app() returns a WSGI app that can be hosted with waitress, gurnicorn or others

from nowpay.ipn import Ipn

def success(dictionary):
  print(dictionary)

ipn = Ipn("My_IPN_Secret", success)
app = ipn.export_app()

app.run()

# To understand more visit examples/ipn.py for a more thorough explanation

Breaking Changes from 1.1.1

  • Renamed Function names
    • status (for api status)
    • currencies (for all available currencies)
    • merchant_coins (for your account allowed coins)
    • estimate (to estimate cost for a transaction)
    • create_payment (to create a payment transaction, returns details)
    • payment_status (to view payment status from id)
    • min_amount (view minimum cost of a transaction allowed from 1 crypto to another)
  • No more extra sandbox class (built in)
    • Now use sandbox=True in the constructor
    • added case support, now in sandbox mode, you are able to specify case.
      • valid cases are "success", "partially_paid", "failure" to test your api

Credit

Originally written by @Ventura94