Skip to content

Commit

Permalink
feat: INT-1453 hide put field in BO
Browse files Browse the repository at this point in the history
  • Loading branch information
joyet-simon committed Mar 20, 2023
1 parent 0eb6924 commit 8f69576
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 25 deletions.
23 changes: 0 additions & 23 deletions site_preference_builder/customSitePrefBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ if (locale !== 'en_GB' && fs.existsSync(path.join(__dirname, `messages-${locale}

const messages = require(localisationFile);

const { merchantHasOnShipment } = require('./jobs');

// we also remove 1x that isn't deferred, as the api will provide it, but we don't want to display it
const filterAllowedPlan = (plan) => {
return plan.allowed && !(plan.installments_count === 1 && plan.deferred_days === 0);
Expand Down Expand Up @@ -229,27 +227,6 @@ exports.addAPIInfo = (file, url, key, merchantId) => {
return file;
};

exports.addOnShippingOption = (file, plans) => {
if (merchantHasOnShipment(plans)) {
file.metadata['type-extension'][2]['custom-attribute-definitions'][0]['attribute-definition'].push(
buildCustomSitePrefObject({
id: 'ALMA_On_Shipment_Payment',
name: 'Pay on shipping',
type: 'boolean',
mandatory: false,
externallyManaged: false
})
);
file.metadata['type-extension'][2]['group-definitions'][0]['attribute-group'][0].attribute.push(
{
$: {
'attribute-id': 'ALMA_On_Shipment_Payment'
}
});
}
return file;
};

exports.addCustomAttrFromPlan = (file, plans) => {
plans
.filter(filterAllowedPlan)
Expand Down
2 changes: 0 additions & 2 deletions site_preference_builder/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ const {
addCustomGroupFromPlan,
addFeePlans,
addAPIInfo,
addOnShippingOption,
addRefundCustomAttributes,
addRefundCustomAttributesGroup
} = require('./customSitePrefBuilder.js');
Expand Down Expand Up @@ -70,7 +69,6 @@ async function main() {
updatedSitePref = addCustomGroupFromPlan(updatedSitePref, plans);
updatedSitePref = addFeePlans(updatedSitePref, plans);
updatedSitePref = addAPIInfo(updatedSitePref, url, apiKey, merchantId);
updatedSitePref = addOnShippingOption(updatedSitePref, plans);

if (process.env.TOGGLE_REFUND !== REFUND_IS_DISABLED) {
updatedSitePref = addRefundCustomAttributes(updatedSitePref);
Expand Down

0 comments on commit 8f69576

Please sign in to comment.