#eeynard_error
1 messages ยท Page 1 of 1 (latest)
๐ 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.
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
Hello !
Basically Timed out waiting for connection token
how are you setting token provider in your code? https://docs.stripe.com/terminal/payments/setup-integration?terminal-sdk-platform=react-native#connection-token-client-side
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
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?
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
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
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
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
LOG START 11:13:52:594
LOG END 11:13:53:189
yes sure, i understand
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;
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
I tried the peppermint call on my iOS simulator and I got the Your app's ConnectionTokenProvider did not call the provided completion block within 60 seconds when trying to discover readers
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
the last one "@stripe/stripe-terminal-react-native": "^0.0.1-beta.20",
"expo": "~50.0.19"
"react-native": "0.73.6"
Can you try downgrading to an older version: https://github.com/stripe/stripe-terminal-react-native/issues/789
I think the issue is due to this: https://github.com/stripe/stripe-terminal-react-native/pull/791
oh ok, I didn't see those issues. SO should I try to downgrade to 19 ?
Yup
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
Hmm this isn't something my team would know much about unfortunately.
I'd recommend checking with the sales person again
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
NP! ๐ Happy to help
Still building, but should be good in a few minutes
It seems that the issue is no longer present on iOS ๐
perfect
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 ๐ค
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
Awesome, apologies for the friction ๐