Skip to content

Commit

Permalink
Merge pull request #98 from alma/feature/ecom-1787-sfcc-gather-cart-d…
Browse files Browse the repository at this point in the history
…ata-from-pnx-and-deferred-payments

Gather cart data from pnx and deferred payments
  • Loading branch information
joyet-simon authored Jun 17, 2024
2 parents 0b19d57 + 8b6696d commit 3e2352b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/aqua.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Run Aqua scanner
uses: docker://aquasec/aqua-scanner
with:
args: trivy fs --sast --reachability --scanners config,vuln,secret .
args: trivy fs --sast --reachability --scanners misconfig,vuln,secret .
# To customize which severities add the following flag: --severity UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL
# To enable SAST scanning, add: --sast
# To enable reachability scanning, add: --reachability
Expand Down
28 changes: 14 additions & 14 deletions cartridges/int_alma/cartridge/scripts/helpers/almaPaymentHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -410,20 +410,20 @@ function buildPaymentData(installmentsCount, deferredDays, locale, isManualCaptu
paymentData.payment.capture_method = 'manual';
}

if (installmentsCount >= 5) {
var products = currentBasket.getAllProductLineItems();
var items = [];

products.toArray()
.forEach(function (productLineItem) {
var product = productLineItem.getProduct();
items.push(almaHelper.formatItem(product, productLineItem, locale));
});

paymentData.payment.cart = {
items: items
};
}

var products = currentBasket.getAllProductLineItems();
var items = [];

products.toArray()
.forEach(function (productLineItem) {
var product = productLineItem.getProduct();
items.push(almaHelper.formatItem(product, productLineItem, locale));
});

paymentData.payment.cart = {
items: items
};


return paymentData;
}
Expand Down
3 changes: 3 additions & 0 deletions test/mocks/helpers/almaPaymentHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ function resolvedPaymentData(installmentsCount, defferedDays, locale, origin, ha
},
deferred: '',
deferred_description: '',
cart: {
items: []
},
custom_data: {
cms_name: 'SFCC',
cms_version: '4.0.0',
Expand Down

0 comments on commit 3e2352b

Please sign in to comment.