question

invoiss avatar image
invoiss asked

How do I get Merchant ID at startup?

I'm about to submit my WebView app to Clover and my APK is crashing as soon as it comes up, here is what I have, do you see any error ? I appreciate if someone could help me.

protected void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   mAccount = CloverAccount.getAccount(this);
   CloverAuth.AuthResult authResult = null;
   try {
      authResult = CloverAuth.authenticate(MainActivity.this, mAccount);
   } catch (OperationCanceledException e) {
      e.printStackTrace();
   } catch (AuthenticatorException e) {
      e.printStackTrace();
   } catch (IOException e) {
      e.printStackTrace();
   }
   String merchantId = authResult.merchantId;
   String authToken = authResult.authToken;
   setContentView(R.layout.activity_main);
   WebView myWebView = (WebView) findViewById(R.id.webview);
   WebSettings webSettings = myWebView.getSettings();
   webSettings.setJavaScriptEnabled(true);
   myWebView.getSettings().setDomStorageEnabled(true);
   myWebView.getSettings().setDatabaseEnabled(true);
   myWebView.getSettings().setCacheMode(WebSettings.LOAD_CACHE_ELSE_NETWORK);
   myWebView.loadUrl("https://clover.invoiss.com/clover_boarding?merchant_id=" + merchantId + "&token=" + authToken);





App MarketMerchant
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

0 Answers

·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Welcome to the
Clover Developer Community