Overview
CheckoutCompletionStatus contains information about the completion state of a checkout transaction, including the payment status, transaction details, and payment method used.
Constructor
Parameters
The final status of the payment transaction. See UnifiedCheckoutPaymentStatus for possible values.
The unique transaction identifier generated by Hubtel. Use this ID to track and verify the transaction.
Optional. The payment channel used for the transaction (e.g., ‘mtn-gh’, ‘vodafone-gh’, ‘visa’, ‘mastercard’).
Optional. The type of payment method used (e.g., ‘mobile-money’, ‘card’, ‘bank-transfer’).
Properties
The payment status indicating whether the transaction succeeded, failed, is pending, or was cancelled.
The unique Hubtel transaction ID for this payment.
The specific payment channel used (e.g., MTN Mobile Money, Vodafone Cash, Visa).
The payment method category (e.g., mobile money, card payment).
UnifiedCheckoutPaymentStatus Enum
TheUnifiedCheckoutPaymentStatus enum defines the possible states of a payment transaction:
Status Values
The payment was completed successfully and funds were transferred.
The payment failed due to an error (insufficient funds, network issue, etc.).
The payment is still being processed. Final status is not yet determined.
The user explicitly cancelled the payment process.
The payment status could not be determined.
Usage Example
Integration with CheckoutScreen
Best Practices
Status Handling
- Success: Update order status and fulfill the purchase
- Failed: Log the error and allow the user to retry
- Pending: Poll for status updates or wait for webhook notification
- Cancelled: Return to the previous screen without changes
- Unknown: Log for investigation and contact support
Transaction Verification
- Store the
transactionIdin your database - Verify the transaction status via Hubtel’s API on your backend
- Handle webhook notifications for asynchronous status updates
- Implement idempotency to prevent duplicate order fulfillment
Payment Channel Information
ThepaymentChannel and paymentType fields help you:
- Track which payment methods are most popular
- Provide targeted customer support
- Analyze payment success rates by channel
- Optimize your payment flow based on user preferences