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

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.

🔑 GET API KEY

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

🚀 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.14.tar.gz (9.6 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.14-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for binance_and_crypto_payment-0.1.14.tar.gz
Algorithm Hash digest
SHA256 b08f653f9b518d07c5a739af53a511b771a592bfa5db87feaa37c292b40018ca
MD5 d2690aa20ccdd4a3734214fc4f1494e7
BLAKE2b-256 cde0450450a06273ce45da69443fe6aa2f28167d2c9f7d5a56c129c8f35d9725

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for binance_and_crypto_payment-0.1.14-py3-none-any.whl
Algorithm Hash digest
SHA256 6d645ff153b4ccf5e9a8a7475ab2c686ec62d10cb242cbd6c873e77e53009dbc
MD5 e4447a1adbaaf29fc6f5cb62e863d16f
BLAKE2b-256 2c7514d91b35b33fcd9a02474f827444fc793d404e5f82daf4e8cd6644533557

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