Cart
Magento\Payment\Model\Cart
What it does
This class provides a unified way to collect and manage cart item information from sales models (quotes, orders, invoices, credit memos) for payment processing.
Developers use it when integrating payment gateways that need cart line items, amounts, and totals in a standardized format.
It handles converting sales data into a payment-friendly structure with support for custom items like shipping and discounts as line items.
Public Methods
- getSalesModel()
- addTax()
- setTax()
- getTax()
- addDiscount()
- setDiscount()
- getDiscount()
- addShipping()
- setShipping()
- getShipping()
- addSubtotal()
- getSubtotal()
- addCustomItem()
- getAllItems()
- getAmounts()
- setTransferShippingAsItem()
- setTransferDiscountAsItem()