Skip to content

Commit

Permalink
Merge pull request #55 from alma/feat/hide_put
Browse files Browse the repository at this point in the history
Feat/hide put
  • Loading branch information
joyet-simon authored Mar 21, 2023
2 parents b52a820 + 857bb8e commit 67a1272
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 28 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ CHANGELOG
v4.2.0
------
* Feat: Add contexte informations for Alma logs
* Feat: Encrypt Alma API key in back-office
* Feat: Add possibility to exclude a product category for Alma payment

v4.1.0
------
Expand Down
2 changes: 1 addition & 1 deletion cartridges/int_alma/package.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"version": "4.1.0",
"version": "4.2.0",
"hooks": "./hooks.json"
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "alma-sfcc-plugin",
"version": "4.1.0",
"version": "4.2.0",
"description": "Alma SFCC integration plugin",
"main": "index.js",
"engines": {
Expand Down
17 changes: 0 additions & 17 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 @@ -228,21 +226,6 @@ exports.addAPIInfo = (file, url, 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
})
);
}
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, merchantId);
updatedSitePref = addOnShippingOption(updatedSitePref, plans);

if (process.env.TOGGLE_REFUND !== REFUND_IS_DISABLED) {
updatedSitePref = addRefundCustomAttributes(updatedSitePref);
Expand Down
7 changes: 0 additions & 7 deletions site_preference_builder/ref/system-objecttype-extensions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,6 @@
<mandatory-flag>false</mandatory-flag>
<externally-managed-flag>false</externally-managed-flag>
</attribute-definition>
<attribute-definition attribute-id="ALMA_On_Shipment_Payment">
<display-name xml:lang="x-default">Pay on shipment</display-name>
<type>boolean</type>
<mandatory-flag>false</mandatory-flag>
<externally-managed-flag>false</externally-managed-flag>
</attribute-definition>
<attribute-definition attribute-id="ALMA_Fragment_Payment">
<display-name xml:lang="x-default">Activate in-page payment when possible</display-name>
<type>boolean</type>
Expand Down Expand Up @@ -101,7 +95,6 @@
<attribute attribute-id="ALMA_APIUrl"/>
<attribute attribute-id="ALMA_APIKey"/>
<attribute attribute-id="ALMA_Merchant_Id"/>
<attribute attribute-id="ALMA_On_Shipment_Payment"/>
<attribute attribute-id="ALMA_Fragment_Payment"/>
<attribute attribute-id="isWidgetEnable"/>
<attribute attribute-id="cartSelector"/>
Expand Down

0 comments on commit 67a1272

Please sign in to comment.