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>
}
Observable<T['payment']>
Get the currently applied payment method of a cart.
Parameter | cartId: T["id"] |
---|---|
Description |
Observable<Partial<T>>
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 |
Observable<void>
Remove the payment method applied to a cart.
Parameter | cartId: T["id"] |
---|---|
Description |