Skip to content
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

First initialize the Stripe Terminal SDK before performing any action" #749

Open
MoinJanjua opened this issue Jul 4, 2024 · 4 comments
Open

Comments

@MoinJanjua
Copy link

Describe the bug

I am trying to implement Stripe terminal sdk but i ma unable to initialize it I have below error
"First initialize the Stripe Terminal SDK before performing any action
at CartReaders"

To Reproduce
I Create the Root,App and Payment screen After running Root and App screen and open the Payment screen to display readers than it display error even I will try with connection_token directly pass to function
"First initialize the Stripe Terminal SDK before performing any action
at CartReaders (http://localhost:8081/index.bundle//&platform=ios&dev=true&lazy=true&minify=false&inlineSourceMap=false&modulesOnly=false&runModule=true&app=com.grunq.pos:197064:26)"

Expected behavior
I want it should initialize the SDK properly

Screenshots
Screenshot 2024-07-04 at 3 06 21 PM
Screenshot 2024-07-04 at 3 10 25 PM

Stripe Terminal React Native SDK version

"@stripe/stripe-terminal-react-native": "^0.0.1-beta.19",

Smartphone (please complete the following information):

  • Device: [e.g. iPad7]
  • OS: [e.g. iOS 17.0]

Additional context

@nabilfreeman
Copy link

Did you wrap the application with StripeTerminalProvider and hook up the server-side connection token API endpoint properly?

@MoinJanjua12
Copy link

Yes I did properly even i try with Static Token that i generated from the Postman

@nabilfreeman
Copy link

nabilfreeman commented Jul 8, 2024

I didn't see the initialize func being called - Try:

const { initialize, isInitialized, discoverReaders } = useStripeTerminal();

// Call initialize on mount
useEffect(() => {
  void initialize();
}, []);

// Wait for initialization to complete before calling discoverReaders
useEffect(() => {
  if(isInitialized) {
    void discoverReaders();
  }
}, [isInitialized]);

// Remember to implement error handling etc

@MoinJanjua
Copy link
Author

I tried by this way too and have the same issue
here is the error "StripeTerminalProvider component is not found, has not been mounted or SDK has not been initialized properly"

I was already initialized but facing the same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants