Skip to content

Commit

Permalink
fixing button load
Browse files Browse the repository at this point in the history
  • Loading branch information
boldjoshshea committed Dec 13, 2024
1 parent fe44f73 commit d263b12
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions ViewModel/ExpressPay.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@

namespace Bold\CheckoutPaymentBooster\ViewModel;

use Bold\CheckoutPaymentBooster\Model\CheckoutData;
use Bold\CheckoutPaymentBooster\Model\Config;
use Magento\Checkout\Model\CompositeConfigProvider;
use Magento\Checkout\Model\Session;
use Magento\Framework\Exception\LocalizedException;
use Magento\Framework\Exception\NoSuchEntityException;
use Magento\Framework\Serialize\SerializerInterface;
use Magento\Framework\View\Element\Block\ArgumentInterface;
use Magento\Store\Model\StoreManagerInterface;
use Bold\CheckoutPaymentBooster\UI\PaymentBoosterConfigProvider;
use Magento\Checkout\Model\Session;
use Magento\Framework\App\RequestInterface;

class ExpressPay implements ArgumentInterface
Expand All @@ -33,7 +36,12 @@ class ExpressPay implements ArgumentInterface
/**
* @var StoreManagerInterface
*/
private $storeManager;
private $storeManager;

/**
* @var CheckoutData
*/
private $checkoutData;

/**
* @var Config
Expand All @@ -60,6 +68,7 @@ public function __construct(
SerializerInterface $serializer,
Session $checkoutSession,
StoreManagerInterface $storeManager,
CheckoutData $checkoutData,
Config $config,
PaymentBoosterConfigProvider $paymentBoosterConfigProvider,
RequestInterface $request
Expand All @@ -68,6 +77,7 @@ public function __construct(
$this->serializer = $serializer;
$this->checkoutSession = $checkoutSession;
$this->storeManager = $storeManager;
$this->checkoutData = $checkoutData;
$this->config = $config;
$this->paymentBoosterConfigProvider = $paymentBoosterConfigProvider;
$this->request = $request;
Expand All @@ -83,6 +93,7 @@ public function getJsLayout()
$this->jsLayout['checkoutConfig'] = $this->configProvider->getConfig();
}
else {
$this->checkoutData->initCheckoutData();
$this->jsLayout['checkoutConfig'] = $this->paymentBoosterConfigProvider->getConfig();
$this->jsLayout['checkoutConfig']['totalsData'] = [];
$this->jsLayout['checkoutConfig']['quoteData']['entity_id'] = '';
Expand Down Expand Up @@ -120,19 +131,6 @@ private function hasActiveQuote(): bool
return $quote->getId() !== null;
}

/**
* @return string
*/
private function getFullActionName(): string {
$moduleName = $this->request->getModuleName();
$controllerName = $this->request->getControllerName();
$actionName = $this->request->getActionName();

$fullActionName = $moduleName . '_' . $controllerName . '_' . $actionName;

return $fullActionName;
}

/**
* @return bool
*/
Expand Down

0 comments on commit d263b12

Please sign in to comment.