1414use Adyen \Payment \Helper \Config ;
1515use Adyen \Payment \Helper \Data ;
1616use Adyen \Payment \Helper \Installments ;
17+ use Adyen \Payment \Helper \Locale ;
1718use Adyen \Payment \Logger \AdyenLogger ;
1819use Magento \Backend \Model \Session \Quote ;
1920use Magento \Checkout \Model \Session ;
21+ use Magento \Framework \Exception \LocalizedException ;
22+ use Magento \Framework \Exception \NoSuchEntityException ;
2023use Magento \Framework \View \Element \Template \Context ;
2124
2225class Moto extends \Magento \Payment \Block \Form \Cc
@@ -31,6 +34,11 @@ class Moto extends \Magento\Payment\Block\Form\Cc
3134 */
3235 protected $ adyenHelper ;
3336
37+ /**
38+ * @var Locale
39+ */
40+ protected $ localeHelper ;
41+
3442 /**
3543 * @var \Magento\Framework\App\State
3644 */
@@ -65,10 +73,12 @@ class Moto extends \Magento\Payment\Block\Form\Cc
6573 * @param Context $context
6674 * @param \Magento\Payment\Model\Config $paymentConfig
6775 * @param Data $adyenHelper
68- * @param \Magento\Checkout\Model\ Session $checkoutSession
76+ * @param Session $checkoutSession
6977 * @param Installments $installmentsHelper
7078 * @param AdyenLogger $adyenLogger
7179 * @param Config $configHelper
80+ * @param Quote $backendSession
81+ * @param Locale $localeHelper
7282 */
7383 public function __construct (
7484 Context $ context ,
@@ -78,7 +88,8 @@ public function __construct(
7888 Installments $ installmentsHelper ,
7989 AdyenLogger $ adyenLogger ,
8090 Config $ configHelper ,
81- Quote $ backendSession
91+ Quote $ backendSession ,
92+ Locale $ localeHelper
8293 ) {
8394 parent ::__construct ($ context , $ paymentConfig );
8495 $ this ->adyenHelper = $ adyenHelper ;
@@ -88,10 +99,13 @@ public function __construct(
8899 $ this ->adyenLogger = $ adyenLogger ;
89100 $ this ->configHelper = $ configHelper ;
90101 $ this ->backendSession = $ backendSession ;
102+ $ this ->localeHelper = $ localeHelper ;
91103 }
92104
93105 /**
94106 * @return string
107+ * @throws LocalizedException
108+ * @throws NoSuchEntityException
95109 */
96110 public function getCheckoutEnvironment ()
97111 {
@@ -103,7 +117,7 @@ public function getCheckoutEnvironment()
103117 */
104118 public function getLocale ()
105119 {
106- return $ this ->adyenHelper ->getStoreLocale ($ this ->checkoutSession ->getQuote ()->getStore ()->getId ());
120+ return $ this ->localeHelper ->getStoreLocale ($ this ->checkoutSession ->getQuote ()->getStore ()->getId ());
107121 }
108122
109123 /**
0 commit comments