Skip to content

Commit b8c492b

Browse files
committed
[EPC-9644] Remove unnecessary variable for the payment method code
1 parent e7aff69 commit b8c492b

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

view/adminhtml/templates/form/moto.phtml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
/**
1414
* @var \Adyen\Payment\Block\Form\Moto $block
1515
*/
16-
$code = $block->escapeHtml($block->getMethodCode());
1716
$ccType = $block->getInfoData('cc_type');
1817
$ccExpMonth = $block->getInfoData('cc_exp_month');
1918
$ccExpYear = $block->getInfoData('cc_exp_year');
@@ -22,20 +21,20 @@ $motoMerchantAccounts = $block->getMotoMerchantAccounts();
2221
?>
2322

2423
<fieldset class="admin__fieldset payment-method"
25-
id="payment_form_<?= /* @noEscape */ $code; ?>"
24+
id="payment_form_adyen_moto"
2625
style="display:none">
2726

28-
<input name="payment[stateData]" id="<?= /* @noEscape */ $code; ?>-statedata" type="hidden">
29-
<input name="payment[motoMerchantAccount]" id="<?= /* @noEscape */ $code; ?>-merchant-account" type="hidden">
27+
<input name="payment[stateData]" id="adyen_moto-statedata" type="hidden">
28+
<input name="payment[motoMerchantAccount]" id="adyen_moto-merchant-account" type="hidden">
3029

31-
<label for="<?= /* @noEscape */ $code; ?>_merchant_accounts" class="admin__field-label">
30+
<label for="adyen_moto_merchant_accounts" class="admin__field-label">
3231
<span>
3332
<?= $escaper->escapeHtml(__('MOTO Merchant Account')) ?>
3433
</span>
3534
</label>
3635
<?php if ($motoMerchantAccounts): ?>
3736
<div class="admin__field-control">
38-
<select id="<?= /* @noEscape */ $code; ?>_merchant_accounts" class="required-entry admin__control-select">
37+
<select id="adyen_moto_merchant_accounts" class="required-entry admin__control-select">
3938
<option value=""><?= $escaper->escapeHtml(__('Please select...')) ?></option>
4039
<?php foreach ($motoMerchantAccounts as $key => $value): ?>
4140
<option value="<?= $escaper->escapeHtmlAttr($key) ?>" data-adyen-client-key="<?= $escaper->escapeHtmlAttr($value['clientkey']) ?>"><?= $escaper->escapeHtml($key) ?></option>
@@ -47,7 +46,7 @@ $motoMerchantAccounts = $block->getMotoMerchantAccounts();
4746
<?= $escaper->escapeHtml(__('No Adyen MOTO merchant account found. Please configure MOTO merchant accounts in the plugin configuration page.')) ?>
4847
</p>
4948
<?php endif ?>
50-
<div id="cardContainer-<?= /* @noEscape */ $code; ?>" style=""></div>
49+
<div id="cardContainer-adyen_moto" style=""></div>
5150

5251
<?php
5352
$availableCcTypesByAlt = json_encode($block->getCcAvailableTypesByAlt());
@@ -85,7 +84,7 @@ $motoMerchantAccounts = $block->getMotoMerchantAccounts();
8584
return "";
8685
}
8786
88-
var cardNode = document.getElementById("cardContainer-$code");
87+
var cardNode = document.getElementById("cardContainer-adyen_moto");
8988
9089
var checkout = await AdyenCheckout({
9190
clientKey: clientKey,
@@ -107,7 +106,7 @@ $motoMerchantAccounts = $block->getMotoMerchantAccounts();
107106
amount: amount,
108107
onChange: function (state) {
109108
if (state.isValid) {
110-
$('#$code-statedata').val(JSON.stringify(state.data));
109+
$('#adyen_moto-statedata').val(JSON.stringify(state.data));
111110
}
112111
}
113112
});
@@ -131,7 +130,7 @@ $motoMerchantAccounts = $block->getMotoMerchantAccounts();
131130
'renderCheckoutComponent',
132131
],
133132
function ($, renderCheckoutComponent) {
134-
$("#${code}_merchant_accounts").on("change", function () {
133+
$("#adyen_moto_merchant_accounts").on("change", function () {
135134
if (renderCheckoutComponent.status() !== null) {
136135
renderCheckoutComponent.unmount();
137136
}
@@ -146,7 +145,7 @@ $motoMerchantAccounts = $block->getMotoMerchantAccounts();
146145
return;
147146
}
148147
149-
$("#${code}-merchant-account").val(merchantAccount);
148+
$("#adyen_moto-merchant-account").val(merchantAccount);
150149
renderCheckoutComponent.init(clientKey, amount, installmentAmounts);
151150
});
152151
}

0 commit comments

Comments
 (0)