ProviderProps
The prop types that CentraProvider accepts
CentraProvider
React Context provider that is required to use the useCentra and useCentraHandlers hooks.
Provides state management and related handlers of the users current Centra selection via the Checkout API.
The handlers could be used for adding products to the selection and making purchases, for example.
- @param
props- Provider configuration and child content. - @returns The Centra context providers.
useCentraSelection
This hook returns the centra selection
- @returns The current Centra selection context.
useCentraHandlers
This hook returns update handlers
- @returns The current Centra handler methods.
useCentraReceipt
Returns the latest order receipt given a selection token
- @param
token- Selection token used to fetch the receipt. - @returns The latest receipt response.
useCentraOrders
Returns the latest orders for the currently logged in user
- @param
from- Display orders from this index. Defaults to 0. - @param
size- Display this many orders. Defaults lists all orders. - @param
apiClient- API client used to fetch orders. - @returns The current orders response.