GitHub

DaffCartPaymentServiceInterface

import { DaffCartPaymentServiceInterface } from '@daffodil/cart/driver'

The interface responsible for managing the selected payment method of a cart.

interface DaffCartPaymentServiceInterface<T extends DaffCart = DaffCart> {
  get(cartId: T["id"]): Observable<T['payment']>
  update(
    cartId: T["id"]
    payment: Partial<T["payment"]>
    billingAddress?: Partial<T["billing_address"]>
  ): Observable<Partial<T>>
  remove(cartId: T["id"]): Observable<void>
}

() Methods

get
Observable<T['payment']>

Get the currently applied payment method of a cart.

Parameters
ParametercartId: T["id"]
Description
update
Observable<Partial<T>>

Update the payment method applied to a cart.

If a billing address is provided, the driver will update that simultaneously.

Parameters
ParametercartId: T["id"]
Description
Parameterpayment: Partial
Description
ParameterbillingAddress: Partial
Description
remove
Observable<void>

Remove the payment method applied to a cart.

Parameters
ParametercartId: T["id"]
Description