Migrating from Daraja
VectaPay isn’t a wrapper around Daraja that disappears once you outgrow it — it’s a separate platform that also happens to support M-Pesa. If you’re moving an existing raw-Daraja integration over, here’s what changes.
What you stop building yourself
| Raw Daraja | VectaPay | |
|---|---|---|
| OAuth token refresh | You manage it | Handled for you |
| Webhook retries | You build it | Automatic, with backoff — see Webhooks |
| Duplicate payment prevention | You build it | idempotencyKey on the request |
| Multiple providers | Separate integration per rail | One SDK — see Providers |
| Error handling | Safaricom’s ResultCode per callback | One FailureCode taxonomy across providers |
| Amount representation | Raw numbers, easy to mis-round | Money objects, minor units, no floats |
What maps to what
| Daraja concept | VectaPay equivalent |
|---|---|
POST /mpesa/stkpush/v1/processrequest | vectapay.payments.collect() |
CheckoutRequestID | checkoutRequestId on the response, still usable with statusByCheckoutRequestId() |
STK callback (ResultCode, CallbackMetadata) | payment.succeeded / payment.failed webhook, or payments.get() |
| B2C request | vectapay.payouts.send() — see Sending a Payout |
| Account balance query | vectapay.payouts.getBalance() |
What stays true either way
- The customer still gets a PIN prompt and still has to act on it — VectaPay doesn’t change that latency or UX, only what you have to build around it.
- Amount limits (KES 10–150,000 per STK push) are Safaricom’s, not VectaPay’s, and still apply.
- If you already have a Paybill/Till and Daraja app credentials, connect them as-is in Payment Methods — you don’t need new ones.
If you don’t have your own Daraja credentials
You don’t need to apply for one to accept M-Pesa payments — connecting a Paystack account instead lets you accept M-Pesa (and cards, and bank transfer) with Paystack as the merchant of record. See Paystack.
Testing while you migrate
Daraja’s sandbox test MSISDNs don’t apply here: you don’t configure a sandbox Paybill, and there is
no magic test number that auto-confirms. Instead, verify the Safaricom phone you’ll test with under
Developer → Testing (one KES 10 prompt), create a pk_test_ key, and send your normal
collect() call to that number. The prompt arrives on the real handset and the callback surfaces
as a normal signed webhook with environment: "test".
Everything your Daraja callback handler used to parse — ResultCode, CallbackMetadata — is
normalised into status and failure.code; keep the raw payload under providerDetails only for
support investigations. See Testing for the full flow and the rate limits.