import { Address, Cart } from '@commercetools/platform-sdk'; import { AddPayment } from '../types/api.type'; import { CartService, CartServiceOptions, GetCart, GetCartByPaymentIdRequest, GetNormalizedShipping, GetOneShippingAddress, GetPaymentAmount, NormalizedShipping } from '../types/cart.type'; import { PaymentAmount } from '../types/payment.type'; /** * Default implementation of the CartService interface. */ export declare class DefaultCartService implements CartService { private ctAPI; private logger; private contextProvider; constructor(opts: CartServiceOptions); getCartByPaymentId(opts: GetCartByPaymentIdRequest): Promise; getCart(opts: GetCart): Promise; getPlannedPaymentAmount(opts: GetPaymentAmount): Promise; getPaymentAmount(opts: GetPaymentAmount): Promise; /** * Get only one shipping address from the cart. If the cart has multiple shipping addresses, it returns the first one. * @param cart * @returns */ getOneShippingAddress(opts: GetOneShippingAddress): Address | undefined; /** * Normalizes the shipping info from the cart. If the cart has a single shipping info, it returns an array with that shipping info. * When the cart has multiple shipping infos, it returns an array with all the shipping infos. * @param opts * @returns */ getNormalizedShipping(opts: GetNormalizedShipping): NormalizedShipping[]; addPayment(opts: AddPayment): Promise; isRecurringCart(cart: Cart): boolean; private calculateTotalPaidAmount; private calculatePaymentAmount; private wasPaymentReverted; private isPaymentApproved; }