YoboPay
    YoboPay
    • 接入说明
    • Introduction
    • Webhook接入
    • Webhook Introduction
    • Test Card
    • Embedded Checkout
    • Checkout
      • Create Session
        POST
      • Expire Session
        POST
      • Retrieve Session
        GET
    • PaymentIntents
      • Retrieve PaymentIntent
        GET
      • List all paymentIntent
        GET
    • Charges
      • List all charges
        GET
    • Customers
      • Create Customer
        POST
      • Update Customer
        POST
      • Retrieve Customer
        GET
    • Events
      • The Event object
      • Types of Events
      • Data Object
        • PaymentIntent
        • Charge
    • Refunds
      • Create Refund
        POST
      • List all refunds
        GET

    Webhook Introduction

    Listen to events in your Yobopay account on your webhook endpoint so your integration can automatically trigger reactions.
    When building Yobopay integrations, you might want your applications to receive events as they occur in your Yobopay accounts, so that your backend systems can execute actions accordingly.
    Create an event destination to receive events at an HTTPS webhook endpoint. After you register a webhook endpoint, Yobopay can push real-time event data to your application’s webhook endpoint when events happen in your Yobopay account. Yobopay uses HTTPS to send webhook events to your app as a JSON payload that includes an Event object.

    Get Started#

    1
    Create a Webhook Endpoint
    Create a webhook endpoint handler to receive event data POST requests.
    Use HTTP/HTTPS for sandbox testing; HTTPS is mandatory for production.
    2
    Register the Endpoint
    Register your webhook URL and obtain a ​webhook_secret_key.
    image.png
    image.png
    image.png
    3
    Data Signature Validation
    Verify request authenticity using HMAC-SHA256 signatures (see ).

    Endpoint Configuration Example#

    Signature Validation Steps#

    1
    Extract Headers
    2
    Generate Signed Payload
    3
    Compute HMAC-SHA256 Signature
    4
    Validate Signatures
    Compare computed signature with header value.
    Tolerate minor timestamp discrepancies (e.g., ±30 seconds)

    Best Practices#

    Security: Store webhook_secret_key in secure vaults.
    Idempotency: Design endpoints to handle duplicate events safely.
    Error Handling: Return 200 OK only after successful validation to prevent retries.
    Always validate signatures before processing payloads
    Reject requests with invalid/missing timestamps (risk of replay attacks)
    Modified at 2025-04-28 12:07:28
    Previous
    Webhook接入
    Next
    Test Card
    Built with