#jack-drake_api

1 messages ¡ Page 1 of 1 (latest)

ionic creekBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1429986567459700777

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

dim chasm
#

I will send snippets of our code and output for your reference

#
LOG  Discovered readers:  [{"availableUpdate": null, "baseUrl": null, "batteryLevel": null, "bootloaderVersion": null, "configVersion": null, "deviceSoftwareVersion": "unknown", "deviceType": "stripeM2", "emvKeyProfileId": null, "firmwareVersion": null, "hardwareVersion": "unknown", "id": null, "ipAddress": null, "label": null, "location": null, "locationId": null, "locationStatus": "notSet", "macKeyProfileId": null, "pinKeyProfileId": null, "pinKeysetId": null, "serialNumber": "STRM26214144139", "settingsVersion": null, "simulated": false, "status": "unknown", "trackKeyProfileId": null}]
 LOG  [StripeReader] Connecting to: STRM26214144139
 LOG  [Stripe terminal]: didChangeConnectionStatus notConnected
 LOG  [StripeReader] Scan complete
 LOG  [Stripe terminal]: didFinishDiscoveringReaders {}
 LOG  [Stripe terminal]: didChangeConnectionStatus connecting
 LOG  Device Info 2: {"device_id": "f90241b0-d935-489d-b1f4-31af4488ce11", "location_id": "72d420e0-72a3-40b2-9944-8b26106be1e4", "location_name": "Downtown Anaheim", "name": "Lobby", "pairing_code": "798512", "payment_processor": "stripe", "restaurant_id": "51929796-3568-4e15-b47e-c585479c6699", "stripe_location_id": "tml_GO4mdQ6xBZYtyP"}
 LOG  [API] Fetching Stripe Terminal connection token: {"restaurantId": "51929796-3568-4e15-b47e-c585479c6699", "url":"{{HIDDEN}}"}
 LOG  [Stripe terminal]: didStartInstallingUpdate {"deviceSoftwareVersion": "2.01.00.38-SZZZ_Prod_US_v12-481001", "estimatedUpdateTime": "estimateLessThan1Minute", "requiredAt": "-633600000"}
 LOG  [Stripe terminal]: didChangeConnectionStatus notConnected
 LOG  connectReader error {"code": "UNEXPECTED_ERROR.UNEXPECTED_SDK_ERROR", "message": "Unexpected failure"}
#

Our Connect Code

export function useConnectReaders() {
    const { connectReader, disconnectReader, connectedReader } = useStripeTerminal();

    const handleConnectBluetoothReader = async (selectedReader: any, locationId: string) => {
        const { reader, error } = await connectReader(
            {
                reader: selectedReader,
                locationId: locationId,
            },
            'bluetoothScan'
        );

        if (error) {
            console.log('connectReader error', error);
            return;
        }

        console.log('Reader connected successfully', reader);
    };

    return { handleConnectBluetoothReader, connectedReader };
}
#

Our Discovery Code

export function useDiscoverReaders() {
    const { discoverReaders, discoveredReaders, cancelDiscovering } = useStripeTerminal({
        onUpdateDiscoveredReaders: (readers) => {
            // After the SDK discovers a reader, your app can connect to it.
            console.log('Discovered readers: ', readers);
        },
    });

    const handleDiscoverReaders = async () => {
        // The list of discovered readers is reported in the `onUpdateDiscoveredReaders` method
        // within the `useStripeTerminal` hook.
        const { error } = await discoverReaders({
            discoveryMethod: 'bluetoothScan',
        });

        if (error) {
            Alert.alert(
                'Discover readers error: ',
                `${error.code}, ${error.message}`
            );
        }
    };

    const cancelDiscoverReaders = async () => {
        const { error } = await cancelDiscovering();
        
        if (error) {
            Alert.alert(
                'Cancel discovery error: ',
                `${error.code}, ${error.message}`
            );
        }
    };

    return { handleDiscoverReaders, discoveredReaders, cancelDiscoverReaders };
}
#

any ideas would help

queen flare
#

Hello, I just want to acknowledge the question. I'm working on some other threads but will get to you as soon as I can!

queen flare
#

@dim chasm can I have the timestamp where you receive the error above?

dim chasm
#

It doesnt give me a timestamp

queen flare
#

Okay, do you know the date you got the error? was it recent?

dim chasm
#

Yes maybe 30 min ago

#

When i sent it here maybe a few minutes passed

queen flare
#

Gotcha, thanks for confirming. We looked up the logs for STRM26214144139 and we do see an error log around that time. We will need to check on the error with our product team, but this will take some time. I will drop you a dm to create a support case directly with us.