-
Notifications
You must be signed in to change notification settings - Fork 217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Embedded checkout: Refused to frame #1631
Comments
Hi, not that I directly have an answer for you and being able to tell this works for me as well (I still struggle with getting my head around the whole embedded checkout functionality). But this is how I am trying to embed a checkout. First I fetch the checkout urls from
From the result object I use the More on this can be found here Maybe this is helpful for you. |
Hi arjanc, thank you for your response. I have done it using the embedCheckout function in my checkout page: `export default function Checkout () {
} The hook useCheckout makes a request to BC API and receives the three urls and I use the embedded_checkout_url. Also I tried to change the security settings of the store, with the option x-frame, but I always get the same error. |
Are us using a custom checkout or the default 'Optimized One-Page Checkout' from Bigcommerce? Because I saw the same message you have when I enabled a custom checkout. And was able to embed the default checkout when the option 'Optimized One-Page Checkout' was enabled inside the Bigcommerce settings -> checkout. |
Yes, I tried both, I enabled a custom checkout and default checkout page. Always I received the same issue. I dont know if I need to set some special configuration or not. Also I tried X-frame options and I couldn't embed it. |
@cfernandeza-or did you ever figure this out? |
Describe the bug
I am triying to embed the checkout with the function embedCheckout, but throws this errror:
Refused to frame 'https://channel.mybigcommerce.com/' because an ancestor violates the following Content Security Policy directive: "frame-ancestors https://channel.mybigcommerce.com/".
The hook useCheckout request the redirect links and when the data is loaded, execute the embededCheckout function to embed the iframe in the div:
`
import { Layout } from "@components/common";
import { Container } from "@components/ui";
import useCheckout from '@framework/checkout/use-checkout';
import { embedCheckout } from '@bigcommerce/checkout-sdk';
import { useEffect } from 'react';
export default function Checkout () {
const { data } = useCheckout();
}
Checkout.Layout = Layout`
Screenshots
The text was updated successfully, but these errors were encountered: