GitHub

DaffCartPaymentServiceInterface

Type

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"]): any
  update(
    cartId: T["id"]
    payment: Partial<T["payment"]>
    billingAddress?: Partial<T["billing_address"]>
  ): any
  remove(cartId: T["id"]): any
}

() Methods

get
any

Get the currently applied payment method of a cart.

Parameters
ParametercartId: T["id"]
Description
update
any

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
any

Remove the payment method applied to a cart.

Parameters
ParametercartId: T["id"]
Description