RazCrypto RazCrypto Docs
Dashboard Get API Keys
Docs Frontend Integration

Frontend Integration

Accept payments directly from frontend JavaScript — no backend required. Best for static sites, landing pages, freelancers.

2 minutes to go live. Just include our SDK and add 3 lines of code.

Complete Example

HTML
<!DOCTYPE html>
<html>
<head>
    <title>Accept USDT Payments</title>
    <script src="https://razcryptogateway.com/sdk/razcrypto-v2.js"></script>
</head>
<body>
    <button onclick="pay()">Pay $10 USDT</button>

    <script>
    RazCrypto.init({ public_key_id: "rz_pub_your_public_key_here" });

    function pay() {
        RazCrypto.checkout({
            amount: 10.00,
            currency: "USDT",
            chain: "BSC",
            email: "[email protected]",
            callback_url: "https://yourwebsite.com/webhook",
            custom_data: { order_id: "ORD_001", product: "Premium Plan" },
            handler: function(response) {
                // Payment confirmed!
                window.location.href = "/thank-you?id=" + response.payment_id;
            },
            onError: function(error) {
                alert("Error: " + error.message);
            }
        });
    }
    </script>
</body>
</html>

When to Use Frontend Integration

Use CaseRecommended?
Static website / landing page✅ Perfect
Simple product sales✅ Perfect
Freelancer invoices✅ Perfect
E-commerce with server logic⚠️ Use Backend Integration
Subscription systems⚠️ Use Backend Integration