Packages
react
providers
CheckoutProvider

CheckoutProvider Component

The CheckoutProvider component creates a context for using a cart line, allowing components to access the CheckoutProvider object from the Storefront API.

Usage

import React from "react";
import { CartLineProvider } from '@airsoko/react;
import { CartItem } from "@airsoko/graphql/api-types";
 
const MyComponent = () => {
 
 
  return <CheckoutProvider line={cartLine}>{/* Your component content */}</CheckoutProvider>;
};
 
export default MyComponent;

Props

NameDescription
CheckoutDataData related to the checkout process.
CouponRepresents a coupon used for discounts.
CouponDiscountTypeEnum representing different types of coupon discounts.
CustomerAddressAddress information for a customer.
PaymentModeRepresents the payment mode for the checkout process.

Components

NameDescription
CheckoutProviderPropsProps for the CheckoutProvider component.

Interfaces

NameDescription
CheckoutStateInterface representing the state of the checkout process.
CheckoutContextValueInterface representing the context value for the checkout process.

Types & Interfaces

NameDescription
DeliveryLocationType representing the delivery location.
DeliveryLocationOptionType representing options for delivery location.
CheckoutType representing the checkout state.
NameDescription
checkoutReducerReducer function for handling checkout state updates.
NameDescription
defaultStateDefault state for the checkout process.