priceCurrency = $priceCurrency; } /** * Check whether method is available * * @param \Magento\Quote\Api\Data\CartInterface|\Magento\Quote\Model\Quote|null $quote * @return bool */ public function isAvailable(\Magento\Quote\Api\Data\CartInterface $quote = null) { return parent::isAvailable( $quote ) && null !== $quote && $this->priceCurrency->round( $quote->getGrandTotal() ) == 0; } /** * Check whether method is enabled in config * * @param \Magento\Quote\Model\Quote|null $quote * @return bool */ public function isAvailableInConfig($quote = null) { return parent::isAvailable($quote); } /** * Get config payment action, do nothing if status is pending * * @return string|null */ public function getConfigPaymentAction() { return $this->getConfigData('order_status') == 'pending' ? null : parent::getConfigPaymentAction(); } }