Giter VIP home page Giter VIP logo

lazerpay-python-sdk's Introduction

# Lazerpay v1 Python SDK

How to use

pip install lazerpay-python-sdk

from lazerpay.resource import LazerPayClient

lazerpay = LazerPayClient(pubKey=LAZER_PUBLIC_KEY, secretKey=LAZER_SECRET_KEY)

For staging, Use TEST API Keys and for production, use LIVE API KEYS. You can get your LAZER_PUBLIC_KEYS from the Lazerpay dashboard.

Lazerpay Methods exposed by the sdk

1. PAYMENT

* Initialize Payment
* Confirm Payments

Initialize Payment

This describes to allow your customers to initiate a crypto payment transfer.

from lazerpay.resource import LazerPayClient

lazerpay = LazerPayClient(pubKey=LAZER_PUBLIC_KEY, secretKey=LAZER_SECRET_KEY)


try:
    response = lazerpay.initTransaction( 
        reference="YOUR_REFERENCE", # Replace with a reference you generated
        amount="10", 
        customer_name="Njoku Emmanuel", 
        customer_email="[email protected]", 
        coin="USDC", 
        currency="NGN", 
        accept_partial_payment=True # By default, it's false
    )
except Exception as e:
    raise e

Confirm Payment

This describes to allow you confirm your customers transaction after payment has been made.

from lazerpay.resource import LazerPayClient

lazerpay = LazerPayClient(pubKey=LAZER_PUBLIC_KEY, secretKey=LAZER_SECRET_KEY)

try:
    response = lazerpay.confirmPayment(
        identifier="address generated or the reference generated by you from initializing payment"
    )
except Exception as e: 
    raise e

Get Accepted Coins

This gets the list of accepted cryptocurrencies on Lazerpay

from lazerpay.resource import LazerPayClient

lazerpay = LazerPayClient(pubKey=LAZER_PUBLIC_KEY, secretKey=LAZER_SECRET_KEY)

try:
    response = lazerpay.getAcceptedCoins()
except Exception as e: 
    raise e

Payout

Payout funds to an address

from lazerpay.resource import LazerPayClient

lazerpay = LazerPayClient(pubKey=LAZER_PUBLIC_KEY, secretKey=LAZER_SECRET_KEY)

try:
    response = lazerpay.payout(amount=1,
            recipient="0x0B4d358D349809037003F96A3593ff9015E89efA", 
            coin="BUSD", 
            blockchain="Binance Smart Chain"
        )
except Exception as e: 
    raise e

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.