#J Rietz - Server
1 messages · Page 1 of 1 (latest)
heya @pseudo peak, can you share your server code where you defined the GET payment_methods route?
Are you familiar with the stripe-react-native example server? That's the code I am using. The only actual GET methods in that server code is for stripe-key actually...rest of them are POST methods.
Could that be the issue? The server works fine for me locally though when I expose it using ngrok
are you looking at this one? https://stripe.com/docs/payments/accept-a-payment?platform=react-native
Yes exactly
That's the exact code I have
But the problem is not specifically related to creating a paymentIntent. It breaks before that when I make requests to my API_URL.
if you're making a request to your own server, you shouldn't be defining the authorization header there
what language are you using in your backend server?
we have server examples for a couple of different programming languages, so i'll will see if there's one that matches what programming language you're using
I am literally using this server: https://github.com/stripe/stripe-react-native/tree/master/example/server
It works fine locally when I expose it using localhost and ngrok but when I deploy it to the cloud it doesn't really allow me to make any types of requests.
did you define your .env file on your cloud as well?
That's maybe something that could be the issue, I deployed the .env file as it's in my repo but maybe those aren't included per default? I am not a backend person so learning the ropes right now.
I will add those .env variables to my deployment and see if it makes a difference
That was actually the trick, it works now! 🙂
Thanks!