question

aniruddh avatar image
aniruddh asked parquet76 edited

getting failed to find provider info for com.clover.merchant in Payment connector

where does it searches for the merchant account? on my android device? and how to add it. I am using payment connector for android based payments

public class MainActivity extends AppCompatActivity {


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        Charge c = new Charge();

        int permissionCheck = ContextCompat.checkSelfPermission(this, android.Manifest.permission.GET_ACCOUNTS);

// If we don't have the permission, request it
        if (permissionCheck != PackageManager.PERMISSION_GRANTED) {
            ActivityCompat.requestPermissions(this, new String[]{android.Manifest.permission.GET_ACCOUNTS}, 1);
        }
//        AccountManager am = AccountManager.get(this); // "this" references the current Context
//
//        Account[] accounts = am.getAccounts();

        SaleRequest saleRequest = new SaleRequest();
        saleRequest.setAmount(1000L);

        PaymentConnector paymentConnector = initializePaymentConnector();
        paymentConnector.sale(saleRequest);

}

   private PaymentConnector initializePaymentConnector() {
        // Get the Clover account that will be used with the service; uses the GET_ACCOUNTS permission


        Account cloverAccount = CloverAccount.getAccount(this);

        // Set your RAID as the remoteApplicationId
        String remoteApplicationId = "my RAID HERE";

        //Implement the interface
        IPaymentConnectorListener paymentConnectorListener = new IPaymentConnectorListener() {
            @Override
            public void onDeviceDisconnected() {

            }

            @Override
            public void onDeviceConnected() {

            }

            @Override
            public void onPreAuthResponse(PreAuthResponse response) {

            }

            @Override
            public void onAuthResponse(AuthResponse response) {

            }

            @Override
            public void onTipAdjustAuthResponse(TipAdjustAuthResponse response) {

            }

            @Override
            public void onCapturePreAuthResponse(CapturePreAuthResponse response) {

            }

            @Override
            public void onVerifySignatureRequest(VerifySignatureRequest request) {

            }

            @Override
            public void onConfirmPaymentRequest(ConfirmPaymentRequest request) {

            }

            @Override
            public void onSaleResponse(SaleResponse response) {
                String result;
                if(response.getSuccess()) {
                    result = "Sale was successful";
                } else {
                    result = "Sale was unsuccessful" + response.getReason() + ":" + response.getMessage();
                }
                Toast.makeText(getApplication().getApplicationContext(), result, Toast.LENGTH_LONG).show();
            }

            @Override
            public void onManualRefundResponse(ManualRefundResponse response) {

            }

            @Override
            public void onRefundPaymentResponse(RefundPaymentResponse response) {

            }

            @Override
            public void onTipAdded(TipAdded tipAdded) {

            }

            @Override
            public void onVoidPaymentResponse(VoidPaymentResponse response) {

            }

            @Override
            public void onVaultCardResponse(VaultCardResponse response) {

            }

            @Override
            public void onRetrievePendingPaymentsResponse(RetrievePendingPaymentsResponse retrievePendingPaymentResponse) {

            }

            @Override
            public void onReadCardDataResponse(ReadCardDataResponse response) {

            }

            @Override
            public void onCloseoutResponse(CloseoutResponse response) {

            }

            @Override
            public void onRetrievePaymentResponse(RetrievePaymentResponse response) {

            }

            @Override
            public void onVoidPaymentRefundResponse(VoidPaymentRefundResponse response) {

            }
        };

        // Implement the other IPaymentConnector listener methods

        // Create the PaymentConnector with the context, account, listener, and RAID
        return new PaymentConnector(this, cloverAccount, paymentConnectorListener, remoteApplicationId);
    }


here is the error I am getting

E/ActivityThread: Failed to find provider info for com.clover.merchant

E/UnstableResolverClient: Usage of provider content://com.clover.merchants/accounts failed

    java.lang.Exception: Client is null for URI: content://com.clover.merchants/accounts

        at com.clover.sdk.internal.util.UnstableContentResolverClient.makeUnstableCall(UnstableContentResolverClient.java:97)

        at com.clover.sdk.internal.util.UnstableContentResolverClient.makeUnstableCall(UnstableContentResolverClient.java:65)

        at com.clover.sdk.internal.util.UnstableContentResolverClient.query(UnstableContentResolverClient.java:204)

        at com.clover.sdk.util.CloverAccount.getAccounts(CloverAccount.java:100)

        at com.clover.sdk.util.CloverAccount.getAccount(CloverAccount.java:77)

        at com.example.cloverapp.MainActivity.initializePaymentConnector(MainActivity.java:74)


Also I live in India and cant download clover app on my mobile..so how do I add account of clover on my phone so that android studio catches the clover developer account on phone

Clover Android SDKsemi-integrationsclover developer communityClover Mobile
10 |2000

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

1 Answer

·
parquet76 avatar image
parquet76 answered parquet76 edited

The documentation I sent you yesterday says the following about payment connector:

"Use this API, if you are building a point-of-sale directly on a Clover device."

Based on your original question where you said you do not have Clover hardware, it seems you selected the incorrect API to use. For Payment Connector to work your app MUST be running on a Clover device, which means a Clover devkit (not emulator) in development.

I don't understand how you selected Payment Connector if you spent a few moments reading the links I sent you. Please take the time to read the documentation, your successful integration depends on it

If your app is not running on a Clover device you need to use either the Rest Pay API or the Clover Connector (remote pay android).

Please note, regardless of which option you choose ALL payment integrations (Rest Pay API, clover connector, etc.) require a devkit, the emulator does NOT support the payment flow nor the apps required for semi integrations.

10 |2000

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

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