#eeynard_error

1 messages ยท Page 1 of 1 (latest)

dim prismBOT
#

๐Ÿ‘‹ 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/1279092049773072437

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

slender viperBOT
median pasture
#

Hello
What error do you see in your logs when you try to connect to the reader after first install?

#

On your UI, I see the code timed out waiting for connection token

viral estuary
#

Hello !
Basically Timed out waiting for connection token

median pasture
viral estuary
#

I also sometimes have Your app's ConnectionTokenProvider did not call the provided completion block within 60 seconds.

#
import { GetPaymentTokenOutput } from '@allocab/allocab-commons-shared-types';
import { StripeTerminalProvider } from '@stripe/stripe-terminal-react-native';
import { ReactNode } from 'react';

import { driverApi } from '../network/Api';

const fetchTokenProvider = async () => {
  const { token } = await driverApi.get<void, GetPaymentTokenOutput>('/v1/tap-to-pay/stripe-token');

  return token;
};

type Props = {
  children: ReactNode;
};

export const StripeProvider = ({ children }: Props) => {
  return (
    <StripeTerminalProvider logLevel="verbose" tokenProvider={fetchTokenProvider}>
      <>{children}</>
    </StripeTerminalProvider>
  );
};
#

And I wrap all the "logged in" part of my app with it

median pasture
#

I wonder if the issue is with your driverApi

Can you try changing that to a simple fetch call and see if it makes a difference?

viral estuary
#

it's a simple wrapper around axios.get that adds our bearer auth

#

since we get the token from stripe through our backend. The app isn't directly calling stripe

median pasture
#

since we get the token from stripe through our backend. The app isn't directly calling stripe
yeah that's expected... I am just wondering if the wrapper is adding any side-effects which is causing high latency issue.

Can you add a timestamp log into your token provider to see when it gets called and when it recieves data back from your API?

#

does your API use any sort of authentication header?

#

Your app's ConnectionTokenProvider did not call the provided completion block within 60 seconds.
this error usually suggests that the SDK couldn't get the connection token in timely manner.. which will affect every function SDK tries to perform

#

including connecting to a reader

viral estuary
#

we already debunk this last time. The server is responding fast with the token. The only observation we had was that for some reason, the StripTerminalProvider was calling this fetcher 2/3 times in a row sometimes. But the token was retreived successfully each time. I also tested on my side to store the token, preventing the multiples calls, but that does not solve the issue

median pasture
#

Provider invoking connection token endpoint multiple times is def expected and you shouldn't cache the token.. SDK needs to be able to fetch fresh tokens whenever it needs

#

we already debunk this last time
sorry if we're going over the same stuff again but it is possible the person helping you last time missed something in the process

viral estuary
#

LOG START 11:13:52:594
LOG END 11:13:53:189

median pasture
#

Hmm okay.. Just for my sanity check, can you try using this API url?
https://peppermint-dashing-globe.glitch.me/connection-token

  const response = await fetch(`https://peppermint-dashing-globe.glitch.me/connection-token`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
  });
  const { secret } = await response.json();
  return secret;
viral estuary
#

yes i'll try now. Just something to add, on Android I get the error when i try to connect with Timed out waiting for connection token and on iOS I get an error when I try to discover the readers with Your app's ConnectionTokenProvider did not call the provided completion block within 60 seconds

viral estuary
median pasture
#

can you try opening the URL in simulator iOS?

#

should see an error about POST vs GET

#

but just wondering if its able to reach glitch url

viral estuary
median pasture
#

hmm okayy

#

what SDK version are you using?

viral estuary
#

the last one "@stripe/stripe-terminal-react-native": "^0.0.1-beta.20",

#

"expo": "~50.0.19"
"react-native": "0.73.6"

median pasture
viral estuary
#

oh ok, I didn't see those issues. SO should I try to downgrade to 19 ?

median pasture
#

Yup

viral estuary
#

Ok, it my take a while since I would need to build again

#

I have a side question, I don't know if you'll be able to answer it but a few months ago we talked with some Stripe sales about a feature that was about to go live but we are still waiting on it. Do you have any idea when the card PIN payments will be available for Tap to Pay on Android ? right now we are limited at 50 euros in France

median pasture
#

Hmm this isn't something my team would know much about unfortunately.

#

I'd recommend checking with the sales person again

viral estuary
#

ok no worries ! He's not answering our emails, that's why I tied my chance here ! But I think we'll try to find another contact. Thanks anyway

dim prismBOT
median pasture
#

NP! ๐Ÿ™‚ Happy to help

viral estuary
#

Still building, but should be good in a few minutes

#

It seems that the issue is no longer present on iOS ๐ŸŽ‰

median pasture
#

perfect

viral estuary
#

The build on android failed since there was a fix about it in the version 20. I implemented the fix and launched a new build 7min ago. We'll have to wait a little bit to see if android is fixed or not ๐Ÿคž

viral estuary
#

Sorry I had to launch a new build with the right tokenProvider. Should be good in 5min

#

Ok great it works on android too !!!

#

thank you very much for your help

#

Hopefully the PR you send will be added the the next release soon ! In the meantime we'll go with the v19

median pasture
#

Awesome, apologies for the friction ๐Ÿ™‚