GAZ-230 update the src/utils/make-payment.sh script to verify the transfer#95
Conversation
|
@Ismael-Sallami this needs to be updated to current Dev to be considered for this release. |
…script-to-verify-the-transfer
|
@DavidH-1 done! |
tdaly61
left a comment
There was a problem hiding this comment.
hi @Ismael-Sallami , hey I have looked at this now and tested it out and you definitely get the idea however I think it needs just a little work before putting this into the dev branch. I would look forward to including this in the upcoming release of gazelle if you are able to make the subsequent enhancements. I will go and update the ticket , please go look there. cheers and thanks
…s for verification
…verify-the-transfer' of github.com:Ismael-Sallami/mifos-gazelle into GAZ-230-update-the-src-utils-make-payment-sh-script-to-verify-the-transfer
…s for verification
|
hi @tdaly61 , I have updated the script based on your feedback. I implemented the retry logic using global variables, added the -v flag, if the verification fails, the script now reports the error and exits with status 2 (status>1), and I have ensured the output style. The flag -v was busy by debug, so I changed it for V, limiting myself to your specifications. ;) |
…script-to-verify-the-transfer
…script-to-verify-the-transfer
…script-to-verify-the-transfer
|
CLA Check = Passed |
…script-to-verify-the-transfer
…script-to-verify-the-transfer
…script-to-verify-the-transfer
The current make-payment.sh script serves as a quick way to demonstrate a transfer, but it lacks end-to-end verification. It currently relies solely on the HTTP 200 OK response from the Payment Hub (PHEE). Since the transaction flows asynchronously through vNext to the Core Banking system (Mifos X), a successful request to PHEE does not guarantee that the ledger was updated.
This PR enhances the script to query the Mifos X API directly after the payment is initiated. It verifies that the transaction has actually settled and that balances have been updated for both the Payer and the Payee.
Changes Proposed:
Dependency Check: Added a check to ensure jq is installed, as it is required to parse the JSON responses from the Mifos API.
Account Lookup: Implemented logic to resolve the MSISDN (phone number) to the underlying internal Savings Account ID in Mifos X.
Polling Logic: Added a retry loop (polling mechanism) that queries the account summary every few seconds. This handles the asynchronous nature of the system, waiting for the transaction to reflect in the database.
Verification: The script now compares the latest transaction amount against the requested transfer amount and prints the final account balances.
Verification & Testing:
Before the change: The script would exit immediately after the transfer request, providing no details on the actual account status.
After the change: The script now waits for the transaction to complete and confirms the final state in the core banking system.
Dependencies: