diff --git a/framework/commerce/api/endpoints/checkout.ts b/framework/commerce/api/endpoints/checkout.ts index 09ebff621..b00bce284 100644 --- a/framework/commerce/api/endpoints/checkout.ts +++ b/framework/commerce/api/endpoints/checkout.ts @@ -26,7 +26,7 @@ const checkoutEndpoint: GetAPISchema< // Create checkout if (req.method === 'GET') { const body = { ...req.body, cartId } - return await handlers['getCheckout']({ ...ctx, body }) + return await handlers['getCheckout']?.({ ...ctx, body }) } // Create checkout diff --git a/framework/commerce/types/checkout.ts b/framework/commerce/types/checkout.ts index 27f553207..ea28926a8 100644 --- a/framework/commerce/types/checkout.ts +++ b/framework/commerce/types/checkout.ts @@ -45,7 +45,7 @@ export type SubmitCheckoutHandler = } export type CheckoutHandlers = { - getCheckout: GetCheckoutHandler + getCheckout?: GetCheckoutHandler submitCheckout: SubmitCheckoutHandler } diff --git a/framework/commerce/types/customer/index.ts b/framework/commerce/types/customer/index.ts index 7a99d8c5e..70c437c29 100644 --- a/framework/commerce/types/customer/index.ts +++ b/framework/commerce/types/customer/index.ts @@ -2,7 +2,7 @@ export * as Card from "./card" export * as Address from "./address" // TODO: define this type -export type Customer = unknown +export type Customer = any export type CustomerTypes = { customer: Customer