Skip to main content

payvault-react

Enumerations

Classes

Interfaces

Type Aliases

AtButtonVariant

Ƭ AtButtonVariant: keyof typeof AT_BUTTON_VARIANT

Defined in

components/atoms/at-button/index.tsx:8


Product

Ƭ Product: Object

Type declaration

NameType
activeboolean
createdAtstring
description?string
idnumber
imageUrl?string | null
inventorynumber
namestring
packageDimensionsnull
pricestring | number
revenuestring
shippablenull
soldnumber
storeIdstring
unitLabelnull
updatedAtstring
urlnull

Defined in

types.ts:86


ProductCreateRequest

Ƭ ProductCreateRequest: Pick<Product, "price" | "description" | "name">

Defined in

types.ts:105


StoreDetails

Ƭ StoreDetails: Object

Type declaration

NameType
apiKeys?ApiKey[]
createdAtstring
descriptionstring
idstring
logoUrlstring | null
namestring
productsProduct[]
updatedAtstring
users?User[]

Defined in

types.ts:71


User

Ƭ User: Object

Type declaration

NameType
emailstring
emailVerifiednull
idstring
imagestring
namestring

Defined in

types.ts:107

Variables

AT_BUTTON_VARIANT

Const AT_BUTTON_VARIANT: Object

Type declaration

NameType
PRIMARY"primary"
SECONDARY"secondary"
TERTIARY"tertiary"

Defined in

components/atoms/at-button/index.tsx:3


CartContext

Const CartContext: Context<CartContextProps>

A context object created using React's createContext function. It provides default values for the CartContextProps interface.

Defined in

hooks/useCart.tsx:65


StoreContext

Const StoreContext: Context<StoreContextProps>

Defined in

hooks/useStore.tsx:60


queryClient

Const queryClient: QueryClient

Defined in

components/providers/PayVaultProvider.tsx:28


variantClasses

Const variantClasses: Record<AtButtonVariant, string>

Defined in

components/atoms/at-button/index.tsx:10

Functions

AtButton

AtButton(«destructured»): Element

Parameters

NameType
«destructured»AtButtonProps

Returns

Element

Defined in

components/atoms/at-button/index.tsx:22


MlBanner

MlBanner(): Element

Returns

Element

Defined in

components/molecules/ml-banner/index.tsx:1


OrFooter

OrFooter(): Element

Returns

Element

Defined in

components/organisms/or-footer/index.tsx:1


PayVaultCartProvider

PayVaultCartProvider(«destructured»): Element

Context provider that manages the state and functions related to the shopping cart. It accepts children as React nodes and a client as a PayVault instance.

Parameters

NameType
«destructured»Object
› childrenReactNode
› clientPayVault

Returns

Element

Defined in

hooks/useCart.tsx:94


PayVaultProvider

PayVaultProvider(props): Element

A provider component that sets up the QueryClient and PayVaultStoreProvider.

Parameters

NameTypeDescription
propsPayVaultProviderPropsThe properties for the provider component.

Returns

Element

The provider component with the QueryClient and PayVaultStoreProvider setup.

Defined in

components/providers/PayVaultProvider.tsx:58


PayVaultStoreProvider

PayVaultStoreProvider(props): Element

A React context provider component for managing the PayVault store state.

Parameters

NameTypeDescription
propsObjectAn object containing the children and client properties.
props.childrenReactNode-
props.clientPayVaultConstructorProps | PayVault-

Returns

Element

The PayVaultStoreProvider component with the provided children.

Defined in

hooks/useStore.tsx:75


useCart

useCart(): CartContextProps

A custom hook that returns the CartContext.

Returns

CartContextProps

Defined in

hooks/useCart.tsx:85


useClient

useClient(): PayVault

Hook to retrieve the store client

Returns

PayVault

Defined in

hooks/useClient.tsx:4


useOneClickCheckout

useOneClickCheckout(props): UseOneClickCheckoutResponse

A custom hook that simplifies the process of adding a product to the cart and optionally redirecting the user to the cart page.

Parameters

NameTypeDescription
propsOneClickCheckoutPropsThe input parameters for the hook.

Returns

UseOneClickCheckoutResponse

An object containing the triggerCheckout function and the cart properties without the createCheckout function.

Defined in

hooks/useOneClickCheckout.tsx:44


usePayVaultContext

usePayVaultContext(): PayVaultContextProps

A custom hook to access the PayVaultContext.

Returns

PayVaultContextProps

The PayVaultContext properties.

Defined in

components/providers/PayVaultProvider.tsx:48


useProduct

useProduct(props): { product: undefined | Product } | { product: undefined | Product } | { product: undefined | Product } | { product: undefined | Product }

A custom hook that fetches a single product based on the provided product ID.

Parameters

NameTypeDescription
propsObjectAn object containing the productId property.
props.productIdstring | number-

Returns

{ product: undefined | Product } | { product: undefined | Product } | { product: undefined | Product } | { product: undefined | Product }

An object containing the fetched product and additional query details.

Defined in

hooks/useProducts.tsx:49


useProducts

useProducts(props?): { products: undefined | Product[] } | { products: undefined | Product[] } | { products: undefined | Product[] } | { products: undefined | Product[] }

A custom hook that fetches products based on the provided product IDs. If no product IDs are provided, it fetches all products.

Parameters

NameTypeDescription
props?ObjectAn object containing the optional productIds property.
props.productIds?(string | number)[]-

Returns

{ products: undefined | Product[] } | { products: undefined | Product[] } | { products: undefined | Product[] } | { products: undefined | Product[] }

An object containing the fetched products and additional query details.

Defined in

hooks/useProducts.tsx:13


useStore

useStore(): StoreContextProps

Hook to interact with the Store context

Returns

StoreContextProps

Defined in

hooks/useStore.tsx:67