| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
Discuss (mail)
|
| Lines of code | 584 |
| Technical Name |
trace_payment_mpesa |
| License | OPL-1 |
M-Pesa Unified Payment Gateway
Safaricom Daraja API Integration for Website & Portal
The complete solution for Kenyan businesses. Automate M-Pesa Express (STK Push) and C2B payments directly within your Odoo Ecommerce, Sales Quotations, and Customer Portal.
Core Features
M-Pesa Express
Instant STK Push prompts for Website checkout and Customer Portal invoices.
Smart Provider Filter
Only shows M-Pesa if the billing phone is a valid Safaricom number.
C2B Fallback
Gracefully falls back to manual Paybill entry if Express fails or is preferred.
Seamless Checkout Experience
1. Enforced Phone Validation
Ensures every transaction is successful by requiring a phone number and validating its format before the payment provider list even appears.
2. Instant STK Push
One-click payment. Customers receive a secure prompt on their phone to enter their M-Pesa PIN instantly upon order confirmation.
Developer-Friendly Configuration
- Register C2B Validation & Confirmation URLs with a single click.
- Full support for Daraja 3.0 Credentials (Shortcode, Passkey, etc).
- Instant Payment Notifications (IPN) via Daraja Webhooks
M-Pesa Payment Gateway - Setup & User Guide
Overview
This module integrates Safaricom M-Pesa (Daraja API) directly into your Odoo ecommerce and portal. It supports M-Pesa Express (STK Push) for instant checkout and C2B for manual fallback.
Configuration
1. API Credentials
Navigate to :menuselection:`Invoicing --> Configuration --> Payment Providers` and select M-Pesa. Enter your Shortcode, Consumer Key, Consumer Secret, and Passkey.
2. Registering URLs
To receive payment notifications, you must register your endpoints with Safaricom. Simply click the Register URLs button on the provider form.
Tip
Ensure your Odoo instance is reachable via a public HTTPS URL.
Checkout Experience
1. Smart Phone Validation
The module automatically makes the Phone field required on the billing address form. M-Pesa is only listed as an option if a valid Safaricom prefix is detected.
The "M-Pesa" payment option only appears if a valid Safaricom/M-Pesa number is entered.
2. M-Pesa Express (STK Push) With C2B Fallback
When the customer clicks Pay Now, they receive an instant STK prompt on their mobile device. If the customer prefers manual payment, the portal displays the Paybill instructions.
Note
C2B Fallback only works for shortcodes of the type paybill.
Support & Troubleshooting
- Pending Payments: If a payment stays "Pending," check the Payment Transactions log to see Safaricom's response codes.
- URL Failures: Ensure your SSL certificate is valid; Safaricom will not send data to insecure (HTTP) or self-signed (HTTPS) endpoints.
Note
For further assistance, contact our technical support team via the Odoo App Store "Support" button.
Odoo Proprietary License v1.0 This software and associated files (the "Software") may only be used (executed, modified, executed after modifications) if you have purchased a valid license from the authors, typically via Odoo Apps, or if you have received a written agreement from the authors of the Software (see the COPYRIGHT file). You may develop Odoo modules that use the Software as a library (typically by depending on it, importing it and using its resources), but without copying any source code or material from the Software. You may distribute those modules under the license of your choice, provided that this license is compatible with the terms of the Odoo Proprietary License (For example: LGPL, MIT, or proprietary licenses similar to this one). It is forbidden to publish, distribute, sublicense, or sell copies of the Software or modified copies of the Software. The above copyright notice and this permission notice must be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Please log in to comment on this module