mirror of
https://github.com/vercel/commerce.git
synced 2025-05-18 07:26:59 +00:00
refactor: update external checkout and docs
This commit is contained in:
parent
7cc48a9d35
commit
16a9862b53
@ -16,9 +16,7 @@ Next, add the application credentials from your organization's application dashb
|
|||||||
|
|
||||||
## Checkout
|
## Checkout
|
||||||
|
|
||||||
Demo checkout in this provider is powered by the open-sourced [Commmerce Layer Checkout](https://github.com/commercelayer/commercelayer-checkout) application that provides you with a PCI-compliant, PSD2-compliant, and production-ready checkout flow that lets you easily place orders through the Commerce Layer API. In addition, you can set up your checkout app and deploy it to Vercel with one click below:
|
Demo checkout in this provider is powered by the open-sourced [Commmerce Layer Checkout](#) application that provides you with a PCI-compliant, PSD2-compliant, and production-ready checkout flow that lets you easily place orders through the Commerce Layer API.
|
||||||
|
|
||||||
[](https://vercel.co/new/project?template=https://github.com/commercelayer/commercelayer-checkout)
|
|
||||||
|
|
||||||
## Future upgrades
|
## Future upgrades
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ const checkout: CheckoutEndpoint['handlers']['checkout'] = async ({
|
|||||||
const checkoutUrl = clOrder.data.attributes.checkout_url
|
const checkoutUrl = clOrder.data.attributes.checkout_url
|
||||||
|
|
||||||
if (checkoutUrl) {
|
if (checkoutUrl) {
|
||||||
res.redirect(checkoutUrl)
|
res.redirect(`${checkoutUrl}?accessToken=${accessToken}`)
|
||||||
} else {
|
} else {
|
||||||
res.redirect('/cart')
|
res.redirect('/cart')
|
||||||
}
|
}
|
||||||
|
@ -33,7 +33,9 @@ const operations = {
|
|||||||
export const provider = { config, operations }
|
export const provider = { config, operations }
|
||||||
|
|
||||||
export type Provider = typeof provider
|
export type Provider = typeof provider
|
||||||
export type CommercelayerAPI<P extends Provider = Provider> = CommerceAPI<P | any>
|
export type CommercelayerAPI<P extends Provider = Provider> = CommerceAPI<
|
||||||
|
P | any
|
||||||
|
>
|
||||||
|
|
||||||
export function getCommerceApi<P extends Provider>(
|
export function getCommerceApi<P extends Provider>(
|
||||||
customProvider: P = provider as any
|
customProvider: P = provider as any
|
||||||
|
@ -22,18 +22,24 @@ export default function getSiteInfoOperation({}: OperationContext<any>) {
|
|||||||
} = {}): Promise<GetSiteInfoResult> {
|
} = {}): Promise<GetSiteInfoResult> {
|
||||||
return Promise.resolve({
|
return Promise.resolve({
|
||||||
categories: [
|
categories: [
|
||||||
{
|
|
||||||
id: 'new-arrivals',
|
|
||||||
name: 'New Arrivals',
|
|
||||||
slug: 'new-arrivals',
|
|
||||||
path: '/new-arrivals',
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
id: 'featured',
|
id: 'featured',
|
||||||
name: 'Featured',
|
name: 'Featured',
|
||||||
slug: 'featured',
|
slug: 'featured',
|
||||||
path: '/featured',
|
path: '/featured',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
id: 'clothings',
|
||||||
|
name: 'Clothings',
|
||||||
|
slug: 'clothings',
|
||||||
|
path: '/clothings',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'household',
|
||||||
|
name: 'Household',
|
||||||
|
slug: 'household',
|
||||||
|
path: '/household',
|
||||||
|
},
|
||||||
],
|
],
|
||||||
brands: [],
|
brands: [],
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user