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>
}
ObservableGet the currently applied payment method of a cart.
| Parameter | cartId: T["id"] |
|---|---|
| Description |
Observable> Update the payment method applied to a cart.
If a billing address is provided, the driver will update that simultaneously.
| Parameter | cartId: T["id"] |
|---|---|
| Description |
| Parameter | payment: Partial |
|---|---|
| Description |
| Parameter | billingAddress: Partial |
|---|---|
| Description |
ObservableRemove the payment method applied to a cart.
| Parameter | cartId: T["id"] |
|---|---|
| Description |