# OpenG2P Program Payment: Simple Mpesa Payment Manager

### Module name

g2p\_payment\_simple\_mpesa

### Module title

OpenG2P Program Payment: Simple Mpesa Payment Manager

### Technology base

Odoo

### Functionality

* This Module specifically designed to integrate with Simple Mpesa payment services.
* It enables users to create and manage payment batches for disbursements via Mpesa.
* **Authentication:** Acquires an access token from Simple Mpesa using provided credentials.
* **Payment Processing:** Iterates through payments within batches:
  * Constructs payment data for Simple Mpesa API calls.
  * Uses the access token for authentication.
  * Sends payment requests to the payment endpoint.
  * Handles responses, updating payment statuses accordingly.
  * Logs errors and sends notifications in case of failures.

### Dependencies

* base
* g2p\_registry\_base
* g2p\_programs

### Design notes

### User interface

**menu** -> configuration -> Simple Mpesa Payment Managers

program -> configuration -> payment manager -> Simple Mpesa Payment Manager

### Configuration

* **`auth_endpoint_url`:** The URL for Simple Mpesa 's authentication endpoint.
* **`payment_endpoint_url`:** The URL for Simple Mpesa 's payment execution endpoint.
* **`api_timeout`:** The timeout duration (in seconds) for API calls.
* **`username`:** The Simple Mpesa account username.
* **`password`:** The Simple Mpesa account password.
* **`payee_id_type`:** Specifies the type of ID used for payee identification (bank account, phone, email, or registrant ID).
* **`customer_type`:** The customer type to be used in payment requests (defaults to "subscriber").

### Source code

<https://github.com/OpenG2P/openg2p-program/tree/15.0-develop/g2p_payment_simple_mpesa>

### Installation

Standard Odoo package installation


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.openg2p.org/1.3/pbms/developer-zone/odoo-modules/openg2p-program-payment-simple-mpesa-payment-manager.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
