Cart
Magento\Payment\Model\Cart
What it does
The Payment Cart Model is used to collect and organize cart information (items, amounts, taxes, shipping, discounts) from sales entities like quotes or orders for payment processing.
Developers use this class when integrating payment gateways that need structured cart data, as it standardizes how cart information is formatted and transferred to external payment systems.
It provides methods to manipulate amounts and convert special charges like shipping or discounts into line items when required by payment providers.
Public Methods
- getSalesModel()
- addTax()
- setTax()
- getTax()
- addDiscount()
- setDiscount()
- getDiscount()
- addShipping()
- setShipping()
- getShipping()
- addSubtotal()
- getSubtotal()
- addCustomItem()
- getAllItems()
- getAmounts()
- setTransferShippingAsItem()
- setTransferDiscountAsItem()