State Diagram
The following diagram illustrates the standard flow of a payment from initiation to completion.Payment States
1. PENDING_PAYMENT
The initial state when a payable item is created and awaiting payment.- Trigger: Customer creates a transaction or wallet funding request
- Action Required: Customer must select payment method and initiate payment
- Next Possible States:
CONFIRMED,CANCELLED
Create Payable
View how to create payable items and fetch payment methods.
2. CONFIRMED
Payment has been initiated but not yet verified by the payment gateway or admin.- Trigger:
- Customer submits payment via wallet, card, or bank transfer
- System creates payment instruction
- Context: Payment is being processed by the gateway or awaiting bank transfer confirmation
- Next Possible States:
PAID,AWAITING_APPROVAL,FAILED
3. AWAITING_APPROVAL
Specific to bank transfers where customer has notified they will pay later.- Trigger:
- Customer calls
PUT /bank-iwillpaylater-wallet/{pcn}/{payableType} - Customer notifies
POST /notify-bank-transfer-paymentwith optionbank_paid_now
- Customer calls
- Action Required:
- Customer makes offline bank transfer
- Admin verifies payment receipt
- Next Possible States:
PAID,CANCELLED
4. PAID
Payment has been successfully received and verified.- Trigger:
- Payment gateway confirms successful payment
- Admin confirms bank transfer received
- Wallet debit successful
- Context: Funds have been received and verified
- Next Possible States:
PAID_OUT,REFUNDED
5. PAID_OUT
Transaction has been completed successfully (final state for remittances).- Trigger:
- For remittances: Funds disbursed to beneficiary
- For wallet funding: Wallet credited
- For bill payments: Payment confirmed by biller
- Action Required: None - This is a terminal success state
6. FAILED
Payment attempt failed due to insufficient funds, gateway error, or other issues.- Trigger:
- Insufficient wallet balance
- Card declined
- Payment gateway error
- Network timeout
- Action Required: Customer may retry payment with different method
- Next Possible States:
PENDING_PAYMENT,REFUNDED
7. CANCELLED
Payment was cancelled by customer or system.- Trigger:
- Customer cancels before payment
- Admin cancels awaiting payment
- Automatic cancellation after timeout
- Action Required: None - This is a terminal state
8. REFUNDED
Payment was refunded to customer.- Trigger:
- Transaction failed after payment received
- Customer requested refund
- Admin initiated refund
- Action Required: None - This is a terminal state
9. HELD
Payment is on hold pending investigation or compliance check.- Trigger:
- Fraud detection alert
- Compliance review required
- Unusual transaction pattern
- Action Required: Compliance team review
- Next Possible States:
PAID,REFUNDED,CANCELLED
10. SUSPENDED
Payment or account suspended temporarily.- Trigger:
- Account verification needed
- Suspicious activity detected
- Administrative hold
- Action Required: Customer must resolve suspension reason
- Next Possible States:
PENDING_PAYMENT,CANCELLED
Bank Transfer Lifecycle
Bank transfers follow a specific workflow within the payment lifecycle:Bank Transfer States
| State | Description | Action Required |
|---|---|---|
AWAITING_BANK_TRANSFER_PAYMENT | Customer committed to pay via bank transfer | Customer makes transfer |
RECEIVED_BANK_TRANSFER_PAYMENT | Admin confirmed payment received | None |
COMPLETED_PAYMENT_LIFECYCLE | Payment verified and transaction completed | None |
Awaiting Payments
View and manage bank transfer payments awaiting confirmation.
Payment Method Specific Flows
Wallet Payment Flow
Wallet Payments
Learn about wallet payment processing.
Card Payment Flow
Card Payments
Learn about card payment processing.
Bank Transfer Flow
Bank Transfers
Learn about bank transfer processing.
State Transitions & Webhooks
You can subscribe to webhook events to receive real-time updates when payment status changes.| Event Name | Description |
|---|---|
payment.initiated | Triggered when status changes to CONFIRMED |
payment.successful | Triggered when payment is PAID |
payment.failed | Triggered when payment FAILED |
payment.completed | Triggered when status is PAID_OUT |
payment.refunded | Triggered when payment is REFUNDED |
payment.cancelled | Triggered when payment is CANCELLED |
Webhooks Documentation
Learn how to configure and handle webhook events.
Payment Follow-up Actions
For bank transfers, the system supports automated follow-up actions:Follow-up Action Types
| Action Type | Description |
|---|---|
AUTO_CONFIRM_TRANSACTION | Payment received and approved for payout |
MARK_AS_PENDING_TRANSACTION | Payment received but held |
AUTO_HOLDFUND_WALLET | Payment received and suspended |
AUTO_FUND_WALLET | Payment received and approved for funding |
AUTO_WITHDRAWAL_WALLET | Approved for payout |
Payment Actions
Manage awaiting payment follow-up actions.
Best Practices
Error Handling
Always implement proper error handling for payment state transitions:Status Monitoring
Implement polling or webhooks to monitor payment status:User Experience
- Show clear payment status to users
- Provide estimated completion times
- Offer alternative payment methods if first attempt fails
- Send email/SMS notifications for status changes
