4
0
forked from crowetic/commerce
Gonzalo Pozzo 1720bd698c
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
2021-09-22 19:20:58 -05:00

19 lines
595 B
TypeScript

import { GetAPISchema, createEndpoint } from '@commerce/api'
import checkoutEndpoint from '@commerce/api/endpoints/checkout'
import type { CheckoutSchema } from '../../../types/checkout'
import type { ShopifyAPI } from '../..'
import submitCheckout from './submit-checkout'
export type CheckoutAPI = GetAPISchema<ShopifyAPI, CheckoutSchema>
export type CheckoutEndpoint = CheckoutAPI['endpoint']
export const handlers: CheckoutEndpoint['handlers'] = { submitCheckout }
const checkoutApi = createEndpoint<CheckoutAPI>({
handler: checkoutEndpoint,
handlers,
})
export default checkoutApi