59 private $paymentFailures;
75 \
Magento\Checkout\Model\Session $checkoutSession,
76 \
Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate,
77 \
Magento\Framework\Mail\Template\TransportBuilder $transportBuilder,
83 $this->_checkoutSession = $checkoutSession;
84 $this->_localeDate = $localeDate;
85 $this->_transportBuilder = $transportBuilder;
89 ->get(PaymentFailuresInterface::class);
90 parent::__construct($context);
121 return $this->priceCurrency->format(
137 ? $this->priceCurrency->convertAndFormat(
$price)
138 : $this->priceCurrency->convert(
$price);
148 return (
bool)$this->scopeConfig->getValue(
149 'checkout/options/onepage_checkout_enabled',
162 if (
$item->getPriceInclTax()) {
163 return $item->getPriceInclTax();
165 $qty =
$item->getQty() ?
$item->getQty() : (
$item->getQtyOrdered() ?
$item->getQtyOrdered() : 1);
168 return $this->priceCurrency->round(
$price);
179 if (
$item->getRowTotalInclTax()) {
180 return $item->getRowTotalInclTax();
182 $tax =
$item->getTaxAmount() +
$item->getDiscountTaxCompensation();
192 $qty =
$item->getQty() ?
$item->getQty() : (
$item->getQtyOrdered() ?
$item->getQtyOrdered() : 1);
195 return $this->priceCurrency->round(
$price);
204 $tax =
$item->getBaseTaxAmount() +
$item->getBaseDiscountTaxCompensation();
217 \
Magento\Quote\Model\Quote $checkout,
219 string $checkoutType =
'onepage' 221 $this->paymentFailures->handle((
int)$checkout->getId(),
$message, $checkoutType);
233 $data = $this->scopeConfig->getValue(
239 return explode(
',',
$data);
257 $guestCheckout = $this->scopeConfig->isSetFlag(
258 self::XML_PATH_GUEST_CHECKOUT,
263 if ($guestCheckout ==
true) {
264 $result = new \Magento\Framework\DataObject();
265 $result->setIsAllowed($guestCheckout);
266 $this->_eventManager->dispatch(
267 'checkout_allow_guest',
271 $guestCheckout =
$result->getIsAllowed();
274 return $guestCheckout;
285 return $this->_request->getParam(
'context') ==
'checkout';
296 return $this->scopeConfig->isSetFlag(
297 self::XML_PATH_CUSTOMER_MUST_BE_LOGGED,
309 return (
bool) !$this->scopeConfig->getValue(
310 'checkout/options/display_billing_address_on',
const XML_PATH_CUSTOMER_MUST_BE_LOGGED
getSubtotalInclTax($item)
const XML_PATH_GUEST_CHECKOUT
sendPaymentFailedEmail(\Magento\Quote\Model\Quote $checkout, string $message, string $checkoutType='onepage')
getBaseSubtotalInclTax($item)
_getEmails($configPath, $storeId)
isDisplayBillingOnPaymentMethodAvailable()
convertPrice($price, $format=true)
__construct(\Magento\Framework\App\Helper\Context $context, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Checkout\Model\Session $checkoutSession, \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, \Magento\Framework\Mail\Template\TransportBuilder $transportBuilder, \Magento\Framework\Translate\Inline\StateInterface $inlineTranslation, PriceCurrencyInterface $priceCurrency, PaymentFailuresInterface $paymentFailures=null)
getBasePriceInclTax($item)
isAllowedGuestCheckout(\Magento\Quote\Model\Quote $quote, $store=null)