Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
I am developing a Magento 2 Payment Gateway
now I need to get order total to make the payment
how to get it on Magento 2 using Magento Cart Models?
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$cart = $objectManager->get('\Magento\Checkout\Model\Cart');
$grandTotal = $cart->getQuote()->getGrandTotal();
You can get the subtotal using following code :
public function collectRates(RateRequest $request)
Required, but never shown