Payment Flow
Understand the complete payment lifecycle from order creation to settlement.
This guide explains the complete payment flow from order creation to completion.
Flow Overview​
Detailed Steps​
1. Order Creation​
The merchant creates a payment order with transaction details.
Order State: pending
Required Data:
- Project ID
- Amount and currency
- Success/failure/callback URLs
- Merchant reference
2. Payment Link Creation​
Generate a payment URL for the customer.
Link State: active
Optional Configuration:
- Link lifetime (default: 1 hour)
- Language preference
- Payment flow (direct/interactive)
- Pre-selected payment method
3. Customer Redirect​
Redirect the customer to the payment page.
// Redirect customer
header('Location: ' . $paymentUrl);
exit;
Or use JavaScript:
window.location.href = paymentUrl;
4. Payment Method Selection​
Customer sees the payment page:
Available Methods depend on:
- Currency
- Amount (min/max limits)
- Country
- Merchant configuration
5. Payment Processing​
Customer completes the payment with their chosen method.
Processing States:
- Submitting to payment provider
- Waiting for bank response
- Verifying transaction
6. Payment Result​
The payment completes with a success or failure.
Success Path:
Payment Processing → Completed → Webhook → Redirect to success_url
Failure Path:
Payment Processing → Failed → Webhook → Redirect to failure_url
7. Webhook Notification​
Paysera sends a callback to your server.
Webhook Contains:
- Event type (payment.completed, payment.failed)
- Order details
- Payment method used
- Timestamps
8. Customer Redirect​
Customer is redirected back to your site.
Success URL receives:
- Query parameters you included in success_url
- Customer lands on thank you page
Failure URL receives:
- Query parameters you included in failure_url
- Customer can retry or contact support
Complete Sequence Diagram​
Alternative Flows​
Bank Transfer (Pending)​
Bank transfers may remain pending until the customer completes the transfer:
Pending State:
- Customer receives bank details
- Order stays in
pendingstatus - Webhook sent when bank confirms transfer
Multiple Payment Attempts​
A customer may fail and retry: