HomeAdvanced FeaturesPesaPal Payments
all
4 min read

PesaPal Payments

Sokobuni supports PesaPal as a payment gateway, primarily for Kenya-market stores. PesaPal supports M-Pesa, Visa, Mastercard, Airtel Money, and bank transfers — giving customers multiple ways to pay.

💡Tip

PesaPal is available on stores configured for the Kenyan market. If your store targets a different region, your payment gateway will differ. Check your store's checkout to confirm which payment methods are active.

Supported payment methods

MethodProcessing time
M-Pesa (STK Push)Instant
Visa / MastercardInstant
Airtel MoneyInstant
Bank transfer1–3 business days

The checkout flow

1
Customer clicks "Pay with PesaPal"
After reviewing their order, the customer selects PesaPal as the payment method and clicks Pay.
2
PesaPal iframe opens
A payment modal appears over the checkout page — the customer never leaves your storefront. This modal is the PesaPal payment page.
3
Customer selects payment method
Inside the modal, the customer picks M-Pesa, card, or another method and follows the steps (e.g. enters M-Pesa phone for STK Push, or card number).
4
Payment is processed
PesaPal confirms the transaction. For M-Pesa, the customer receives a push notification on their phone to authorize the payment.
5
Modal closes, order confirmed
On successful payment, the modal closes automatically and the order confirmation page appears. The customer receives a confirmation email within 60 seconds.
🖼️
Screenshot: PesaPal payment iframe modal showing M-Pesa option

M-Pesa STK Push

When a customer selects M-Pesa:

  1. They enter their Safaricom phone number
  2. They click Pay
  3. A pop-up appears on their phone: "Authorize payment of KSh X to [your store name]?"
  4. They enter their M-Pesa PIN to authorize
  5. PesaPal confirms and the order completes

The whole process takes about 20 seconds.

Handling failed payments

Customer-side failures:

  • Insufficient M-Pesa balance → customer sees an error and can try another method
  • Card declined → they can try a different card
  • STK Push timeout (didn't approve within 60s) → they can retry

Failed payments stay as "Pending" status in the Orders list. The customer can retry from their account.

Refunds via PesaPal

Refunds are initiated from the admin panel (Orders → Refund). PesaPal processes refunds back to the original payment method:

  • M-Pesa refunds: 1–2 business days
  • Card refunds: 3–7 business days

PesaPal account setup

Your store's PesaPal credentials (Consumer Key and Secret) are configured during store setup. If PesaPal stops working (e.g. credentials expire or your PesaPal account is suspended), contact your platform administrator to update the credentials.

🔥Important

Never share your PesaPal Consumer Secret. It's stored in your server environment and should never appear in frontend code or public repositories.

Related Articles
PesaPal Payments — Sokobuni Learn