(Clover Mini, Android)
I'm trying to do capturePreAuth, however the behaivour is so weird, I made two implementations, and any of them don't work. Can someone help me, maybe I doing something wrong. thanks.
First implementation:
I have a background service running each 30 seconds, in this service I call the method, on this implementation always onCapturePreAuthResponse (the callback) is executed, however if someone is writing on the android keyboard during capturePreAuth is happening, the keyboard goes away, how can it happen? why?.
Second implelentation>
I moved the implementation into a fragment, the problem here is almost never onCapturePreAuthResponse (the callback) is executed, so the application gets stuck.
I basically have the same implementation in both cases:
//I call this method when the fragment or service is ready @Override public void initPaymentConnector() { if (paymentConnector == null) { paymentConnector = new PaymentConnector(getActivity(), CloverAccount.getAccount(getActivity()), this, BuildConfig.APPLICATION_ID); paymentConnector.initializeConnection(); } } // IPaymentConnectorListener Methods //Sometimes this method is called and sometimes is not @Override public void capture(CapturePreAuthRequest request) { paymentConnector.capturePreAuth(request); } ... @Override public void onCapturePreAuthResponse(CapturePreAuthResponse response) { presenter.deleteCaptureData(response); } //When the device is connected, I got the captureData and I call @Override public void onDeviceConnected() { presenter.getCaptureData(); } // Presenter public void getCaptureData(IReceiptOptionsContract.IView callback) { getCaptureData.execute(new UseCaseObserver<CaptureEntity>() { @Override protected void onSuccess(CaptureEntity r) { //... Some validations CapturePreAuthRequest request = new CapturePreAuthRequest(); request.setAmount(collected.longValue()); request.setPaymentId(r.getPaymentId()); request.setTipAmount(new Long(0)); // callback.capture(request); } @Override public void onError(Throwable e) { super.onError(e); ErrorUtils.send(e, "Could capture, could not get capture data."); } }, null); } //Capture call @Override public void capture(CapturePreAuthRequest request) { paymentConnector.capturePreAuth(request); }