#J Rietz - Server

1 messages · Page 1 of 1 (latest)

tight mesa
#

heya @pseudo peak, can you share your server code where you defined the GET payment_methods route?

pseudo peak
#

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

tight mesa
pseudo peak
#

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.

tight mesa
#

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

pseudo peak
#

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.

tight mesa
#

did you define your .env file on your cloud as well?

pseudo peak
#

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!