Mobile Money Payments Integration
In response to the growing demand for mobile money payment solutions among merchants in the region, our platform offers comprehensive guidance on integrating mobile money payments into e-commerce websites. This section serves as your roadmap to seamlessly incorporate mobile money payment functionality into your online business operations. By integrating mobile money payment options, merchants can cater to a wider audience, tap into new market segments, and enhance the overall customer experience.
Guided Integration Process
Our documentation provides a step-by-step guide to assist merchants in effortlessly integrating mobile money payments into their e-commerce platforms. From initial setup to testing and deployment, we offer comprehensive instructions and best practices to ensure a smooth and successful integration process.
Key Features and Benefits
-
Expanded Customer Reach: Reach customers who prefer mobile money payment methods, enhancing accessibility and convenience for a diverse customer base.
-
Secure Transactions: Benefit from our secure payment infrastructure, ensuring the confidentiality and integrity of all mobile money transactions.
-
Enhanced User Experience: Provide a seamless payment experience for your customers, fostering trust and loyalty through convenient payment options.
API
Request URL
{{base_url}}/api/create-order
Request
| Field | Description | Type | Field |
|---|---|---|---|
code | Type of payment request. 101 for Mobile Push and 102 for Card Payments. | int | Required |
merchant_order_id | Unique identifier for the merchant's order. | string | Required |
amount | Total amount of the transaction in the specified currency. Minimum is 1000 TZS | int | Required |
currency | Currency code for the transaction (e.g., TZS for Tanzanian Shilling). | string | Required |
merchant_cancel_url | URL to redirect the customer to in case of cancellation (not used). start with https | valid url string | Optional |
merchant_redirect_url | URL to redirect the customer to upon successful payment (not used). start with https | valid url string | Optional |
metadata | Additional metadata associated with the transaction, provided as key-value pairs. | Json | Optional |
merchant_webhook | URL of the web-hook endpoint on the merchant's server to receive transaction updates. (mandatory) | valid url string | Required |
product_count | Number of products included in the transaction. | int | Required |
customer_email | Email address of the customer making the payment. | valid email string | Required |
customer_name | Name of the customer making the payment. | string | Required |
customer_phone | Phone number of the customer making the payment. | string | Required |
customer_userid | Unique identifier for the customer within the merchant's system. | string/int maxLength =100 | Required |
shouldFail | Indicates whether the transaction should be processed and succeed or not values can be (true) or (false). default is false. This is only important when you set your environment to Playground in your Dashboard. | bool | Optional |
Sending this request initiates a mobile money payment process, where the customer receives a PUSH notification and is prompted to provide their PIN for verification. Upon completion, transaction updates are sent to the provided webhook URL.
Ensure that you provide a valid web-hook URL to enable communication with your server.
Sample Request
{
"code": 101, // 101 For Mobile Payments
"merchant_order_id": "5",
"amount": 10000,
"currency" : "TZS",
"merchant_cancel_url": "https://www.yoursite.com/cancel",
"merchant_redirect_url": "https://www.yoursite.com/success",
"metadata": {
"anykey": "anyvalue",
"another_anyKey": "another_anyvalue"
},
"merchant_webhook": "https://webhook.site/#!/2250a4d1-a6e2-4ac8-97b2-26dda65da334", // mandatory
"product_count": "1",
"customer_email": "[email protected]",
"customer_name": "Johnny Mnemonic",
"customer_phone": "255789000111",
"customer_userid": 2,
"shouldFail" : false
}
Sample Response
Upon processing a payment request, the payment gateway generates a response indicating the status and outcome of the transaction. The response structure varies depending on whether the transaction was successful or failed.
Successful Payment Response
For successful payments, the response includes the following details:
- Status :
203 - Order ID: Identifier for the merchant's order.
- Result: Indicates the status of the transaction (e.g., "dispatched").
- Message: Confirmation message indicating that the payment was processed successfully.
- Metadata: Additional metadata associated with the transaction.
{
"order_id": "3",
"status": 203,
"result": "dispatched",
"message": "Payment was processed successfully",
"metadata": { "anykey": "anyvalue", "another_anyKey": "another_anyvalue" }
}
Failed Transaction
In case of a failed transaction, the response status code is set to 495. Details regarding the failure may be included in the response message.
Note: As the response is encrypted, ensure to decode it before processing the data. Refer to the provided decryption method in the documentation.
Summary
Important
After 30 minutes if the transaction is not completed, it will be automatically cancelled by the system.