Skip to content

Commit

Permalink
Remove conditional cardholdername logic (#1137)
Browse files Browse the repository at this point in the history
* fix: removing conditional cardholder name logic and metadata as it is not required anymore

* chore: updated the unit test
  • Loading branch information
zenit2001 authored Aug 12, 2024
1 parent 1f2d40e commit 6447a6f
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 35 deletions.
8 changes: 0 additions & 8 deletions metadata/site_import/meta/system-objecttype-extensions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -407,13 +407,6 @@
<externally-managed-flag>false</externally-managed-flag>
<default-value>true</default-value>
</attribute-definition>
<attribute-definition attribute-id="AdyenCardHolderName_enabled">
<display-name xml:lang="x-default">Show input field for card holder name</display-name>
<type>boolean</type>
<mandatory-flag>false</mandatory-flag>
<externally-managed-flag>false</externally-managed-flag>
<default-value>true</default-value>
</attribute-definition>
<attribute-definition attribute-id="AdyenLevel23DataEnabled">
<display-name xml:lang="x-default">Level 2/3 Data Authorisation Enabled</display-name>
<type>boolean</type>
Expand Down Expand Up @@ -704,7 +697,6 @@
<attribute attribute-id="AdyenCreditCardInstallments"/>
<attribute attribute-id="AdyenBasketFieldsEnabled"/>
<attribute attribute-id="AdyenLevel23DataEnabled"/>
<attribute attribute-id="AdyenCardHolderName_enabled"/>
<attribute attribute-id="AdyenLevel23_CommodityCode"/>
<attribute attribute-id="AdyenSalePaymentMethods"/>
<attribute attribute-id="AdyenInstallments_enabled"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ $('#dwfrm_billing').submit(function apiRequest(e) {
});

setCheckoutConfiguration();
if (window.cardholderNameBool !== 'null') {
store.checkoutConfiguration.paymentMethodsConfiguration.card.hasHolderName = true;
store.checkoutConfiguration.paymentMethodsConfiguration.card.holderNameRequired = true;
}

if (
window.googleMerchantID !== 'null' &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
<script>
window.installments = '${pdict.adyen.installments}';
window.googleMerchantID = '${pdict.adyen.googleMerchantID}';
window.cardholderNameBool = '${pdict.adyen.cardholderNameBool}';
window.merchantAccount = '${pdict.adyen.merchantAccount}';
window.customerEmail = '${customer && customer.profile && customer.profile.email ? customer.profile.email : ''}';
var showStoreDetails = ${customer.authenticated && adyenRecurringPaymentsEnabled};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,6 @@
<div class="first-subtitle">Choose additional payment features you want to offer to your shoppers.</div>
</h7>
<div class="mt-2">
<div class="form-group">
<label class="form-title mb-0" for="cardHolderNameEnabled">Cardholder’s name</label>
<small id="cardHolderNameEnabledHelp" class="form-text mb-1">This allows you to show the input field for the cardholder’s name. </small>
<div class="radio-buttons">
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="AdyenCardHolderName_enabled" id="cardHolderYes" value=true ${AdyenConfigs.getAdyenCardholderNameEnabled() ? 'checked': ''}>
<label class="form-check-label" for="cardHolderYes">Enable</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="AdyenCardHolderName_enabled" id="cardHolderNo" value=false ${!AdyenConfigs.getAdyenCardholderNameEnabled() ? 'checked': ''}>
<label class="form-check-label" for="cardHolderNo">Disable</label>
</div>
</div>
</div>
<div class="form-group">
<div class='row'>
<div class="switch-button">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,6 @@ const adyenConfigsObj = {
return getCustomPreference('AdyenBasketFieldsEnabled');
},

getAdyenCardholderNameEnabled: function () {
return getCustomPreference('AdyenCardHolderName_enabled');
},

getAdyenLevel23DataEnabled: function () {
return getCustomPreference('AdyenLevel23DataEnabled');
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ exports[`Begin should not attempt to restore cart when no order number is cached
"adyen": {
"SFRA6Enabled": false,
"adyenClientKey": "mocked_client_key",
"cardholderNameBool": true,
"clientKey": "mocked_client_key",
"environment": "test",
"googleMerchantID": "mocked_google_merchant_id",
Expand All @@ -26,7 +25,6 @@ exports[`Begin should set view data 1`] = `
"adyen": {
"SFRA6Enabled": false,
"adyenClientKey": "mocked_client_key",
"cardholderNameBool": true,
"clientKey": "mocked_client_key",
"environment": "test",
"googleMerchantID": "mocked_google_merchant_id",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ function begin(req, res, next) {
const adyenClientKey = AdyenConfigs.getAdyenClientKey();
const googleMerchantID = AdyenConfigs.getGoogleMerchantID();
const merchantAccount = AdyenConfigs.getAdyenMerchantAccount();
const cardholderNameBool = AdyenConfigs.getAdyenCardholderNameEnabled();
const SFRA6Enabled = AdyenConfigs.getAdyenSFRA6Compatibility();

const viewData = res.getViewData();
Expand All @@ -77,7 +76,6 @@ function begin(req, res, next) {
installments,
googleMerchantID,
merchantAccount,
cardholderNameBool,
adyenClientKey,
SFRA6Enabled,
};
Expand Down

0 comments on commit 6447a6f

Please sign in to comment.