- HTML5, CSS3 & Vanilla JavaScript
- TypeScript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { NextApiRequest, NextApiResponse } from 'next'; | |
import axios, { AxiosResponse } from 'axios'; | |
type RedirectUrlsResponse = { | |
cart_url: string; | |
checkout_url: string; | |
embedded_checkout_url: string; | |
}; | |
export default async (req: NextApiRequest, res: NextApiResponse) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import axios from 'axios'; | |
import { embedCheckout } from '@bigcommerce/checkout-sdk'; | |
import useCart from '@bigcommerce/storefront-data-hooks/cart/use-cart'; | |
import { nanoid } from 'nanoid'; | |
export default function EmbeddedCheckout(props: { containerId?: string }) { | |
const { data } = useCart(); | |
const [checkoutLoaded, setCheckoutLoaded] = React.useState(false); |
I hereby claim:
- I am dallen4 on github.
- I am niekya (https://keybase.io/niekya) on keybase.
- I have a public key ASCYr1uadzpbxejdciNRKVq-Linfkf_eRTLYxVtLRx1q_go
To claim this, I am signing this object: