question

pavan avatar image
pavan asked sam Deactivated commented

AppsConnector.logMetered() throwing client exception "status code: 401 com.your.package has not been deployed"

Hi i am new to clover development, we are using Clover Billing where we doing following

 private void callCloverForBilling(final Context context) {
        Account account = CloverAccount.getAccount(context);

        final AppsConnector appsConnector = new AppsConnector(context, account);

        new AsyncTask<Void, Void, Void>() {

            @Override
            protected Void doInBackground(Void[] params) {
                try {
                    appsConnector.logMetered(meterid, 1);
                    return null;
                } catch (RemoteException e) {
                    e.printStackTrace();
                } catch (ServiceException e) {
                    e.printStackTrace();
                } catch (BindingException e) {
                    e.printStackTrace();
                } catch (ClientException e) {
                    e.printStackTrace();
                    clientExceptionBilling = e.getMessage();
                } catch (Exception ex) {
                    ex.printStackTrace();
                }
                return null;
            }

            @Override
            protected void onPostExecute(Void aVoid) {
                super.onPostExecute(aVoid);
                try {
                    if (clientExceptionBilling != null) {
                        Toast.makeText(context, clientExceptionBilling, Toast.LENGTH_SHORT).show();
                    }
                } catch (Exception ex) {
                    ex.printStackTrace();
                }
            }
        }.execute();
    }

But getting ClientException as "status code: 401 com.your.package has not been deployed", is anything it is related to sandbox and development? is meterid different for sandbox and development? please assist me for same, thank you.

3 comments
10 |2000

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

Jeffrey Blattman avatar image Jeffrey Blattman ♦♦ commented ·

In general, every Clover environment is it's own thing. There's no data shared between them.

0 Likes 0 ·
pavan avatar image pavan commented ·

so the ClientException as "status code: 401 com.your.package has not been deployed" is related to environment mismatch or something else?

0 Likes 0 ·
sam avatar image sam commented ·

Yes, you'll need to upload your package to your sandbox account at sandbox.dev.clover.com (separate from your production account) in order to set the correct permissions.

0 Likes 0 ·

1 Answer

sam avatar image
sam Deactivated answered pavan commented

"status code: 401 com.your.package has not been deployed" is thrown when your app has not been created in your developer dashboard.

How to create your first Clover app: https://docs.clover.com/build/create-...

  1. Log in to appropriate environment (sandbox.dev.clover.com - development OR www.clover.com - production)
  2. Go to your developer dashboard and create a 'quick app' and name your package name or create the app and upload your apk
  3. Set the correct permissions you require for the app
  4. Set at least one pricing
  5. Download using App Market. If your test merchant is associated in the same account as the developer of the app, that app will be available for download in the App Market app. Subsequent updates to the app can be sideloaded.
1 comment
10 |2000

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

pavan avatar image pavan commented ·

Thanks @Sam will do it.

0 Likes 0 ·

Welcome to the
Clover Developer Community