{"id":414659,"date":"2026-12-05T08:50:51","date_gmt":"2026-12-05T08:50:51","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/attesta-m-pesa-kenya-payments-for-woocommerce\/"},"modified":"2026-12-05T20:15:21","modified_gmt":"2026-12-05T20:15:21","slug":"attesta-payments-for-m-pesa","status":"publish","type":"plugin","link":"https:\/\/wordpress.org\/plugins\/attesta-payments-for-m-pesa\/","author":23538370,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"1.0.1","stable_tag":"1.0.1","tested":"7.2","requires":"6.4","requires_php":"7.4","requires_plugins":null,"header_name":"Attesta Payments for M-Pesa","header_author":"Honest Plugins","header_description":"M-Pesa payments for WooCommerce: STK Push at checkout, confirmed against a real M-Pesa receipt, with automatic reconciliation and a Pay Bill fallback when the prompt fails.","last_updated":"2026-12-05 20:15:21","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"https:\/\/honestplugins.github.io\/attesta.html","header_author_uri":"https:\/\/honestplugins.github.io\/","rating":0,"author_block_rating":0,"active_installs":0,"downloads":186,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":{"1.0.0":{"tag":"1.0.0","author":"abelcainrodriguezrodriguez","date":"2026-12-05 09:26:20","revision":3845918},"1.0.1":{"tag":"1.0.1","author":"abelcainrodriguezrodriguez","date":"2026-12-05 20:15:21","revision":3846807}},"upgrade_notice":[],"ratings":[],"assets_icons":{"icon-128x128.png":{"filename":"icon-128x128.png","revision":3845864,"resolution":"128x128","location":"assets","locale":"","width":128,"height":128},"icon-256x256.png":{"filename":"icon-256x256.png","revision":3845864,"resolution":"256x256","location":"assets","locale":"","width":256,"height":256},"icon.svg":{"filename":"icon.svg","revision":3845864,"resolution":false,"location":"assets","locale":false}},"assets_banners":{"banner-1544x500.png":{"filename":"banner-1544x500.png","revision":3845918,"resolution":"1544x500","location":"assets","locale":"","width":1544,"height":500},"banner-772x250.png":{"filename":"banner-772x250.png","revision":3845918,"resolution":"772x250","location":"assets","locale":"","width":772,"height":250}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0.0","1.0.1"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":3846060,"resolution":"1","location":"assets","locale":"","width":1280,"height":960},"screenshot-2.png":{"filename":"screenshot-2.png","revision":3846060,"resolution":"2","location":"assets","locale":"","width":1280,"height":960},"screenshot-3.png":{"filename":"screenshot-3.png","revision":3846060,"resolution":"3","location":"assets","locale":"","width":1280,"height":960}},"screenshots":{"1":"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.","2":"The payment method inside WooCommerce. An order is marked paid only once a real M-Pesa receipt with a matching amount comes back.","3":"Your customer's checkout. They type the M-Pesa number, the prompt arrives on their phone, and they pay without leaving the shop."}},"plugin_section":[],"plugin_tags":[37731,163268,3050,1887,286],"plugin_category":[45],"plugin_contributors":[275631],"plugin_business_model":[],"class_list":["post-414659","plugin","type-plugin","status-publish","hentry","plugin_tags-kenya","plugin_tags-m-pesa","plugin_tags-mpesa","plugin_tags-payments","plugin_tags-woocommerce","plugin_category-ecommerce","plugin_contributors-abelcainrodriguezrodriguez","plugin_committers-abelcainrodriguezrodriguez"],"banners":{"banner":"https:\/\/ps.w.org\/attesta-payments-for-m-pesa\/assets\/banner-772x250.png?rev=3845918","banner_2x":"https:\/\/ps.w.org\/attesta-payments-for-m-pesa\/assets\/banner-1544x500.png?rev=3845918","banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":"https:\/\/ps.w.org\/attesta-payments-for-m-pesa\/assets\/icon.svg?rev=3845864","icon":"https:\/\/ps.w.org\/attesta-payments-for-m-pesa\/assets\/icon.svg?rev=3845864","icon_2x":false,"generated":false},"screenshots":[{"src":"https:\/\/ps.w.org\/attesta-payments-for-m-pesa\/assets\/screenshot-1.png?rev=3846060","caption":"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."},{"src":"https:\/\/ps.w.org\/attesta-payments-for-m-pesa\/assets\/screenshot-2.png?rev=3846060","caption":"The payment method inside WooCommerce. An order is marked paid only once a real M-Pesa receipt with a matching amount comes back."},{"src":"https:\/\/ps.w.org\/attesta-payments-for-m-pesa\/assets\/screenshot-3.png?rev=3846060","caption":"Your customer's checkout. They type the M-Pesa number, the prompt arrives on their phone, and they pay without leaving the shop."}],"raw_content":"<!--section=description-->\n<p>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.<\/p>\n\n<p><strong>How Attesta handles payments:<\/strong><\/p>\n\n<ul>\n<li>Orders are marked paid only against a verified M-Pesa receipt number and a matching amount, not merely because M-Pesa accepted the request.<\/li>\n<li>Automatic reconciliation: if the payment callback never arrives, Attesta queries M-Pesa directly until it gets a definitive answer.<\/li>\n<li>Setup validation before you go live: credentials, callback reachability, permalinks, and background processing are all checked up front.<\/li>\n<li>Your Daraja API credentials never leave your own site and are encrypted at rest.<\/li>\n<li>Kenya Data Protection Act (2019) aware: phone numbers are hashed\/masked, never stored in the clear.<\/li>\n<\/ul>\n\n<h4>Free vs Pro<\/h4>\n\n<p><strong>Free (this plugin, forever):<\/strong><\/p>\n\n<ul>\n<li>STK Push (Lipa na M-Pesa) with Pay Bill and Till.<\/li>\n<li>Payments confirmed against a real M-Pesa receipt and matching amount, never on \"request accepted\".<\/li>\n<li>Automatic reconciliation: if the callback never arrives, Attesta queries M-Pesa until it gets a definitive answer.<\/li>\n<li>Payment recovery when STK fails: the Pay Bill and reference are shown, and the manual payment is matched automatically.<\/li>\n<li>Setup validation before going live (credentials, callback reachability, permalinks, background processing).<\/li>\n<li>Transactions ledger with the M-Pesa receipt stored.<\/li>\n<li>Daraja credentials encrypted in the merchant's own database.<\/li>\n<li>One shortcode, one site.<\/li>\n<\/ul>\n\n<p><strong>Pro:<\/strong><\/p>\n\n<ul>\n<li>Payment links: get paid over WhatsApp, SMS or an invoice, with no online store.<\/li>\n<li>C2B account references per customer, tenant or student.<\/li>\n<li>Standalone cash dashboard, with no WooCommerce required.<\/li>\n<li>Multiple shortcodes or branches in one installation.<\/li>\n<\/ul>\n\n<h4>Requirements<\/h4>\n\n<ul>\n<li>A Safaricom Daraja account and a Paybill or Till number, registered in <strong>your own business's name<\/strong> (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).<\/li>\n<li>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.<\/li>\n<li>Pretty permalinks. M-Pesa cannot reach the confirmation URL with permalinks set to Plain, and the setup check will tell you so.<\/li>\n<\/ul>\n\n<h3>External services<\/h3>\n\n<p>Attesta connects to one external service: the <strong>Safaricom Daraja API<\/strong> (M-Pesa), operated by Safaricom PLC. Without it the plugin cannot take M-Pesa payments. Requests go to <code>https:\/\/sandbox.safaricom.co.ke<\/code> in Sandbox mode and to <code>https:\/\/api.safaricom.co.ke<\/code> in Production mode, using the merchant's own Daraja credentials. Nothing is sent to Honest Plugins or to any other party.<\/p>\n\n<p>What is sent, and when:<\/p>\n\n<ul>\n<li><strong>Access token request<\/strong>: your Daraja Consumer Key and Consumer Secret. Sent before any of the calls below, and when you run the setup check.<\/li>\n<li><strong>STK Push (payment request)<\/strong>: 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.<\/li>\n<li><strong>STK Push query (reconciliation)<\/strong>: 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.<\/li>\n<li><strong>C2B URL registration<\/strong>: your shortcode and your site's confirmation and validation URLs. Sent only when you press the button to register them in Attesta \u2192 Settings.<\/li>\n<\/ul>\n\n<p>Safaricom then sends the payment result back to your site's callback URL.<\/p>\n\n<p>Safaricom Daraja terms and conditions: https:\/\/developer.safaricom.co.ke\/terms\nSafaricom data privacy statement: https:\/\/www.safaricom.co.ke\/dataprivacystatement\/<\/p>\n\n<!--section=installation-->\n<ol>\n<li>Install and activate WooCommerce, if you want to take payments at a store checkout.<\/li>\n<li>Upload and activate Attesta.<\/li>\n<li>Go to Attesta \u2192 Settings and enter your Daraja Consumer Key, Consumer Secret, Passkey and Shortcode.<\/li>\n<li>Run the built-in setup check before switching from Sandbox to Production.<\/li>\n<li>Switch M-Pesa on at your checkout: press \"Show M-Pesa at checkout\" on Attesta \u2192 Settings, or enable it under WooCommerce \u2192 Settings \u2192 Payments.<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt id=\"does%20attesta%20ever%20hold%20my%20customers%27%20money%3F\"><h3>Does Attesta ever hold my customers' money?<\/h3><\/dt>\n<dd><p>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.<\/p><\/dd>\n<dt id=\"why%20does%20my%20order%20stay%20%22on%20hold%22%20after%20the%20customer%20pays%3F\"><h3>Why does my order stay \"On hold\" after the customer pays?<\/h3><\/dt>\n<dd><p>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 <em>accepted<\/em>, not completed.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>1.0.1<\/h4>\n\n<p>This release only opens doors for add-ons. On its own the plugin behaves exactly as 1.0.0 did.<\/p>\n\n<ul>\n<li>Add-ons can stop a payment before the M-Pesa prompt is sent, through the new <code>attesta_pre_stk_for_order<\/code> filter.<\/li>\n<li>Refund hooks: the gateway now answers WooCommerce's refund question and exposes <code>attesta_gateway_supports_refunds<\/code> and <code>attesta_process_refund<\/code>. Without an add-on, refunds stay switched off and WooCommerce shows no automatic refund button, the same as before.<\/li>\n<li>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.<\/li>\n<\/ul>\n\n<h4>1.0.0<\/h4>\n\n<ul>\n<li>First release.<\/li>\n<li>M-Pesa (Lipa na M-Pesa \/ STK Push) as a WooCommerce payment method, for both Pay Bill and Till accounts.<\/li>\n<li>Orders are marked paid only against a verified M-Pesa receipt and a matching amount.<\/li>\n<li>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.<\/li>\n<li>M-Pesa is offered at checkout only once the Daraja credentials are in place, and Attesta \u2192 Settings tells you whether customers can see it, with a button to switch it on.<\/li>\n<li>Automatic reconciliation when the payment callback does not arrive.<\/li>\n<li>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.<\/li>\n<li>Manual-payment recovery: the Pay Bill and reference are shown when the STK prompt fails, and the payment is matched automatically.<\/li>\n<li>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.<\/li>\n<li>Setup check for credentials, callback reachability, permalinks and background processing.<\/li>\n<li>C2B callback URL registration, with safeguards for the one-time nature of the call in production.<\/li>\n<li>Transactions ledger with the M-Pesa receipt stored, shown in order notes, customer emails and the admin order screen.<\/li>\n<li>Diagnostics written to the WooCommerce log, plus a downloadable support bundle containing no credentials and no personal data.<\/li>\n<li>Attesta section in WooCommerce \u2192 Status.<\/li>\n<li>Compatible with High-Performance Order Storage and the block-based checkout.<\/li>\n<\/ul>","raw_excerpt":"M-Pesa for WooCommerce. Orders are marked paid only once a genuine M-Pesa receipt is confirmed, never when the request is merely accepted.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/414659","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=414659"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/abelcainrodriguezrodriguez"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=414659"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=414659"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=414659"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=414659"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=414659"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=414659"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}