Skip to main content

Binance and Crypto Payment Checkout

Project description

binance-and-crypto-payment

Official Python SDK for Binance and Crypto Payment integration.

Installation

pip install binance-and-crypto-payment

Binance & Crypto payment gateway for python

Latest Stable Version Total Downloads License

Introduction

The Binance and Crypto Payment Gateway python projects is powered by Payerurl. This package acts as a robust cryptocurrency payment processor, allowing merchants and developers to receive customer payments directly into their crypto wallets without the need for a middleman or intermediary account. We specialize in Binance QR code payments, providing a smooth, integrated experience where users never have to leave your python application to complete a transaction.

Binance QR Code Payment

This package is the ideal solution for developers seeking a secure Binance payment integration for Python and django. Binance Pay is a contactless, borderless, and highly secure payment method. By using this projects , you can accept payments via Binance QR codes and process transactions through the Binance personal account API.

The projects serves as a seamless bridge between Binance and your Python application. Customers simply scan the generated QR code on your checkout page to finish the transaction. This process is:

  • Fast and Simple: No complex redirects or external logins for the user.
  • Cost-Effective: Incurs no network fees or additional hidden costs.
  • Secure: Enhanced security protocols help avoid scams and ensure transaction safety.

👉 LIVE DEMO — Click to open in new tab

How This Package Works

The Binance and Crypto Payment Gateway automatically converts any fiat currency to the selected cryptocurrency using live exchange rates. Once the payment is verified, funds are credited instantly to the merchant's wallet. The package then utilizes a secure API response to update your application's order status (e.g., from "Pending" to "Processing") in real-time.

Key Features

  • Extensive Network Support: Supports Binance QR payment, Binance Pay, USDT (TRC20/ERC20), USDC (ERC20), Bitcoin (BTC), and Ethereum (ETH ERC20).
  • Fiat Compatibility: Supports over 169+ fiat currencies (USD, CAD, GBP, EUR, etc.) with real-time exchange rates powered by payerurl.com.
  • Developer Friendly: 100% Free Open Source package designed specifically for the Laravel ecosystem.
  • Privacy Focused: No bank account or mandatory personal identity verification required.
  • Simple Integration: Streamlined signup process with easy API key integration.
  • Accessibility: No KYC required for withdrawals on Basic accounts.
  • Dedicated Support: 24/7 technical assistance for integration via Telegram: https://t.me/Payerurl.

About Payerurl

Payerurl is a premier payment processor enabling direct cryptocurrency transfers from customers to merchant wallets. Merchants can integrate Binance personal/merchant APIs alongside various receiving wallets including USDT, BTC, ETH, and USDC. We utilize live market rates to ensure accurate conversion from local fiat currencies to the corresponding cryptocurrency amount.

🔴 LIVE DEMO

🔑 GET API KEY

Get your API key: https://dash.payerurl.com/profile/get-api-credentials

Support

🚀 How It Works

  1. Collect user and order info on your platform.
  2. Call the payment() function with required details.
  3. User is redirected to PayerURL payment page.
  4. 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": "john@example.com",
        "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)

License

This projects is open-sourced software licensed under the MIT license.

Support

For support and questions, please contact us via:


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

binance_and_crypto_payment-0.1.16.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

binance_and_crypto_payment-0.1.16-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

Details for the file binance_and_crypto_payment-0.1.16.tar.gz.

File metadata

File hashes

Hashes for binance_and_crypto_payment-0.1.16.tar.gz
Algorithm Hash digest
SHA256 d5b129c5e2471adbb355f34e8afdaafc76c1b0ef62241b140479b64dfb96f96a
MD5 524f5f3e9bd72bf699a56ddbcb69c42f
BLAKE2b-256 dbed63864841990908846b10baac0eb0e3dde321f548eacbe1c33aa34fa7ba8e

See more details on using hashes here.

File details

Details for the file binance_and_crypto_payment-0.1.16-py3-none-any.whl.

File metadata

File hashes

Hashes for binance_and_crypto_payment-0.1.16-py3-none-any.whl
Algorithm Hash digest
SHA256 0fad55ca9f118b11ee1ab457fd0a8f678ad5149bcb19c7c69dbdadbb38adaf66
MD5 baeb41228619e32ea724ad869cf7a78a
BLAKE2b-256 168e0bd1f853a81b3349f7a84abe9437105487f4f3464d3b30f577c0ee868c0e

See more details on using hashes here.

Supported by

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