Skip to content

Johnkayode/lazerpay-python-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

# 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="kalunjoku123@gmail.com", 
        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