Options
All
  • Public
  • Public/Protected
  • All
Menu

Class GetShoppingCart

Implements GetShoppingCart fetch for the Redux store

export

Hierarchy

Index

Constructors

constructor

Properties

actions

actions: {}

The actions for the fetchable data

memberof

StoreFetchableData

Type declaration

  • [key: string]: any

changes$

changes$: Subject<IShoppingCartChange[]>

The changes feed

memberof

GetShoppingCart

completedOrder$

completedOrder$: Subject<OrderDto>

Completed checkout order stream

memberof

EvaCheckoutProvider

defaultCheckoutStartSteps

defaultCheckoutStartSteps: TCheckoutSteps[]

The recommended steps to check for validity when starting a checkout

memberof

GetShoppingCart

Protected dispatchCount

dispatchCount: number = 0

The dispatch count. Used for the dispatchId

memberof

StoreFetchableData

Protected Optional fetchOptions

fetchOptions: any

name

name: string

The store section name Used to name the rootState member and postfixed to all actions

memberof

StoreFetchableData

reducer

reducer: Reducer<IGetShoppingCartState>

The reducers for the fetchable data

memberof

StoreFetchableData

Protected Optional requestOptions

Protected url

url: string

The url to fetch the data from

Accessors

initialState

Methods

canStartPayment

completeCheckout

  • Try to complete the checkout if the state of the order allows it Will call startNewCart() when possible and emit the completed order

    memberof

    EvaCheckoutProvider

    Parameters

    • order: OrderDto
    • Default value createNewCartOnCompletion: boolean = false
    • Default value partialShipping: boolean = false

    Returns Promise<ICheckoutOperationResult>

createFetchAction

  • Create a fetch action using the class request type This helper will setup and add promises for the fetch call and any chain that is triggered

    TODO: If typings provide optional-ness correctly we can remove the Partial

    NOTE: omitSessionId is deprecated but remains to not mess up parameter ordering

    memberof

    StoreFetchableData

    Parameters

    • Optional request: Partial<GetShoppingCart>
    • Default value chainStarter: string = this.name
    • Optional timeout: undefined | number
    • Default value omitSessionIdDeprecated: boolean = false
    • Optional elevationToken: undefined | string
    • Optional serviceContext: undefined | string
    • Optional chainContext: undefined | string

    Returns [AnyAction, Promise<ShoppingCartResponse>, Promise<TGetShoppingCartChainData>]

createResponseAction

  • createResponseAction(response?: RES): any

fetchData

  • fetchData(action: any, timeout?: undefined | number, authorisationToken?: undefined | string, endPointURL?: undefined | string): Promise<ShoppingCartResponse>

getError$

  • getError$(): Observable<Error | null>

getOrder$

getPropertyState$

  • getPropertyState$(propertyPath: string | string[]): Observable<any>

Protected getReducerFunctions

  • getReducerFunctions(): {}

getRequest$

getResponse$

getState

getState$

getUrl

  • getUrl(): string

isFetching$

  • isFetching$(): Observable<boolean>

performCheckout

  • This method will try to proceed the checkout by performing wrap-up actions such as placing and shipping the order. Depending on state and requirement issues this might fail. This method may call itself multiple times to keep typing to proceed with the checkout

    memberof

    EvaCheckoutProvider

    Parameters

    • Default value options: ICheckoutOptions = {}
    • Optional recursionSource: undefined | string

    Returns Promise<ICheckoutOperationResult>

saga

  • saga(): Generator<ForkEffect, void, unknown>

startCheckout

  • startCheckout(stepsToCheck?: ("customer" | "productRequirements" | "productBundles" | "discountProduct" | "serialNumber" | "insurance" | "employeeVerification" | "verifyCustomer" | "interbranch" | "returnToSupplier" | "billingAddress" | "shippingAddress" | "createOrder" | "payOrder" | "placeOrder" | "shipOrder" | "produceDocuments")[]): Promise<ICheckoutOperationResult>
  • Checks if it is possible to start the checkout for the current shopping cart and performs the necessary actions if so On success this means the App con proceed to the checkout page/UI

    The list of preCheckoutRequired steps is enforced here. If required steps are valid createOrder will be called if needed

    memberof

    EvaCheckoutProvider

    Parameters

    • Default value stepsToCheck: ("customer" | "productRequirements" | "productBundles" | "discountProduct" | "serialNumber" | "insurance" | "employeeVerification" | "verifyCustomer" | "interbranch" | "returnToSupplier" | "billingAddress" | "shippingAddress" | "createOrder" | "payOrder" | "placeOrder" | "shipOrder" | "produceDocuments")[] = this.defaultCheckoutStartSteps

    Returns Promise<ICheckoutOperationResult>

timeout

  • timeout(ms: number): Promise<any>