Handle different payment outcomes in your checkout flow
The Hubtel Checkout SDK provides detailed payment status information through the UnifiedCheckoutPaymentStatus enum and CheckoutCompletionStatus class to help you handle different payment outcomes.
The payment is pending confirmation. This typically occurs with bank pay transactions where a receipt has been successfully downloaded but final confirmation is awaited.
Do not fulfill the order until the payment status changes to paymentSuccess and is confirmed via your callback URL.
The payment status could not be determined. This occurs when the user cancels the transaction after a payment attempt but before checking the final status.
Poll your backend or Hubtel’s API to determine the actual payment status before taking action.
Never rely solely on the client-side status. Always verify payment status through your backend and Hubtel’s API.
Handle All Cases
Implement handlers for all possible status values to provide appropriate feedback to users.
Store Transaction ID
Save the transaction ID to your database for reconciliation and customer support purposes.
Webhook Integration
Implement webhook handling at your callback URL for real-time payment status updates.
Security Note: Do not fulfill orders or grant access based solely on the client-side payment status. Always verify the payment through your backend callback URL or by querying Hubtel’s payment verification API.