Closed iamabeljoshua closed 6 years ago
Hey Abel, You arrived at the right fix. By guidelines, when you start a long-running process, you should give a visual hint to your users and ensure the process cannot be repeated until you get a response. Do you also show a processing dialog that shows them their click has registered?
Yea, when the user click on the pay-button on the app a progress dialog will be shown while the app generate an access_code on the background thread. After the Paystack transaction access_code has been generated and I have called the chargeCard() method, the paystack-android sdk sometimes delays for two to three seconds before popping up the transparent Card-Pin and OTP Entry activity. I think the paystack-android team should look into the code and make sure that there are no long running process executed before the PIN Entry activity is shown.
I finally took my time to look into the paystack-android SDK source-code and it seems like the SDK is making connection to the server to verify a transaction access_code before popping up the dialog. Below is the code block where the OTP Activity is started which is after a network call has been made and processed.
if (transactionApiResponse.status.equalsIgnoreCase("2")) { new PinAsyncTask().execute(); //the PinAsyncTask is the AsynTask that starts the OTP Activity. return; }
the Implementation of the paystack-android SDK should display a progress loader when it is making an API call. Your immediate response will be appreciated.
Awesome suggestion! You good to send in a PR for review?
Absolutely..... I will work on it as soon as I can.
Yeah nice suggestion, still waiting for the implementation tho, It's really frustrating to the users, no notification displayed to the user while the PIN and OTP verification process is bn carried out.
Problem
I've been working on implementing the paystack-android SDK on an app, but I noticed that sometimes the pin and the OTP verification dialog doesn't popup at the right time after the chargeCard() method has been called. This is so annoying that end-users can likely tap on the pay-button on the app twice thereby initiating two transactions. I managed to resolve the double-tapping error though by disabling the pay-button while a transaction is in progress. But it will be so nice if the paystack-android team can look into this issue and propose a solution or fix the bug in the SDK.