What you need
- WordPress 6.0+ with WooCommerce 7.0+
- PHP 7.4+ on your hosting
- Store currency set to KES — the M-Pesa option only shows at checkout for Kenyan shillings
- A Fortpesa account with an approved payment channel
1
Install the plugin
Download the plugin ZIP,
then in WordPress go to Plugins → Add New → Upload Plugin, choose
fortpesa-for-woocommerce.zip, then Install Now and Activate.2
Get your Fortpesa details
In your Fortpesa dashboard, create an API key under Settings → API keys and
copy it right away — it is shown only once. Then note your Channel ID
from Channels (the Channel ID column on the channels list).
Keep the API key on your server only — never in client-side code. If you lose
the key, revoke it and create a new one.
3
Add the webhook
In Fortpesa go to Settings → Webhooks and add:Copy the
whsec_… secret it gives you — you will paste it into the plugin next.4
Configure the plugin
Go to WooCommerce → Settings → Payments → Fortpesa. Paste the API key,
Channel ID and webhook secret, tick Enable, and save.Optional: under Customer experience set your brand colour, business name and
receipt footer.
5
Test with a small order
Place a small real order (KES 10 or so) and approve the prompt on your phone.
The order should turn Processing and a receipt should appear.
Good to know
- The M-Pesa option only shows at checkout when the currency is KES and the API key and Channel ID are filled in.
- If an order looks stuck, open it and choose Check Fortpesa payment status from the order actions.
- Errors are logged under WooCommerce → Status → Logs (source
fortpesa). Turn on Debug log in the plugin settings for more detail. - Make sure your Fortpesa wallet has enough credit, otherwise payment requests
will fail with
402 INSUFFICIENT_CREDIT.