Shofy - eCommerce & Multivendor Marketplace Laravel Platform - Biggest Offer! Only $59 - Get it here!
M-Pesa Payment Gateway

M-Pesa Payment Gateway

Secure M-Pesa STK Push integration with real-time status polling.
$20.00 $40.00

Version

1.0.0

Botble Version

>= 7.0.0

License

MIT

M-Pesa Payment Gateway (STK Push & Real-Time Verification)

  • Category: Payments / Ecommerce
  • Version: 1.0.0

🚀 Overview

  • Automate your payments in Kenya with the ultimate M-Pesa integration for Botble CMS.
  • Stop asking customers to send screenshots of payments. This plugin integrates directly with Safaricom's Daraja API to provide a seamless, automated checkout experience. It triggers an STK Push (M-Pesa Express) to the customer's phone and listens for payment confirmation in Real-Time.
  • Unlike basic wrappers, this plugin includes a Smart Waiting Room that holds the customer's session, checks transaction status instantly, and redirects them to the success page the moment the PIN is entered—just like Uber or Jumia.

🔥 Key Features

1. Seamless STK Push (M-Pesa Express)

  • • Automatically detects the customer's phone number.
  • • Smart Number Formatting: Automatically fixes formats (converts 07xx, 01xx, or +254 to the required format).
  • • Triggers the M-Pesa PIN prompt immediately upon checkout.

2. 🟢 Real-Time Status Polling (The "Waiting Room")

• No Refresh Needed: The checkout page automatically detects when payment is completed. • Instant Feedback: o Success: Redirects to Order Receipt immediately. o Failure: Shows specific, human-friendly error messages (e.g., "Wrong PIN entered", "Insufficient Funds", "User Cancelled"). o Timeout: Handles cases where the user takes too long to reply.

3. 🛡️ Robust Transaction Recovery (Admin Re-Query)

• Never lose an order: If a callback is missed (due to internet issues or server downtime), the order is not lost. • One-Click Verification: Includes a "Re-query Safaricom" button in the Admin Order details. You can manually ask Safaricom if a transaction exists, and the system will auto-complete the order if paid.

4. 📦 Smart Order Management

• Automatically moves orders from "Incomplete" to "Processing" upon successful payment. • Records the official M-Pesa Receipt Number (e.g., TLA83...) directly into the transaction logs for easy reconciliation.

5. 🔒 Enterprise-Grade Security

• Plug-and-Play CSRF Handling: No need to edit core system files. • Token Caching: Implements smart caching for Auth Tokens to prevent firewall blocking (Incapsula) by Safaricom during high-traffic periods. • Secure Storage: API Credentials are encrypted in the database, not hardcoded in files.


📸 Screenshots

  1. Checkout: User enters phone number.
  2. The Waiting Room: Clean UI with spinner and countdown.
  3. Admin Settings: Native Botble UI for API keys.
  4. Transaction Details: Showing the "Re-query" button and M-Pesa Receipt code.

⚙️ Requirements

• Botble CMS (Ecommerce Module enabled). • SSL Certificate: Your site must be accessible via https:// (Safaricom requirement). • Daraja Account: Consumer Key, Secret, and Passkey from the Safaricom Developer Portal.


🛠️ Installation & Setup

  1. Upload the plugin zip file in Plugins > Add New.
  2. Activate "M-Pesa Payment Gateway".
  3. Go to Payments > Payment Methods and toggle M-Pesa ON.
  4. Enter your Consumer Key, Secret, Passkey, and Shortcode.
  5. Select Production (Live) or Sandbox (Test).
  6. Save settings. The system automatically handles the rest!

Ready to accept M-Pesa payments professionally? Install today!

Kindly log in to share your feedback on this plugin.
Ajayi Tolulope

Ajayi Tolulope

Can we build a payment plugin for payscribe.co you can reach me on Whatsapp 09025398760

Motion Media
Motion Media

Sure, why not, will do