#ismailelric-terminal-rn
1 messages · Page 1 of 1 (latest)
Hello! We'll be with you shortly. 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.
- ismail-RN-terminalReader, 3 days ago, 30 messages
- ismailelric, 4 days ago, 8 messages
ismail-rn-terminal
How is isStangingEnv set?
It's a global state, I logged its value above the stripeTerminalProvider and its value changes
As in right above this line?
<StripeTerminalProvider tokenProvider={() => fetchStripeTerminalToken(isStagingEnv ? "test" : "live")}>
Within the same component
const myApp = () => {
const { isStagingEnvironment } = useIsStagingEnvironment();
console.log({ isStagingEnvironment });
}
return (
<StripeTerminalProvider tokenProvider={() => fetchStripeTerminalToken(isStagingEnv ? "test" : "live")}>
<AppNavigator />
<StripeTerminalProvider/>
)
}
Ok. Can you share the code for useIsStagingEnvironment as well?
ismailelric
Thanks
Have you tried using a key prop on StripeTerminalProvider to reset state? Also are you calling initialize: https://github.com/stripe/stripe-terminal-react-native?tab=readme-ov-file#initialization again within your tree wherever you are using the sdk?
ismailelric-terminal-rn
Calling initialize works! Thank you
Sweet