0

In my application I have credit card Link I call the URL using

<WebView
android:id="@+id/webview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/custom_toolbar"/>

squareformwebview.setWebViewClient(new myWebViewClient());
squareformwebview.getSettings().setJavaScriptEnabled(true);
squareformwebview.setBackgroundColor(getResources().getColor(R.color.colorPrimaryDark));
squareformwebview.loadUrl(API.webformCards);

When I run the code I am getting web page with 4 fields of credit card information and button. When I hit the button I get response in JavaScript file. Now how to handle the response? how to get token generated in response? As far as I know Request method in POST and return format is JSON. I seen it in Network via Inspect element in browser.

Format: {"token":1a1a147a47s4d7ffd5fdf5ds7df4,"card":"wallet_type":"NONE","card_type":"VISA","last_4":"1234","exp_month":12,"exp_year":2018,"postal_code":"1111"}}

If I miss anything in question please feel free to ask in comment.

Thank you

kasper
  • 1
  • 2

0 Answers0