I'm using Payfort sdk for online payments using my application, everything is fully integrated and working fine, when coming to payment, I can do the payment using Normal cards without any concerns, but using 3-D secure cards I have to enter a password for verification, hence, a (verified by Visa) webview with the password field automatically opens with the required details.
the problem here is when tapping the password field it getting the focus but the keyboard doesn't open to write the password, the webview which is opened is not a view from my application and I don't any control over it but closing.
I don't even know how to figure out it is now opened as I'm not receiving any corresponding callbacks.
Navigating Through Payfort code, I discovered they issuing an AlertDialog
with a layout contains a webView
that takes the verification page link to be displayed:
private Dialog showVerificationDialog(Context context, String url, VerificationDialogDismissListener onDialogListener) {
LayoutInflater layoutInflater = LayoutInflater.from(context); // context here is MyActivity context
View view = layoutInflater.inflate(R.layout.web_dialog, null);
DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics();
// just to display the Dialog at 80% of the screen
view.setMinimumHeight((int) (displayMetrics.heightPixels * 0.8f));
view.setMinimumWidth((int) (displayMetrics.widthPixels * 0.8f));
// setting the webView
WebView webView = (WebView) view.findViewById(R.id.webView);
webView.setWebViewClient(new WebViewClient());
webView.getSettings().setJavaScriptEnabled(true);
webView.loadUrl(url);
// setting the Dialog
AlertDialog.Builder builder = new AlertDialog.Builder(context)
.setView(view)
.setOnCancelListener(onDialogListener);
if (Build.VERSION.SDK_INT >= 17) {
builder.setOnDismissListener(onDialogListener);
}
Dialog dialog = builder.create();
dialog.show();
return dialog;
}
This Dialog contains the webView for the verification process, hence the problem is there but I can't find any issues with that code any everything is link straight forward.