MDriven Turnkey can easily expose services via REST: Exposing Ourselves as a REST Service
You can also consume REST services from other systems: Rest Services In MDriven
The case below is about integrations with MOMO (Mobile Money) open APIs, show case show MDriven consuming RESTful APIs from an external system.
Here we see a UI of all the major services from the collections end points for MOMO API endpoints.
- Authentication
- Request-To-Pay
- Transaction Status Inquiry
- Account Balance Inquiry
- User Information Query (KYC - Know-Your-Customer) Details
Authentication - POST
There are two credentials used in the open API
- Subscription Key
- API User and API Key for Oauth 2.0
The subscription key is used to give access to APIs in the API Manager portal. A user is assigned a subscription Key as and when the user subscribes to products in the API Manager Portal.
The API User and API Key are used to grant access to the wallet system in a specific country. API user and Key are wholly managed by the user through Partner Portal.
Users are allowed to generate/revoke API Keys through the Partner Portal.
However, on Sandbox Environment a Provisioning API is exposed to enable users to generate their own API User and API Key for testing purposes only.
The HEADERMINUS_Ocp_Apim_Subscription_Key: Ensures when the header parameter in this case is Ocp-Apim-Subscription-Key is formatted correctly using the HEADERMINUS prefix and introducing underscores(_) where there should have been (-).
Request-To-Pay - POST
Request to Pay service is used for requesting a payment from a customer (Payer). This can be used by e.g. an online web shop to request a payment from a customer. The customer is requested to approve the transaction on the customer client.
Below is the expected postman and MDriven implementation.
Transaction Status Inquiry - GET
This operation is used to get the status of the payment that has been made as in the above request-to-pay execution. The X-Reference-Id that was passed in the post is used as reference to the request as shown below.
Note: It is convenient to generate a new JWT token as in the authentication before executing any of the services in a production setting to avoid cases of failed execution due to token getting expired.
Account Balance Inquiry - GET
This operation is used to get your own account balance on the Mobile Money Wallet.
Below is how the request will look like.
The request start by generating a bearer token, then adding the relevant headers to the request and sending a GET request to the sandbox.
Basic User Information Inquiry - GET
At the time of the documentation, the service for getting basic user information was inaccessible, regardless the intention for which this documentation was intended has been achieved. You can proceed and run any other API based integrations where MDriven is consuming RESTful APIs from the incoming service.