Title: Attesta Payments for M-Pesa
Author: abelcainrodriguezrodriguez
Published: <strong>December 5, 2026</strong>
Last modified: December 5, 2026

---

Search plugins

![](https://ps.w.org/attesta-payments-for-m-pesa/assets/banner-772x250.png?rev=3845918)

![](https://ps.w.org/attesta-payments-for-m-pesa/assets/icon.svg?rev=3845864)

# Attesta Payments for M-Pesa

 By [abelcainrodriguezrodriguez](https://profiles.wordpress.org/abelcainrodriguezrodriguez/)

[Download](https://downloads.wordpress.org/plugin/attesta-payments-for-m-pesa.1.0.1.zip)

 * [Details](https://wordpress.org/plugins/attesta-payments-for-m-pesa/#description)
 * [Reviews](https://wordpress.org/plugins/attesta-payments-for-m-pesa/#reviews)
 *  [Installation](https://wordpress.org/plugins/attesta-payments-for-m-pesa/#installation)
 * [Development](https://wordpress.org/plugins/attesta-payments-for-m-pesa/#developers)

 [Support](https://wordpress.org/support/plugin/attesta-payments-for-m-pesa/)

## Description

Attesta adds M-Pesa (STK Push / Lipa na M-Pesa) as a WooCommerce payment method,
and reconciles every payment automatically so a missed callback never means a lost
sale.

**How Attesta handles payments:**

 * Orders are marked paid only against a verified M-Pesa receipt number and a matching
   amount, not merely because M-Pesa accepted the request.
 * Automatic reconciliation: if the payment callback never arrives, Attesta queries
   M-Pesa directly until it gets a definitive answer.
 * Setup validation before you go live: credentials, callback reachability, permalinks,
   and background processing are all checked up front.
 * Your Daraja API credentials never leave your own site and are encrypted at rest.
 * Kenya Data Protection Act (2019) aware: phone numbers are hashed/masked, never
   stored in the clear.

#### Free vs Pro

**Free (this plugin, forever):**

 * STK Push (Lipa na M-Pesa) with Pay Bill and Till.
 * Payments confirmed against a real M-Pesa receipt and matching amount, never on“
   request accepted”.
 * Automatic reconciliation: if the callback never arrives, Attesta queries M-Pesa
   until it gets a definitive answer.
 * Payment recovery when STK fails: the Pay Bill and reference are shown, and the
   manual payment is matched automatically.
 * Setup validation before going live (credentials, callback reachability, permalinks,
   background processing).
 * Transactions ledger with the M-Pesa receipt stored.
 * Daraja credentials encrypted in the merchant’s own database.
 * One shortcode, one site.

**Pro:**

 * Payment links: get paid over WhatsApp, SMS or an invoice, with no online store.
 * C2B account references per customer, tenant or student.
 * Standalone cash dashboard, with no WooCommerce required.
 * Multiple shortcodes or branches in one installation.

#### Requirements

 * A Safaricom Daraja account and a Paybill or Till number, registered in **your
   own business’s name** (M-Pesa integrations must be registered to the business
   actually receiving the funds. This is a Central Bank of Kenya compliance requirement,
   not a restriction Attesta invents).
 * WooCommerce, for the checkout payment method. Attesta activates and runs without
   it, but the payment method it adds is a WooCommerce one, so taking payments at
   a store checkout needs WooCommerce installed.
 * Pretty permalinks. M-Pesa cannot reach the confirmation URL with permalinks set
   to Plain, and the setup check will tell you so.

### External services

Attesta connects to one external service: the **Safaricom Daraja API** (M-Pesa),
operated by Safaricom PLC. Without it the plugin cannot take M-Pesa payments. Requests
go to `https://sandbox.safaricom.co.ke` in Sandbox mode and to `https://api.safaricom.
co.ke` in Production mode, using the merchant’s own Daraja credentials. Nothing 
is sent to Honest Plugins or to any other party.

What is sent, and when:

 * **Access token request**: your Daraja Consumer Key and Consumer Secret. Sent 
   before any of the calls below, and when you run the setup check.
 * **STK Push (payment request)**: your shortcode, a password derived from your 
   passkey, the amount, the customer’s phone number, the order reference, a short
   description and your site’s callback URL. Sent when a customer places an order
   with M-Pesa as the payment method.
 * **STK Push query (reconciliation)**: your shortcode, the password derived from
   your passkey, and the ID that M-Pesa gave the pending payment. Sent automatically
   in the background while a payment is still pending and its callback has not arrived.
 * **C2B URL registration**: your shortcode and your site’s confirmation and validation
   URLs. Sent only when you press the button to register them in Attesta  Settings.

Safaricom then sends the payment result back to your site’s callback URL.

Safaricom Daraja terms and conditions: https://developer.safaricom.co.ke/terms
 
Safaricom data privacy statement: https://www.safaricom.co.ke/dataprivacystatement/

## Screenshots

[⌊One screen for the whole setup: environment, Pay Bill or Till, Daraja credentials,
and a setup check that tells you what is wrong before you go live.⌉⌊One screen for
the whole setup: environment, Pay Bill or Till, Daraja credentials, and a setup 
check that tells you what is wrong before you go live.⌉[

One screen for the whole setup: environment, Pay Bill or Till, Daraja credentials,
and a setup check that tells you what is wrong before you go live.

[⌊The payment method inside WooCommerce. An order is marked paid only once a real
M-Pesa receipt with a matching amount comes back.⌉⌊The payment method inside WooCommerce.
An order is marked paid only once a real M-Pesa receipt with a matching amount comes
back.⌉[

The payment method inside WooCommerce. An order is marked paid only once a real 
M-Pesa receipt with a matching amount comes back.

[⌊Your customer's checkout. They type the M-Pesa number, the prompt arrives on their
phone, and they pay without leaving the shop.⌉⌊Your customer's checkout. They type
the M-Pesa number, the prompt arrives on their phone, and they pay without leaving
the shop.⌉[

Your customer’s checkout. They type the M-Pesa number, the prompt arrives on their
phone, and they pay without leaving the shop.

## Installation

 1. Install and activate WooCommerce, if you want to take payments at a store checkout.
 2. Upload and activate Attesta.
 3. Go to Attesta  Settings and enter your Daraja Consumer Key, Consumer Secret, Passkey
    and Shortcode.
 4. Run the built-in setup check before switching from Sandbox to Production.
 5. Switch M-Pesa on at your checkout: press “Show M-Pesa at checkout” on Attesta  
    Settings, or enable it under WooCommerce  Settings  Payments.

## FAQ

### Does Attesta ever hold my customers’ money?

No. Attesta talks directly to Safaricom’s Daraja API using your own credentials.
Funds move directly between your customer and your Paybill/Till; nothing passes 
through Attesta or Honest Plugins.

### Why does my order stay “On hold” after the customer pays?

The order moves to Processing/Completed automatically once Attesta confirms a real
M-Pesa receipt, either via the instant callback, or via the automatic reconciliation
check if the callback is delayed. This is deliberate: it’s what prevents an order
being marked paid on a request that was merely _accepted_, not completed.

## Reviews

There are no reviews for this plugin.

## Contributors & Developers

“Attesta Payments for M-Pesa” is open source software. The following people have
contributed to this plugin.

Contributors

 *   [ abelcainrodriguezrodriguez ](https://profiles.wordpress.org/abelcainrodriguezrodriguez/)

[Translate “Attesta Payments for M-Pesa” into your language.](https://translate.wordpress.org/projects/wp-plugins/attesta-payments-for-m-pesa)

### Interested in development?

[Browse the code](https://plugins.trac.wordpress.org/browser/attesta-payments-for-m-pesa/),
check out the [SVN repository](https://plugins.svn.wordpress.org/attesta-payments-for-m-pesa/),
or subscribe to the [development log](https://plugins.trac.wordpress.org/log/attesta-payments-for-m-pesa/)
by [RSS](https://plugins.trac.wordpress.org/log/attesta-payments-for-m-pesa/?limit=100&mode=stop_on_copy&format=rss).

## Changelog

#### 1.0.1

This release only opens doors for add-ons. On its own the plugin behaves exactly
as 1.0.0 did.

 * Add-ons can stop a payment before the M-Pesa prompt is sent, through the new `
   attesta_pre_stk_for_order` filter.
 * Refund hooks: the gateway now answers WooCommerce’s refund question and exposes`
   attesta_gateway_supports_refunds` and `attesta_process_refund`. Without an add-
   on, refunds stay switched off and WooCommerce shows no automatic refund button,
   the same as before.
 * Daraja requests made by add-ons can set their own timeout, so a check that runs
   while the customer waits at the checkout does not hold the page for twenty seconds.

#### 1.0.0

 * First release.
 * M-Pesa (Lipa na M-Pesa / STK Push) as a WooCommerce payment method, for both 
   Pay Bill and Till accounts.
 * Orders are marked paid only against a verified M-Pesa receipt and a matching 
   amount.
 * The customer types the M-Pesa number that should get the payment prompt, in both
   the classic and the block checkout, prefilled from the billing phone.
 * M-Pesa is offered at checkout only once the Daraja credentials are in place, 
   and Attesta  Settings tells you whether customers can see it, with a button to
   switch it on.
 * Automatic reconciliation when the payment callback does not arrive.
 * If M-Pesa still has not confirmed a payment after about 30 hours, the order gets
   a note saying what to check in your M-Pesa statement, and an admin notice points
   you to it.
 * Manual-payment recovery: the Pay Bill and reference are shown when the STK prompt
   fails, and the payment is matched automatically.
 * Internal: the STK Push request for an order and the settling of an unmatched 
   payment are now reusable functions, with the checkout behaving exactly as before.
 * Setup check for credentials, callback reachability, permalinks and background
   processing.
 * C2B callback URL registration, with safeguards for the one-time nature of the
   call in production.
 * Transactions ledger with the M-Pesa receipt stored, shown in order notes, customer
   emails and the admin order screen.
 * Diagnostics written to the WooCommerce log, plus a downloadable support bundle
   containing no credentials and no personal data.
 * Attesta section in WooCommerce  Status.
 * Compatible with High-Performance Order Storage and the block-based checkout.

## Meta

 *  Version **1.0.1**
 *  Last updated **9 hours ago**
 *  Active installations **Fewer than 10**
 *  WordPress version ** 6.4 or higher **
 *  Tested up to **7.2**
 *  PHP version ** 7.4 or higher **
 * Tags
 * [Kenya](https://wordpress.org/plugins/tags/kenya/)[M-PESA](https://wordpress.org/plugins/tags/m-pesa/)
   [MPESA](https://wordpress.org/plugins/tags/mpesa/)[payments](https://wordpress.org/plugins/tags/payments/)
   [woocommerce](https://wordpress.org/plugins/tags/woocommerce/)
 *  [Advanced View](https://wordpress.org/plugins/attesta-payments-for-m-pesa/advanced/)

## Ratings

No reviews have been submitted yet.

[Your review](https://wordpress.org/support/plugin/attesta-payments-for-m-pesa/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/attesta-payments-for-m-pesa/reviews/)

## Contributors

 *   [ abelcainrodriguezrodriguez ](https://profiles.wordpress.org/abelcainrodriguezrodriguez/)

## Support

Got something to say? Need help?

 [View support forum](https://wordpress.org/support/plugin/attesta-payments-for-m-pesa/)