1

I have assigned visualforce and apex class on guest user profile.Also i enabled Available for Lightning Experience, Experience Builder sites, and the mobile app. But still in experience its showing an error refused to connect wise-impala-bk33p6-dev-ed.trailblaze.my.site.com refused to connect.

Error on experience site enter image description here

Enabled Vf page for guest user profile enter image description here

on Vf Page enter image description here

 paymentElement.js
 if (this.siteclientSecret == undefined){
        this.siteclientSecret = '/apex/PaymentElements?clientSecret=' + result.client_secret;
        console.log(this.siteclientSecret);
    } 
//i tried like below as well its showing invalid page
if (this.siteclientSecret == undefined){
            this.siteclientSecret = 'myCommunity/apex/PaymentElements?clientSecret=' + result.client_secret;
            console.log(this.siteclientSecret);
        } 

//hardcoded the site page but still getting the same error
if (this.siteclientSecret == undefined){
            this.siteclientSecret = 'https://wise-impala-bk33p6-dev-ed.trailblaze.my.site.com/myCommunity/apex/PaymentElements?clientSecret=' + result.client_secret;
            console.log(this.siteclientSecret);
        } 


paymentlement.html
<div class="slds-box slds-theme--default">
        <iframe allowpaymentrequest id="add_payment" src={siteclientSecret} height="600px" width="100%"></iframe>
    </div>

1 Answer 1

1

You need to allow access to the domain first, as stated in Put Visualforce Pages on External Domains.

From Setup, in the Quick Find box, search for Session Settings, and then click Session Settings. Under Clickjack Protection, select Enable clickjack protection for customer Visualforce pages with headers disabled and Enable clickjack protection for customer Visualforce pages with standard headers.

Then under Trusted Domains for Inline Frames, add the trusted external domains where you allow framing and set the iframe type to Visualforce Pages. Ensure that your domain names meet format requirements. You can add up to 512 external domains.

1
  • Hi @sfdcfox I have enabled options what you mentioned under session settings and added two domains 1.mydomain url and my experience site URL and set it the iframe type as vf pages but no luck still getting the same error. I have created vf page and included script tag to load stripe.js and added into iframe tag in LWC. Should I need to create another page under experience site and adding vf page inside that and refering that url into iframe will solve the problem? Commented Jun 25 at 19:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .