VunaPOS

VunaPOS

Open in ChatGPT
Ask ChatGPT about this page
Open in Claude
Ask Claude about this page

Mpesa Integration

VunaPOS integrates M-Pesa directly into the checkout flow, allowing cashiers to collect and verify customer payments without leaving the POS.

The integration supports:

  • STK Push
  • C2B transaction lookup
  • Payment verification
  • Linking verified payments to the current sale
  • Preventing checkout before gateway payment is confirmed

Prerequisite

M-Pesa payment support requires the navari_ke_payments application to be installed and configured on the same site.

Without navari_ke_payments, VunaPOS can still use standard ERPNext Modes of Payment, but the M-Pesa STK Push and C2B flows will not be available.

STK Push

Explain the flow:

  1. Open Checkout.
  2. Select the M-Pesa payment mode.
  3. Choose STK Push.
  4. Enter the customer’s phone number.
  5. Click Send STK.
  6. Ask the customer to approve the prompt.
  7. Click Check.
  8. Confirm that the payment was received.
  9. Click Use Payment.
  10. Complete the sale.

C2B Payments

Explain the flow:

  1. Open Checkout.
  2. Select the M-Pesa payment mode.
  3. Choose C2B Payment.
  4. Search using customer name, phone number, or transaction ID.
  5. Select the matching payment.
  6. Confirm amount and status.
  7. Click Use Payment.
  8. Complete the sale.

Payment Verification

When a Mode of Payment is linked to a payment gateway, VunaPOS prevents checkout until that gateway flow is completed.

For M-Pesa, this means either:

  • the STK Push completes successfully, or
  • the cashier selects a valid C2B transaction

Until one of those actions is completed, the sale cannot be submitted.

A sent STK request alone is not enough. The payment must complete successfully before it can be used.

For C2B payments, the cashier must select the transaction that should be applied to the sale.

ERPNext Invoice Handling

After the M-Pesa payment is completed or selected, VunaPOS creates the required Sales Invoice or POS Invoice as normal.

The M-Pesa transaction ID is stored on the corresponding Mode of Payment row for reference.

VunaPOS does not create any additional ERPNext accounting document specifically for the gateway transaction.

Last updated 1 month ago
Was this helpful?
Thanks!