Skip to content
This repository was archived by the owner on May 23, 2025. It is now read-only.

[DEV] Added OAuth call to MPesa and Account Balance Query#85

Open
SubhamPramanik wants to merge 9 commits intoopenMF:masterfrom
SubhamPramanik:mpesa_back
Open

[DEV] Added OAuth call to MPesa and Account Balance Query#85
SubhamPramanik wants to merge 9 commits intoopenMF:masterfrom
SubhamPramanik:mpesa_back

Conversation

@SubhamPramanik
Copy link

This PR consists of:

  1. OAuth call to MPesa for access_token
  2. Account Balance fetch transaction

TODO:

  1. Make appropriate changes to the application.yml file
  2. Need to add consumer endpoint for account balance

exchange.setProperty("tokenResponseCode", "200");
exchange.setProperty("access_token", response.getAccess_token());
} else {
exchange.setProperty("tokenResponseCode", String.valueOf(responseEntity.getStatusCode().value()));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there an error response JSON?

Copy link
Author

@SubhamPramanik SubhamPramanik Apr 21, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, there are error codes in Response JSON.
{
"requestId": "18641-15432775-1",
"errorCode": "400.008.01",
"errorMessage": "Invalid Authentication passed"
}

- name: tn04
port: 48889
- name: quotes #post notification
base: interoperation/quotes
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dead code.

- name: parties
base: fineract-provider/api/v1/interoperation/parties
- name: quotes
base: fineract-provider/api/v1/interoperation/quotes
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not required.

- name: requests
base: fineract-provider/api/v1/interoperation/requests
- name: parties
base: fineract-provider/api/v1/interoperation/parties
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please evaluate if this is required or not.

base: mpesa/accountbalance/v1/query
bindings: #ott -> hub
- name: binding-basic-settings
host: http://0.0.0.0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there IP whitelisting on Safaricom side? If this has to be a callback and you need an IP independent of Mifos / Fineract SSL, we can provide you IP of the reverse proxy server we have.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whitelisting is done before every transaction through Request URL, as mentioned in my proposal. So, for C2B payments, we'll be calling an API to register our IPs for callbacks and then call APIs for the transaction.

;

from("direct:commitTransaction")
.id("commitTransaction")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the purpose of this in this particular pull request?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change the naming if this caters to balance check.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants