fullcart
Version:
Add stripe checkout to any website
15 lines (11 loc) • 360 B
text/typescript
import { data } from '../stores/data'
export const createCheckout = async () => {
console.log('creating checkout...')
const response = await fetch(`https://fullcart-server.vercel.app/checkout`, {
method: 'POST',
body: JSON.stringify(data.get()),
})
const checkout = await response.json()
window.location = checkout.url
return checkout
}