QBitFlow Documentation

    Complete guide to integrating cryptocurrency payments with QBitFlow

    Monitoring Transactions

    QBitFlow provides three ways to monitor transaction status: webhooks, success URLs, and WebSocket connections. Choose the method that best fits your use case.

    Overview

    Webhooks

    Recommended

    Server-to-server notifications. Most reliable method for production use.

    Success URLs

    User Feedback

    Redirect customers after payment. Great for immediate user feedback.

    WebSocket

    Real-time

    Real-time status updates. Use when immediate feedback is critical.

    Method 1: Webhooks (Recommended)

    Reliable Server-to-Server Notifications

    Webhooks are the most reliable way to receive payment notifications. When a transaction is processed, QBitFlow sends a POST request to your webhook URL with the transaction details. This happens regardless of whether the customer closes their browser or loses internet connection.

    Setting Up Webhook Handler

    Webhook Handler Implementation
    Handle webhook notifications from QBitFlow

    ⚠️ Important: Always return a 200 status code to acknowledge webhook receipt. If QBitFlow doesn't receive a 200 response, it will retry the webhook delivery multiple times.

    Method 2: Success & Cancel URLs

    Redirect-Based Monitoring

    Success and cancel URLs provide immediate feedback to your customers by redirecting them back to your site after they complete or cancel a payment. While not as reliable as webhooks (customers might close their browser), they're excellent for providing instant user feedback.

    Creating Session with URLs

    Include Success/Cancel URLs
    Add redirect URLs when creating sessions

    Handling Success Redirect

    Success URL Handler
    Handle customers redirected after successful payment

    Method 3: WebSocket (Real-Time)

    Real-Time Status Updates

    WebSocket connections provide real-time transaction status updates. This is useful when you need immediate feedback, but it's generally not recommended as the primary monitoring method since it requires maintaining an active connection. Use WebSockets for UI updates while relying on webhooks for business logic.

    WebSocket Monitoring
    Monitor transaction status in real-time

    ⚠️ Note: WebSockets are best used for real-time UI updates (like progress bars or status indicators). For reliable transaction processing, always implement webhook handlers as your primary monitoring method.

    Best Practices

    Use Webhooks as Primary Method

    Always implement webhook handlers for production. They're the most reliable way to receive payment notifications, working even if customers close their browser.

    ✅ Combine Webhooks with Success URLs

    Use webhooks for reliable server-side processing and success URLs for immediate customer feedback. This combination provides the best user experience.

    🔒 Always Return 200 for Webhooks

    Your webhook endpoint must return HTTP 200 to acknowledge receipt. If QBitFlow doesn't receive a 200 response, it will retry delivery.

    🔍 Verify Transaction Status

    In success URL handlers, always verify the transaction status by querying the API. Don't trust the redirect alone for critical business logic.

    🎨 Use WebSockets for UI Only

    WebSockets are perfect for real-time UI updates (progress bars, status badges), but rely on webhooks for actual payment processing logic.