#dlavoie-plannit

1 messages Β· Page 1 of 1 (latest)

fresh mirageBOT
hardy burrow
#

Hi there

carmine lion
#

Hi

hardy burrow
#

How is the reader connected in this case?

carmine lion
#

Terminal.getInstance().connectBluetoothReader(

#

tracing the code on deconnexion logic, Terminal.getInstance().getConnectionStatus indicate CONNECTED juste before calling disconnectReader

hardy burrow
#

Hmm that is strange that the onFailure is not firing at all

#

Can you provide your code snippet for disconnectReader?

carmine lion
#
    public void disconnectDevice() throws CardPresentException {
        AppLog.d(TAG, "disconnectDevice");

        try {
            final Callback disconnectCallback = new Callback() {
                @Override
                public void onSuccess() {
                    // see if we'd be better triggering on onConnectionStatusChange
                    raiseCardPresentDeviceDisconnected();
                }

                @Override
                public void onFailure(@NonNull TerminalException ex) {
                    // see if we need to raise error here...
                    String s = "";
                }
            };

            Reader reader = Terminal.getInstance().getConnectedReader();

            if (reader != null) {
                Terminal.getInstance().disconnectReader(disconnectCallback);
            }
        } catch (Exception ex) {
            AppLog.e(TAG, "Stripe disconnectDevice failed", ex);

            throw new CardPresentException("Stripe disconnectDevice failed",
                    CardPresentErrorCodes.UNEXPECTED_ERROR.name(), ex.getMessage());
        }
    }```
hardy burrow
#

Thanks, let me grab a colleague more familiar with Android, one sec.

young falcon
#

Just hopping in to let you know we found an Android dev. They're in a meeting, but they should be able to hop in and assist shortly.

carmine lion
#

no problem! thanks a lot!

flat latch
#

πŸ‘‹ Hello, Can you describe the use-case you're trying to aim here?

1/ I understand you want to disconnect the reader when the payment succeeds, why though?
2/ And why are you expecting the reader to throw fire onFailure / fail disconnection here?

#

Do you mean its not firing onSuccess and onFailure both?

carmine lion
#

1-typically, card present payments will occur on the road for our kind of business so not many times a day... so we want to avoid our customer to have to manually disconnect the reader following a payment. That way, reader would shut down itself and preserve battery level.
2-neither onSuccess or OnFailure is triggered. onConnectionStatusChange callback is not fired neither and not exeption thrown during the process... just nothing happen

flat latch
#

What type of reader are you testing with?
Can you share the serial number?

carmine lion
#

WPC323042000078

flat latch
#

Are you seeing anything out of the ordinary in your logcat? Any errors/crashes/logs thrown by Terminal SDK?

#

Can you also share the complete Terminal.getInstance().connectBluetoothReader() function?

carmine lion
#

yes, on my way

flat latch
carmine lion
#

oh... I missed that recommendation

#

ok then, it pretty ends this case πŸ™‚

flat latch
#

yup, sorry about the wait πŸ™‚

#

discord is a little busy today so it took a while

carmine lion
#

don't worry, you have the better support channel! of all third party we work with πŸ™‚

flat latch
#

❀️ Appreciate it πŸ˜„
We'll archive the thread soon, but feel free to post in #dev-help should you have any follow up questions πŸ™‚