#wop512-cors

1 messages · Page 1 of 1 (latest)

open rapids
#

what code was running that triggered the error?

bleak wraith
#

Visiting the page caused the issue. Simple request in JS.

#

Stripe('pk_live_***');

open rapids
#

sorry, I mean - for example - are you using stripe checkout or elements?

bleak wraith
#

sorry. elements is being used.

open rapids
#

do you have a content security policy (CSP) deployed, and if so, what's in it?

#

also, is this causing the page to break, or is it just that there are errors in the js console? r.stripe.com is a domain for collecting metrics, error reports, etc. - it shouldn't actually impact your ability to process payments

bleak wraith
#

i apologize for the late response, debugging the code. another error (Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://m.stripe.com/6. (Reason: CORS request did not succeed). Status code: (null).) occurs as well. thank you for the clarification on the metrics (r.stripe.com).

#

Stripe is initialized before any other code is processed (even out of checkout)

#

This causes the page to break.

#

AJAX requests cannot be called because of this.

open rapids
#

apart from the CORS errors, are there any other errors in the javascript console?

bleak wraith
open rapids
#

hmm ok

#

I'm a little suspicious that there's something else going on here - errors hitting m.stripe.com/r.stripe.com shouldn't block the rest of the init. adding them to the CSP for now might let us diagnose what's going on here

bleak wraith
#

thank you for your response i will give it a try.

#

OK. i have resolved the issue. Some underlying on our part caused the issue.

#

thank you very much for your help.

open rapids
#

ah, nice! just for my own curiosity, what was the issue?

bleak wraith
#

at first i suspected it was an invalid pk or sk