#Saurabh Jha
1 messages · Page 1 of 1 (latest)
no,
When the user is not logged into Salesforce and tries to use the community page, this error occurs
but when the user is logged in then everything runs smoothly
What Stripe integration are you using? The "stripe payment frame" you mentioned
Stripe Payment Element
The Payment Element is inside the frame currently being refused, correct?
yes
The nfpoob-dev-ed.my.saleforce.com frame
I am using iframe to frame the payment element
yes
Hmm I believe the whole frame nfpoob-dev-ed.my.saleforce.com is being rejected by CORS and it doesn't matter if you implement Payment Element inside it or not
why is it getting rejected though?
I don't know. It the CORS setting that maybe Saleforce is enforcing, and unfortunately we don't have detail about it
If you just comment out the PaymentElement, you should see the same issue, right?
Ahh okie
I would like to render an iframe with the source being Github like so:
<iframe src="https://gist.github.com/user45445/9bf8d568e3350146ba302d7d67ad576f"> </iframe>
This is the error I ...
Okie I think I know why. Can you elaborate on this part?
I am using iframe to frame the payment element
I have created a Visualforce Page which contains ' <script src="https://js.stripe.com/v3/"> </script>
and all the stripe payment related changes
and in my LWC I am referring to the visualforce page using Iframe
That visualforce page should be nfpoob-dev-ed.my.saleforce.com right?
yes
- Widen the visualforce page's frame-ancestor policy to include your LWC page domain like https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/frame-ancestors
- Avoid rendering the visualforce page using iframe, because Payment Element is an iframe itself and it could doesn't work while being nested inside another iframe
so there is no issue from Stripe?
I believe it's the way we built Payment Element. Can you try the 1st approach first?
I have tried it but no luck
Um so I think it's the requirement comes from inside the PaymentElement frame, that we don't allow it to be nested against another iframe
sorry
but it works when the user has logged into Salesforce and then use the community page
😕
In that case is it still under the iframe
Can you compare the page structure between logged in and non-logged in? I suspect they will have different structure
yes