Binance & Crypto Payment Gateway for Python
π What Is This Package?
This is a free Python SDK/plugin that lets your online store accept cryptocurrency payments directly into your own wallet. Powered by PayerURL, it removes the middleman completely β meaning you get paid instantly with no extra fees or third-party holding your money.
You can accept Binance QR code payments using just a regular Binance account. No need to apply for a special Binance Merchant account. The system automatically converts any local currency like USD, EUR, or GBP into the correct crypto amount using live exchange rates. As soon as a customer pays, the money goes straight to your wallet and your store gets an instant payment confirmation via API.
π΄ LIVE DEMO
π³ Accepted Payment Methods
Accept payments from your customers using any of these popular options:
- β Binance QR Code β works with a regular Binance account
- β USDT β TRC20, ERC20, and BEP20 networks
- β USDC β BEP20 and ERC20 networks
- β Bitcoin (BTC)
- β Ethereum (ETH) β ERC20 network
π Why Developers & Shop Owners Love It
- β Supports 169+ currencies β USD, EUR, GBP, CAD, BDT, and more
- β Live exchange rates β customers always pay the correct crypto amount
- β Instant wallet settlement β funds go directly to you, no waiting
- β No KYC needed β get started without identity verification
- β Secure API β every payment is verified server-to-server
- β Instant order updates β your store status changes automatically after payment
- β 100% free & open source β no hidden costs, ever
- β 24/7 support via Telegram β help is always available
Support
For support and questions, please contact us via:
- Telegram:Β https://t.me/Payerurl
- Website:Β https://payerurl.com
π GET API KEY
Get your API key:Β https://dash.payerurl.com/profile/get-api-credentials
π How It Works
- Collect user and order info on your platform.
- Call the payment() function with required details.
- User is redirected to PayerURL payment page.
- After payment:
- User is redirected to redirect_url.
- Your backend receives a callback at notify_url with transaction details.
- On cancellation, user is returned to cancel_url.
Usage
from binance_and_crypto_payment import CryptoPaymentClient
client = CryptoPaymentClient(
public_key="YOUR_PUBLIC_KEY",
secret_key="YOUR_SECRET_KEY"
)
response = client.payment(
invoice_id="INV001",
amount=1.00,
currency="USD",
items=[{"name": "Product", "qty": "1", "price": "1.00"}],
data={
"first_name": "John",
"last_name": "Doe",
"email": "[email protected]",
"redirect_url": "https://example.com/success",
"notify_url": "https://example.com/notify",
"cancel_url": "https://example.com/cancel",
}
)
print(response)
Notify Url Callback
from django.http import JsonResponse
from django.views.decorators.csrf import csrf_exempt
from django.views.decorators.http import require_POST
from django.db import transaction
import logging
from binance_and_crypto_payment import CryptoPaymentNotify, CryptoPaymentException, StatusCode
@csrf_exempt
@require_POST
def payerurl_notify(request):
notify = CryptoPaymentNotify(
public_key="YOUR_PUBLIC_KEY",
secret_key="YOUR_SECRET_KEY"
)
try:
result = notify.process(request)
if result["type"] == "cancelled":
return JsonResponse(
{"status": StatusCode.ORDER_CANCELLED, "message": "Order Cancelled"},
status=200
)
data = result["data"]
# -------------------------------
# π₯ YOUR BUSINESS LOGIC GOES HERE
# -------------------------------
# Example pseudo-code:
# with transaction.atomic():
# order = Order.objects.select_for_update().get (invoice_id=data["order_id"])
# txn = Transaction.objects.select_for_update().get(order=order)
# if order.status == "paid" or txn.status == "success":
# return JsonResponse({"status": StatusCode.ALREADY_PROCESSED, "message": "Already processed"}, status=200)
# txn.transaction_id = data["transaction_id"]
# txn.status = "success"
# txn.raw_response = request.POST.dict()
# txn.save()
# order.status = "paid"
# order.invoice_id = data.get("ext_transaction_id", order.invoice_id)
# order.save()
return JsonResponse({"status": StatusCode.SUCCESS, "message": "Payment processed successfully"}, status=200)
except CryptoPaymentException as e:
return JsonResponse({"status": e.code, "message": e.message}, status=400)
except Exception:
return JsonResponse({"status": StatusCode.INTERNAL_ERROR, "message": "Internal error"}, status=500)









