• 3 December 2023
  • 2 replies

Hello all,

Below are a few challenging cases I encountered while in the production. Any help in any way will be of great help to many developers. 



I successully make a request to pay but I have a case where the user enters

1.1) a wrong pin.

1.2) a pin not exactly 5 digits as required. 

The end point does not return any error or response. 

Normally I would need to get that error or response and do something server end.

How do I get around a case like this? Or is there a way to get that error message? 

I have already used    getRequestToPay/{X-referenceId} and it does not return anything in this case of a wrong pin.



When a user cancels a transaction, I noticed that it still remains in status PENDING and when a user uses USSD, they can access the requestToPay awaiting their confirmation.

I do not want this to happen. When a user cancels, the request should indeed be ended and not accessible any other way. how do i implement this.




How do i reduce the timeout time for requestToPay in the momo APIs.




Best answer by crankluga 5 December 2023, 10:59

View original

2 replies

Userlevel 2

1→ the endpoint sends back a response of TRANSACTION FAILED with indication of  INVALID AUTH after the session time out, because the user has 3 chances to enter the correct PIN.
2→ Is answered already in 1 that each transaction is limited by a time span. But when the user cancels the transaction and your call back or GetRequestToPayStatus endpoint is invoked, you get the feedback instantly
3→ That is controlled by MTN and the time out is relevant to give the customer enough time to respond.

Thank you Luga, that was helpful.

I wish we had a way of reducing the timeout in some cases.