STK Push on Hotspot
How M-Pesa STK Push works on the Jasiyo hotspot captive portal — initiation, callback handling, and automatic MikroTik user provisioning.
How STK Push works on the hotspot
When a customer selects a plan on the captive portal and enters their phone number, Jasiyo initiates an M-Pesa STK Push via your configured payment provider. Here's the full sequence:
- 1Customer selects plan and enters their phone number on the portal
- 2Portal sends a request to Jasiyo's hotspot payment API
- 3Jasiyo calls your payment provider (Daraja, PayHero, or Paystack) to initiate STK Push
- 4Customer's phone shows an M-Pesa payment prompt
- 5Portal displays a shimmer/loading animation with a countdown timer while waiting
- 6Customer approves the payment on their phone
- 7Payment provider sends a webhook callback to Jasiyo
- 8Jasiyo creates a hotspot user on MikroTik via the phone-home agent
- 9Portal detects the successful payment (via polling) and redirects the customer to the internet
Supported payment providers
STK Push on the hotspot portal works with all three Jasiyo payment providers:
- Daraja (own Paybill)Direct Safaricom STK Push. Fastest and most reliable.
- PayHero (bank Paybill)STK Push routed via PayHero to your bank Paybill.
- PaystackSTK Push via Paystack's infrastructure.
Jasiyo automatically uses whichever provider you have configured and active for your account.
Timeout & retry
The portal waits up to 90 seconds for the customer to approve the M-Pesa prompt. The countdown timer on screen shows them how long they have.
If the customer doesn't approve in time, the portal shows an error and they can try again. No money is deducted if the STK Push times out without approval.
If a payment fails or doesn't reflect
If a customer says they paid but aren't getting access, check:
- → Transactions page — did the payment show up? If not, the callback may not have been received.
- → Router status — is the router online? If offline, the MikroTik user creation command is queued and will run when the router reconnects.
- → Hotspot users on MikroTik — open WinBox → Hotspot → Users and check if the user was created.