BusinessPlus Connect (Developer)
Hosted Payments & Authoritative Verification
Redirect customers to the BusinessPlus-hosted checkout experience for automated M-Pesa STK push and manual till payments, handle return URLs, and verify order settlement.
The Hosted Payment Model & Payment Methods
When an order is created, BusinessPlus returns payment.available = true and a deterministic payment.payment_url. The custom storefront does NOT need to implement M-Pesa STK push or handle Daraja webhooks directly. BusinessPlus manages payment initiation, real-time polling, and ledger reconciliation within the hosted payment page.
- 1. M-Pesa Direct (STK Push): Customers enter their mobile phone number and click "Confirm payment". An automated M-Pesa SIM prompt (STK Push) is dispatched to their phone immediately.
- 2. Paybill / Till (Manual Transaction Code): For customers paying via Buy Goods Till or Business Paybill from another phone, the hosted page provides manual transaction code entry with real-time verification.
NOTE: Note on Card Rails: Card processing (via IntaSend) is supported within the platform's backend infrastructure, but the customer-facing hosted checkout page currently exposes M-Pesa STK push and Paybill/Till entry.
Configuring the Return URL (?return_url=)
The hosted payment page accepts an order-specific return destination via the return_url query parameter. Because the hosted checkout does not automatically guess your confirmation URL structure, append your URL-encoded destination to payment.payment_url:
Retrieving Authoritative Order Status
Query GET /v1/orders/:id from your backend server to inspect authoritative payment and fulfillment state:
Security Warning: Redirect Does NOT Equal Payment
A customer returning to your website from the payment page does NOT prove payment succeeded. Shoppers may click the "Back" button, cancel an STK prompt, or experience network drops during mobile checkout.
TypeScript Server-Side Order Verification Example
Implement authoritative payment verification in your Next.js order confirmation page: