Skip to content

Commit

Permalink
AM-109_Default_payment
Browse files Browse the repository at this point in the history
- function isAdyenPaymentOxChecked() added to check if adyenCreditcard has flag oxpayments__oxchecked
- if oxpayments__oxchecked (fnc) is true, then in tpl the jsVar (paymentIdEl.checked) will be setup to true, else to false
  • Loading branch information
EmanueleAcito committed Jan 11, 2024
1 parent 4c74800 commit aded1bf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/Core/ViewConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Check failure on line 114 in src/Core/ViewConfig.php

View workflow job for this annotation

GitHub Actions / styles (8.0)

Access to an undefined property OxidEsales\Eshop\Application\Model\Payment::$oxpayments__oxchecked.
}

/**
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
Expand Down
2 changes: 1 addition & 1 deletion views/frontend/tpl/payment/adyen_assets.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit aded1bf

Please sign in to comment.