diff --git a/src/Core/ViewConfig.php b/src/Core/ViewConfig.php index 79dca3ac..dbcfd896 100644 --- a/src/Core/ViewConfig.php +++ b/src/Core/ViewConfig.php @@ -106,6 +106,14 @@ public function isAdyenLoggingActive(): bool return $this->getModuleSettingsSrvc()->isLoggingActive(); } + public function isAdyenPaymentOxChecked(): bool + { + /** @var Payment $oPayment */ + $oPayment = oxNew(Payment::class); + $oPayment->load('oscadyencreditcard'); + return $oPayment->oxpayments__oxchecked->value; + } + /** * @throws ContainerExceptionInterface * @throws NotFoundExceptionInterface diff --git a/views/frontend/tpl/payment/adyen_assets.tpl b/views/frontend/tpl/payment/adyen_assets.tpl index bf1a7451..6eb26f6d 100644 --- a/views/frontend/tpl/payment/adyen_assets.tpl +++ b/views/frontend/tpl/payment/adyen_assets.tpl @@ -95,7 +95,7 @@ const setPaymentIdEl = (component, nextStepElDisabled) => { const paymentIdEl = document.getElementById(component._node.attributes.getNamedItem('data-paymentid').value); - paymentIdEl.checked = true; + paymentIdEl.checked = [{if $oViewConf->isAdyenPaymentOxChecked()}]true[{else}]false[{/if}]; nextStepEl.disabled = nextStepElDisabled; nextStepEl.dataset.adyensubmit = ''; return paymentIdEl;