payvault-react
Enumerations
Classes
Interfaces
- ApiKey
- AtButtonProps
- CartContextProps
- CartItem
- CreateApiKeyRequest
- CreateApiKeyResponse
- CreateCartRequest
- CreateCartResponse
- OneClickCheckoutProps
- PayVaultConstructorProps
- PayVaultContextProps
- PayVaultProviderProps
- PayVaultStoreProviderProps
- StoreContextProps
- StoreDetailsUpdate
- UseOneClickCheckoutResponse
Type Aliases
AtButtonVariant
Ƭ AtButtonVariant: keyof typeof AT_BUTTON_VARIANT
Defined in
components/atoms/at-button/index.tsx:8
Product
Ƭ Product: Object
Type declaration
| Name | Type |
|---|---|
active | boolean |
createdAt | string |
description? | string |
id | number |
imageUrl? | string | null |
inventory | number |
name | string |
packageDimensions | null |
price | string | number |
revenue | string |
shippable | null |
sold | number |
storeId | string |
unitLabel | null |
updatedAt | string |
url | null |
Defined in
ProductCreateRequest
Ƭ ProductCreateRequest: Pick<Product, "price" | "description" | "name">
Defined in
StoreDetails
Ƭ StoreDetails: Object
Type declaration
| Name | Type |
|---|---|
apiKeys? | ApiKey[] |
createdAt | string |
description | string |
id | string |
logoUrl | string | null |
name | string |
products | Product[] |
updatedAt | string |
users? | User[] |
Defined in
User
Ƭ User: Object
Type declaration
| Name | Type |
|---|---|
email | string |
emailVerified | null |
id | string |
image | string |
name | string |
Defined in
Variables
AT_BUTTON_VARIANT
• Const AT_BUTTON_VARIANT: Object
Type declaration
| Name | Type |
|---|---|
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
StoreContext
• Const StoreContext: Context<StoreContextProps>
Defined in
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
| Name | Type |
|---|---|
«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
| Name | Type |
|---|---|
«destructured» | Object |
› children | ReactNode |
› client | PayVault |
Returns
Element
Defined in
PayVaultProvider
▸ PayVaultProvider(props): Element
A provider component that sets up the QueryClient and PayVaultStoreProvider.
Parameters
| Name | Type | Description |
|---|---|---|
props | PayVaultProviderProps | The 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
| Name | Type | Description |
|---|---|---|
props | Object | An object containing the children and client properties. |
props.children | ReactNode | - |
props.client | PayVaultConstructorProps | PayVault | - |
Returns
Element
The PayVaultStoreProvider component with the provided children.
Defined in
useCart
▸ useCart(): CartContextProps
A custom hook that returns the CartContext.
Returns
Defined in
useClient
▸ useClient(): PayVault
Hook to retrieve the store client
Returns
Defined in
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
| Name | Type | Description |
|---|---|---|
props | OneClickCheckoutProps | The input parameters for the hook. |
Returns
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
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
| Name | Type | Description |
|---|---|---|
props | Object | An object containing the productId property. |
props.productId | string | 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
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
| Name | Type | Description |
|---|---|---|
props? | Object | An 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
useStore
▸ useStore(): StoreContextProps
Hook to interact with the Store context