-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ERROR First initialize the Stripe Terminal SDK before performing any action #659
Comments
@abhijitCN are you still running into this issue? |
Hi ; I also have the same issue I am trying to implement card reader sdk ReactNative "First initialize the Stripe Terminal SDK before performing any action" SDK version "@stripe/stripe-terminal-react-native": "^0.0.1-beta.19", |
I have the same issue, I initialize the SDK and after I call the discoverReaders and I have the error, this is my code:
when the promise of initialize is finished the SDK shouldn't it be ready? |
@GabrielDuarteJr hello, have you got any solution for it!! |
hi, I'm also having this issue! My root is wrapped in a stripe terminal provider (splash screen) then the home page initialises and the payment page scans for readers, but I am getting that error when my useEffect to scan for readers kicks in. Any coms / help would be appreciated, thanks |
@GabrielDuarteJr is this asynchronous functionality works perfectly and is the error resolved? |
@MoinJanjua thank you so much, it's helpful for me thanks. |
@abhijitCN are you still running into this issue? |
### In my Root(index.js) I initialized and API call for token and in App.js useEffect call the const { initialize } = useStripeTerminal() as per the documentation but still I get ERROR First initialize the Stripe Terminal SDK before performing any action PLEASE HELP.
import {
StripeTerminalProvider
} from '@stripe/stripe-terminal-react-native';
import { AppRegistry } from 'react-native';
import { name as appName } from './app.json';
import App from './src/App';
const ReduxAppWrapper = () => {
const fetchTokenProvider = async () => {
try {
const response = await fetch(
FetchTokenApi/stripe/tokens
,{
method: 'GET',
headers: {
'Content-Type': 'application/json',
},
},
);
const {secret} = await response.json();
console.log('fetch Token Provider secret KEY >> ', secret);
return secret;
} catch (error) {
console.log('fetch Token Provider eror >> ', error);
}
};
return (
);
};
AppRegistry.registerComponent(appName, () => ReduxAppWrapper);
function App() {
const { initialize } = useStripeTerminal();
useEffect(() => {
console.log('USE EFFECT >>initialized stripe-terminal in ROOT > ');
initialize({
logLevel: 'verbose',
});
}, [initialize]);
return (
<>
</>
);
}
export default App;
** @kevinlam92 @mihaildu @TheRusskiy @SudoPlz & ANYONE face this issue**
The text was updated successfully, but these errors were encountered: