Overview
The Yabetoo payment flow follows a two-step process that gives you full control over when and how payments are captured.Step 1: Create a Payment Intent
A Payment Intent represents your intention to collect a payment. It tracks the payment lifecycle and stores information about the transaction.- No money has been moved
- The intent is in
pendingstatus - You have a
client_secretfor the next step
Step 2: Confirm the Payment Intent
Confirmation triggers the actual payment. You provide the customer’s payment method details (Mobile Money information).- The customer receives a push notification on their phone
- They enter their PIN to authorize the payment
- Yabetoo waits for the Mobile Money provider’s response
Step 3: Handle the Result
Synchronous Response
The confirmation request returns immediately with the payment status:Webhook Notification
For reliability, always listen for webhooks. Yabetoo sends anintent.completed event when the payment succeeds:
Payment Statuses
Common Error Codes
When a payment fails, you may receive one of these error codes:Best Practices
- Always verify webhooks - Don’t rely solely on the synchronous response
- Store the payment intent ID - Link it to your order for tracking
- Handle failures gracefully - Show clear error messages to users
- Implement idempotency - Prevent duplicate payments on retries
Alternative: Checkout Sessions
For a simpler integration, use Checkout Sessions. Yabetoo handles the entire payment UI:For more details on each step, see the Payment Intent API documentation.