Overview
Customer-to-Business (C2B) payments enable Sarafa merchants to receive payments directly from agents in a secure and efficient manner. This documentation outlines the two methods available for accepting C2B payments.How C2B Payments Work
- Customer initiates a payment request
- Agent processes the payment through Sarafa platform
- System validates transaction with merchant
- Payment is transferred to merchant account
- Merchant receives confirmation webhook
Prerequisites
Before accepting C2B payments, merchants must:- Create a Merchant Account
- Register at merchant.sarafa.ss
- Complete account verification
- Obtain Merchant Code
- Upon registration, you’ll receive a unique 6-digit merchant code
- This code is used by agents to identify your business
- Keep this code secure and share only with authorized agents
- Configure Webhook URLs (for Method 1)
- Set up a validation URL to receive payment validation requests
- Set up a confirmation URL to receive payment success notifications
Method 1: Direct Agent Payment
This method allows agents to make payments directly using your merchant code.Agent Setup
Agents must download the Sarafa Agents app:- Download: Google Play Store
Payment Process
- Agent Opens App
- Agent launches the Sarafa Agents app
- Navigates to Merchant Pay
- Enter Payment Details
- Merchant Code: Your 6-digit merchant code
- Account Number: Transaction ID or unique identifier for the payment
- This can be an order number, invoice ID, or any reference number you provide to the customer
- Validation Webhook
- System sends a validation request to your configured webhook URL
- Your system should verify the transaction details and respond with approval or rejection
- Complete Payment
- If validation is successful, agent proceeds to complete the payment
- Funds are transferred to your merchant account
- Confirmation Webhook
- Upon successful payment, a confirmation webhook is sent to your system
- This contains the complete transaction details for your records
Webhook Integration
Validation Webhook (Step 3):Method 2: Payment Widget Integration
This method provides a seamless checkout experience by integrating the Sarafa payment widget into your website or application.Implementation
Redirect customers to the Sarafa checkout page with the following URL parameters: Checkout URL:https://checkout.sarafa.ss
Required URL Parameters
| Parameter | Description | Example |
|---|---|---|
amount | Payment amount (in minor units) | 10000 (for 100.00) |
currency | Currency code | SSP |
publicKey | Your public key from merchant portal | pk_live_abc123... |
reference | Unique payment reference | INV-2025-001 |
successUrl | Redirect URL on successful payment | https://yoursite.com/success |
cancelUrl | Redirect URL on cancelled payment | https://yoursite.com/cancel |
Example Integration
Payment Flow
- Customer Redirect
- Customer is redirected to Sarafa checkout page
- Payment details are pre-filled from URL parameters
- QR Code Display
- Sarafa checkout page displays a QR code
- Customer presents their device to a nearby merchant/agent
- Merchant Scans QR
- Merchant scans the QR code using the Sarafa Agents app
- Payment details are automatically populated
- Payment Completion
- Merchant/agent confirms and processes the payment
- Transaction is completed in real-time
- Customer Redirect
- On success: Customer is redirected to your
successUrl - On cancel: Customer is redirected to your
cancelUrl - Payment reference and transaction details are included in the redirect
- On success: Customer is redirected to your
Success Callback
When payment is successful, customer is redirected to yoursuccessUrl with query parameters:
Benefits of Each Method
Method 1: Direct Agent Payment
- ✅ Simple integration with webhooks
- ✅ Direct communication between agent and merchant
- ✅ Real-time validation of transactions
- ✅ Ideal for in-person transactions
Method 2: Payment Widget
- ✅ Seamless customer experience
- ✅ QR code-based payment flow
- ✅ Automatic redirect handling
- ✅ Perfect for e-commerce integration
Security Best Practices
- Protect Your Credentials
- Only use your Public Key and never the Private Key
- Use HTTPS for all webhook URLs
- Validate Webhooks
- Validate transaction amounts, currencies and references
- Implement idempotency to prevent duplicate processing. A transaction ID for every completed transaction will be provided.
- Monitor Transactions
- Regularly review transactions in the merchant portal
- Reconcile payments periodically.
Support
For technical support or questions:- Visit: merchant.sarafa.ss
- Contact Sarafa support team through [email protected]
Getting Started Checklist
- Register merchant account at merchant.sarafa.ss
- Note down your 6-digit merchant code
- Obtain your public key from merchant portal
- Set up webhook URLs (for Method 1)
- Test payment flow with small amounts
- Integrate chosen method into your system
- Train staff on accepting C2B payments
- Go live and start accepting payments!
Last Updated: October 2025
