-
Notifications
You must be signed in to change notification settings - Fork 212
Description
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();
useEffect(() => {
if(data) {
embedCheckout({
url: data?.embedded_checkout_url,
containerId: "checkout-container"
})
}
}, [ data ]);
return (
<Container>
<div id="checkout-container"/>
</Container>
)
}
Checkout.Layout = Layout`
