Next.js App Router

M-Pesa Test Bench

Use this tiny app to understand the payment lifecycle: initialize a customer payment, receive the callback, inspect local history, and prepare for status queries and reversals.

What this app shows

Frontend form in the App Router
Server-side route handlers under /api
C2B initialization with your M-Pesa credentials
Callback capture and local transaction history

Current feature coverage

C2B payment: wired
Callback listener: wired
Status query: scaffolded
Reversal: scaffolded