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