Skip to main content

NOWPayments python API

Project description

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()

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

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

nowpay-2.1.0.tar.gz (6.2 kB view hashes)

Uploaded Source

Built Distribution

nowpay-2.1.0-py3-none-any.whl (6.3 kB view hashes)

Uploaded Python 3

Supported by

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