#Saurabh Jha

1 messages · Page 1 of 1 (latest)

rough cairnBOT
ionic jay
#

can you give me some info on this error?

lyric dawn
#

That looks like an error on Saleforce

#

Is there any Doc you are following?

ionic jay
#

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

lyric dawn
#

What Stripe integration are you using? The "stripe payment frame" you mentioned

ionic jay
#

Stripe Payment Element

lyric dawn
#

The Payment Element is inside the frame currently being refused, correct?

ionic jay
#

yes

lyric dawn
ionic jay
#

I am using iframe to frame the payment element

ionic jay
lyric dawn
#

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

ionic jay
#

why is it getting rejected though?

lyric dawn
#

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?

ionic jay
#

no

#

it only throws error while framing the PaymentElement

lyric dawn
#

Ahh okie

#

Okie I think I know why. Can you elaborate on this part?

I am using iframe to frame the payment element

ionic jay
#

and all the stripe payment related changes

#

and in my LWC I am referring to the visualforce page using Iframe

lyric dawn
#

That visualforce page should be nfpoob-dev-ed.my.saleforce.com right?

ionic jay
#

yes

lyric dawn
#
  1. 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
  2. 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

The HTTP Content-Security-Policy (CSP) frame-ancestors directive specifies valid parents that may embed a page using , , <object>, <embed>, or <applet>.

ionic jay
#

so there is no issue from Stripe?

lyric dawn
#

I believe it's the way we built Payment Element. Can you try the 1st approach first?

ionic jay
#

I have tried it but no luck

lyric dawn
#

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

ionic jay
#

but it works when the user has logged into Salesforce and then use the community page

#

😕

lyric dawn
#

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

ionic jay