#faultexception

1 messages · Page 1 of 1 (latest)

gleaming sundialBOT
daring dune
#

Why are you calling stripe API from client? Stripe API are supposed to be called from backend

civic bone
#

I'm trying to call it from my client because that's where I'm integrating payments.

#

I'm using the stripe/stripe-js package and my understanding was that library was supposed to be called from your front end.

#

I followed the examples from this resource:

https://www.npmjs.com/package/@stripe/stripe-js

daring dune
#

That's frontend and not suppose to call Stripe API

civic bone
#

Well, I suppose I'm not calling the Stripe API then, but when I make this call stripePromise = loadStripe(process.env.NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY); it fails

daring dune
#

Um have you logged process.env.NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY and sure it has value?

#

And what error message do you have on that line?

civic bone
#

Yes, I have a value.

#

It just says "Stripe failed to load' but I'm getting a 200 response, the only issue is that the server isn't setting a cross origin header

#

This is the error I'm getting when the GET posts:

GET https://js.stripe.com/v3 net::ERR_BLOCKED_BY_RESPONSE.NotSameOriginAfterDefaultedToSameOriginByCoep 200

daring dune
#

Weird. Do you have a public accessible URL?

civic bone
#

I'm just doing everything on localhost for now

#

Just a quick POC so I can start framing out my elements before I try to go to a test environment.

#

And this is the header it's saying is not set:

daring dune
civic bone
#

I'm on step 3

daring dune
civic bone
#

Okay, I don't see an option to clone that

#

Nm, I found it

#

SOrry, it's late

daring dune
gleaming sundialBOT
zealous scaffold
#

👋 taking over for my colleague. Let me know if there's any follow-up Qs I can answer!

civic bone
#

Okay, I followed that guide and I can see the html, but I need to see the create-react-app version of this

#

How do I get it to run that front end?

zealous scaffold
civic bone
#

Okay, but that doesn't seem to be necesasry based on the same the last person sent.

#

When I try to run the create-react-app version of that sample, it says I have to enable javascript to run it

zealous scaffold
#

you're using nextjs?

civic bone
#

I'm using express

zealous scaffold
#

process.env.NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY this suggest you're using NEXT but in all cases you can choose whatever language you prefer in the page I sent you and will be able to download a fully functional app

civic bone
#

Hmm, I can't build that.

#

I'm goign to take a break tongith and get some sleep.

#

Can I try again tomorrow?