Skip to main content

User Closes the Modal

When a customer closes the payment modal without completing, the SDK throws a CubePayClosedError. This is not a failure — it means the user chose to cancel.
Always check for CubePayClosedError before treating a thrown error as a failure. This is the most common “error” you will encounter.

Client-Side Errors


Server-Side Errors

Session Creation Errors

Handling Server Errors


Webhook Error Handling

Design your webhook handler to be idempotent and always return 200:
If your webhook handler returns a non-2xx status code, the payment service will retry delivery. Return 200 even when your internal processing fails to avoid duplicate deliveries.

Next Steps

Set up your Sandbox Environment to test the full payment flow with test networks.