Overview
The checkout flow is the simplest way to accept payments with Waypay. It provides a fully hosted payment page where customers can complete their purchase using various payment methods including cards and mobile wallets.Flow Diagram

Step-by-Step Flow
Step 1: User Accesses Your Site
The customer visits your merchant website and browses products or services.Step 2: User Chooses Checkout/Payment
The customer adds items to cart and proceeds to checkout, ready to make a payment.Step 3: Merchant Site Initiates Checkout
Your merchant site sends a request to your backend server to initiate the checkout process.Step 4: Merchant Server Calls Checkout API
Your server makes a call to the Waypay/Payment/initiate-checkout endpoint with payment details:
Step 5: Payment Server Creates Order
The Waypay Payment Server receives your request and creates a payment order in the system.Step 6: Return Checkout URL
Waypay returns a checkout URL to your merchant server:Step 7: Provide Checkout URL to User
Your merchant site receives the checkout URL and redirects the customer to it.Step 8: User Visits Checkout Page
The customer is taken to the Waypay hosted checkout page where they see:- Order summary
- Payment amount
- Available payment methods
- Customer information
Step 9: Select Payment Method and Submit
The customer:- Reviews the order details
- Selects their preferred payment method (card, JazzCash, Easypaisa, etc.)
- Enters payment credentials
- Submits the payment
Step 10: Forward Payment Request
The merchant site forwards the payment request to the Waypay Payment Server for processing.Step 11: Call E-Wallet Provider
The Payment Server communicates with the selected E-Wallet Provider (JazzCash, Easypaisa, etc.) to process the transaction.Step 12: E-Wallet Provider Responds
The E-Wallet Provider:- Validates payment credentials
- Processes the transaction
- Returns the result (success/failure)
Step 13: Record Transaction
The Payment Server records the transaction details and final status in the database.Step 14: Show Success/Failure Message
The user is shown a success or failure message on the checkout page, then redirected to your success or cancel URL.Payment Methods Supported
Mobile Wallets
JazzCash, Easypaisa, NayaPay, SadaPay
Cards
Visa, Mastercard (coming soon)
Bank Transfer
Direct bank transfers (coming soon)
Buy Now Pay Later
Installment options (coming soon)
Redirect URLs
Success URL
When payment is successful, the customer is redirected to yoursuccessUrl with these query parameters:
Cancel URL
If the customer cancels or payment fails, they’re redirected to yourcancelUrl:
Best Practices
Always Verify Payment Status
Always Verify Payment Status
After customer returns to your site, verify the payment status by:
- Checking webhook notifications
- Querying the transaction API
- Never trust query parameters alone
Handle Expired Checkout URLs
Handle Expired Checkout URLs
Checkout URLs expire after the time specified in
expiresAt. Always check if the URL is still valid before redirecting customers.Provide Clear Order References
Provide Clear Order References
Use meaningful
orderRef values that help you identify orders in your system.Set Appropriate Redirect URLs
Set Appropriate Redirect URLs
- Use HTTPS URLs
- Ensure URLs are publicly accessible
- Handle both success and failure scenarios
- Don’t expose sensitive information in URLs
Store Payment Intent IDs
Store Payment Intent IDs
Always store the
paymentIntentId in your database linked to the order for future reference and reconciliation.Security Considerations
API Key Security
Never expose your API key on the frontend. Always call the checkout API from your backend server.
HTTPS Only
Ensure all redirect URLs use HTTPS to protect customer data in transit.
Webhook Verification
Verify webhook signatures to ensure notifications are from Waypay.
Amount Validation
Always validate the payment amount matches your order total before creating checkout.
Checkout Page Features
The Waypay hosted checkout page includes:- ✅ Responsive Design - Works on desktop, tablet, and mobile
- ✅ Multiple Payment Methods - Cards, mobile wallets, and more
- ✅ Multi-language Support - English and Urdu
- ✅ Real-time Validation - Instant feedback on form inputs
- ✅ Security - PCI DSS compliant infrastructure
- ✅ Brand Customization - Display your logo and brand colors
Testing
In test mode, use these credentials:JazzCash Test
- Mobile:
03001234567 - CNIC Last 6:
123456 - OTP:
123456
Easypaisa Test
- Mobile:
03001234567 - CNIC Last 6:
123456 - OTP:
123456
Test transactions won’t charge real money and won’t affect production data.
