PaystackHQ / paystack-android

Paystack SDK for Android. Accept payments on Android
Apache License 2.0
126 stars 102 forks source link

Pin and OTP Verification dialog doesn't popup(show) at the right time #38

Closed iamabeljoshua closed 6 years ago

iamabeljoshua commented 6 years ago

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.

ibrahimlawal commented 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?

iamabeljoshua commented 6 years ago

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.

iamabeljoshua commented 6 years ago

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.

ibrahimlawal commented 6 years ago

Awesome suggestion! You good to send in a PR for review?

iamabeljoshua commented 6 years ago

Absolutely..... I will work on it as soon as I can.

hameedolamide commented 4 years ago

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.