mirror of
https://github.com/vercel/commerce.git
synced 2025-07-26 03:31:23 +00:00
Implement custom checkout (#487)
* Implement custom checkout core * Fix elements on core * Add files to providers * Adapt providers * Update types * Update shopify file * Format files
This commit is contained in:
@@ -6,11 +6,7 @@ export type CheckoutAPI = GetAPISchema<CommerceAPI, CheckoutSchema>
|
||||
|
||||
export type CheckoutEndpoint = CheckoutAPI['endpoint']
|
||||
|
||||
const checkout: CheckoutEndpoint['handlers']['checkout'] = async ({
|
||||
req,
|
||||
res,
|
||||
config,
|
||||
}) => {
|
||||
const submitCheckout: CheckoutEndpoint['handlers']['submitCheckout'] = async ({ req, res, config }) => {
|
||||
try {
|
||||
const html = `
|
||||
<!DOCTYPE html>
|
||||
@@ -47,7 +43,7 @@ const checkout: CheckoutEndpoint['handlers']['checkout'] = async ({
|
||||
}
|
||||
}
|
||||
|
||||
export const handlers: CheckoutEndpoint['handlers'] = { checkout }
|
||||
export const handlers: CheckoutEndpoint['handlers'] = { submitCheckout }
|
||||
|
||||
const checkoutApi = createEndpoint<CheckoutAPI>({
|
||||
handler: checkoutEndpoint,
|
||||
|
@@ -1 +0,0 @@
|
||||
export default function (_commerce: any) {}
|
1
framework/saleor/api/endpoints/customer/address.ts
Normal file
1
framework/saleor/api/endpoints/customer/address.ts
Normal file
@@ -0,0 +1 @@
|
||||
export default function noopApi(...args: any[]): void {}
|
1
framework/saleor/api/endpoints/customer/card.ts
Normal file
1
framework/saleor/api/endpoints/customer/card.ts
Normal file
@@ -0,0 +1 @@
|
||||
export default function noopApi(...args: any[]): void {}
|
1
framework/saleor/api/endpoints/customer/index.ts
Normal file
1
framework/saleor/api/endpoints/customer/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export default function noopApi(...args: any[]): void {}
|
Reference in New Issue
Block a user