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.
1. PAYMENT
* Initialize Payment
* Confirm Payments
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
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
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 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