File

feature-libs/checkout/core/connectors/delivery/checkout-delivery.adapter.ts

Index

Methods

Methods

Abstract createAddress
createAddress(userId: string, cartId: string, address: Address)

Abstract method used to create address in cart

Parameters :
Name Type Optional
userId string No
cartId string No
address Address No
Returns : Observable<Address>
Abstract getMode
getMode(userId: string, cartId: string)

Abstract method used to get current delivery mode from cart

Parameters :
Name Type Optional
userId string No
cartId string No
Returns : Observable<DeliveryMode>
Abstract getSupportedModes
getSupportedModes(userId: string, cartId: string)

Abstract method used to get supported delivery modes for cart

Parameters :
Name Type Optional
userId string No
cartId string No
Returns : Observable<DeliveryMode[]>
Abstract setAddress
setAddress(userId: string, cartId: string, addressId: string)

Abstract method used to set adress for delivery

Parameters :
Name Type Optional
userId string No
cartId string No
addressId string No
Returns : Observable<any>
Abstract setMode
setMode(userId: string, cartId: string, deliveryModeId: string)

Abstract method used to set delivery mode on cart

Parameters :
Name Type Optional
userId string No
cartId string No
deliveryModeId string No
Returns : Observable<any>
import { Address, DeliveryMode } from '@spartacus/core';
import { Observable } from 'rxjs';

export abstract class CheckoutDeliveryAdapter {
  /**
   * Abstract method used to create address in cart
   *
   * @param userId
   * @param cartId
   * @param address
   */
  abstract createAddress(
    userId: string,
    cartId: string,
    address: Address
  ): Observable<Address>;

  /**
   * Abstract method used to set adress for delivery
   *
   * @param userId
   * @param cartId
   * @param addressId
   */
  abstract setAddress(
    userId: string,
    cartId: string,
    addressId: string
  ): Observable<any>;

  /**
   * Abstract method used to set delivery mode on cart
   *
   * @param userId
   * @param cartId
   * @param deliveryModeId
   */
  abstract setMode(
    userId: string,
    cartId: string,
    deliveryModeId: string
  ): Observable<any>;

  /**
   * Abstract method used to get current delivery mode from cart
   *
   * @param userId
   * @param cartId
   */
  abstract getMode(userId: string, cartId: string): Observable<DeliveryMode>;

  /**
   * Abstract method used to get supported delivery modes for cart
   *
   * @param userId
   * @param cartId
   */
  abstract getSupportedModes(
    userId: string,
    cartId: string
  ): Observable<DeliveryMode[]>;
}

result-matching ""

    No results matching ""