Skip to content

Commit

Permalink
Merge pull request #775 from Adyen/release/22.2.2
Browse files Browse the repository at this point in the history
Release/22.2.2
  • Loading branch information
amihajlovski authored Dec 29, 2022
2 parents cecb949 + 99d32a6 commit 2e929de
Show file tree
Hide file tree
Showing 198 changed files with 8,530 additions and 19,035 deletions.
12 changes: 0 additions & 12 deletions .github/dependabot.yml

This file was deleted.

26 changes: 22 additions & 4 deletions .github/workflows/E2E.yml → .github/workflows/E2E_SFRA.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: E2E
name: E2E For SFRA

on: [pull_request]
on:
pull_request:
paths-ignore:
- "int_adyen_controllers/**"
- "adyen_controllers_changes/**"

jobs:
setup-the-cartridge:
Expand Down Expand Up @@ -51,7 +55,9 @@ jobs:
run: npm run build
end-to-end-testing:
needs: setup-the-cartridge
runs-on: macos-latest
runs-on:
group: larger-runners
labels: ubuntu-latest-8-cores
strategy:
fail-fast: false
matrix:
Expand All @@ -77,8 +83,9 @@ jobs:
- name: setup playwright dependencies
working-directory: adyen-salesforce-commerce-cloud/tests/playwright/
run: npx playwright install --with-deps
- name: run e2e tests
- name: run e2e tests full coverage
working-directory: adyen-salesforce-commerce-cloud/tests/playwright/
if: github.event.pull_request.base.ref == 'main' || github.event.pull_request.base.ref == 'develop'
run: npm run test:ci
env:
SANDBOX_HTTP_AUTH_USERNAME: ${{ secrets.SANDBOX_HTTP_AUTH_USERNAME }}
Expand All @@ -87,6 +94,17 @@ jobs:
PAYPAL_PASSWORD: ${{ secrets.PAYPAL_PASSWORD }}
SFRA_VERSION: ${{ matrix.sfra-version }}
SFCC_HOSTNAME: ${{ secrets[matrix.sfcc-hostname-secret] }}
- name: run e2e tests quick coverage
working-directory: adyen-salesforce-commerce-cloud/tests/playwright/
if: github.event.pull_request.base.ref != 'main' && github.event.pull_request.base.ref != 'develop'
run: npm run test:ci:quick
env:
SANDBOX_HTTP_AUTH_USERNAME: ${{ secrets.SANDBOX_HTTP_AUTH_USERNAME }}
SANDBOX_HTTP_AUTH_PASSWORD: ${{ secrets.SANDBOX_HTTP_AUTH_PASSWORD }}
PAYPAL_USERNAME: ${{ secrets.PAYPAL_USERNAME }}
PAYPAL_PASSWORD: ${{ secrets.PAYPAL_PASSWORD }}
SFRA_VERSION: ${{ matrix.sfra-version }}
SFCC_HOSTNAME: ${{ secrets[matrix.sfcc-hostname-secret] }}
- name: Archive test result artifacts
uses: actions/upload-artifact@v3
with:
Expand Down
105 changes: 105 additions & 0 deletions .github/workflows/E2E_SG.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: E2E For SiteGenesis

on:
pull_request:
paths-ignore:
- "int_adyen_SFRA/**"

jobs:
setup-the-cartridge:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- sfra-version: ""
sfcc-hostname-secret: "SFCC_HOSTNAME_SFRA5"
code-version-secret: "SFCC_CODE_VERSION_SFRA5"
steps:
- name: Checkout SFRA code
uses: actions/checkout@v2
with:
repository: SalesforceCommerceCloud/storefront-reference-architecture
ref: ${{ matrix.sfra-version }}
ssh-key: ${{ secrets.SERVICE_ACCOUNT_SSH_KEY }}
path: storefront-reference-architecture
- name: setup Node
uses: actions/setup-node@v2
with:
node-version: "14"
- name: Checkout
uses: actions/checkout@v2
with:
path: adyen-salesforce-commerce-cloud
- name: npm install storefront-reference-architecture
working-directory: storefront-reference-architecture
run: npm install
- name: npm install adyen-salesforce-commerce-cloud
working-directory: adyen-salesforce-commerce-cloud
run: npm install
- name: create dw.json file
working-directory: adyen-salesforce-commerce-cloud
run: |
echo '{
"username": "${{ secrets.SFCC_USERNAME }}",
"password": "${{ secrets.SFCC_PASSWORD }}",
"hostname": "${{ secrets[matrix.sfcc-hostname-secret] }}",
"code-version": "${{ secrets[matrix.code-version-secret] }}"
}' >> dw.json
- name: push cartridge code
working-directory: adyen-salesforce-commerce-cloud
run: npm run build
end-to-end-testing:
needs: setup-the-cartridge
runs-on:
group: larger-runners
labels: ubuntu-latest-8-cores
strategy:
fail-fast: false
matrix:
include:
- sfra-version: ""
sfcc-hostname-secret: "SFCC_STOREFRONT_URL_SFRA5"
code-version-secret: "SFCC_CODE_VERSION_SFRA5"
steps:
- name: setup Node
uses: actions/setup-node@v2
with:
node-version: "16"
- name: Checkout
uses: actions/checkout@v2
with:
path: adyen-salesforce-commerce-cloud
- name: install e2e test dependencies
working-directory: adyen-salesforce-commerce-cloud/tests/playwright/
run: npm i
- name: setup playwright dependencies
working-directory: adyen-salesforce-commerce-cloud/tests/playwright/
run: npx playwright install --with-deps
- name: run e2e tests full coverage
working-directory: adyen-salesforce-commerce-cloud/tests/playwright/
if: github.event.pull_request.base.ref == 'main' || github.event.pull_request.base.ref == 'develop'
run: npm run test:ci
env:
SANDBOX_HTTP_AUTH_USERNAME: ${{ secrets.SANDBOX_HTTP_AUTH_USERNAME }}
SANDBOX_HTTP_AUTH_PASSWORD: ${{ secrets.SANDBOX_HTTP_AUTH_PASSWORD }}
PAYPAL_USERNAME: ${{ secrets.PAYPAL_USERNAME }}
PAYPAL_PASSWORD: ${{ secrets.PAYPAL_PASSWORD }}
SFRA_VERSION: ${{ matrix.sfra-version }}
SFCC_HOSTNAME: ${{ secrets[matrix.sfcc-hostname-secret] }}
- name: run e2e tests quick coverage
working-directory: adyen-salesforce-commerce-cloud/tests/playwright/
if: github.event.pull_request.base.ref != 'main' && github.event.pull_request.base.ref != 'develop'
run: npm run test:ci:quick
env:
SANDBOX_HTTP_AUTH_USERNAME: ${{ secrets.SANDBOX_HTTP_AUTH_USERNAME }}
SANDBOX_HTTP_AUTH_PASSWORD: ${{ secrets.SANDBOX_HTTP_AUTH_PASSWORD }}
PAYPAL_USERNAME: ${{ secrets.PAYPAL_USERNAME }}
PAYPAL_PASSWORD: ${{ secrets.PAYPAL_PASSWORD }}
SFRA_VERSION: ${{ matrix.sfra-version }}
SFCC_HOSTNAME: ${{ secrets[matrix.sfcc-hostname-secret] }}
- name: Archive test result artifacts
uses: actions/upload-artifact@v3
with:
name: html-report
path: adyen-salesforce-commerce-cloud/tests/playwright/test-report
2 changes: 1 addition & 1 deletion .github/workflows/SFCC.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:

strategy:
matrix:
node-version: [10.x, 12.x, 13.x]
node-version: [14.x, 16.x, 18.x]

steps:
- uses: actions/checkout@v2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

/* API includes */
var PaymentInstrument = require('dw/order/PaymentInstrument');
var Logger = require('dw/system/Logger');
var PaymentMgr = require('dw/order/PaymentMgr');
var PaymentStatusCodes = require('dw/order/PaymentStatusCodes');
var Status = require('dw/system/Status');
Expand All @@ -25,6 +24,7 @@ var AdyenHelper = require('int_adyen_overlay/cartridge/scripts/util/adyenHelper'
var AdyenConfigs = require('int_adyen_overlay/cartridge/scripts/util/adyenConfigs');
var adyenSessions = require('int_adyen_overlay/cartridge/scripts/adyenSessions');
var adyenSaveCreditCard = require("*/cartridge/scripts/adyenSaveCreditCard");
var AdyenLogs = require("int_adyen_overlay/cartridge/scripts/adyenCustomLogs");
// ### Custom Adyen cartridge end ###

/**
Expand Down Expand Up @@ -164,7 +164,7 @@ function create() {
});
});
} catch (e) {
Logger.error('{0}: {1}', e, e.stack);
AdyenLogs.error_log(`${e}: ${e.stack}`);
return false;
}
return true;
Expand Down
6 changes: 3 additions & 3 deletions cartridges/bm_adyen/cartridge/controllers/AdyenSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

var server = require('server');
var Transaction = require('dw/system/Transaction');
var Logger = require('dw/system/Logger');
var csrfProtection = require('*/cartridge/scripts/middleware/csrf');
var AdyenConfigs = require('*/cartridge/scripts/util/adyenConfigs');
var AdyenHelper = require('*/cartridge/scripts/util/adyenHelper');
var constants = require('*/cartridge/adyenConstants/constants');
var AdyenLogs = require('*/cartridge/scripts/adyenCustomLogs');
server.get('Start', csrfProtection.generateToken, function (_req, res, next) {
res.render('adyenSettings/settings');
return next();
Expand All @@ -23,7 +23,7 @@ server.post('Save', server.middleware.https, function (req, res, next) {
success: true
});
} catch (error) {
Logger.getLogger('Adyen').error("Error while saving settings in BM configuration: ".concat(error));
AdyenLogs.error_log("Error while saving settings in BM configuration: ".concat(error));
res.json({
success: false
});
Expand Down Expand Up @@ -60,7 +60,7 @@ server.post('TestConnection', server.middleware.https, function (req, res, next)
error: false
});
} catch (error) {
Logger.getLogger('Adyen').error("Error while testing API credentials: ".concat(error));
AdyenLogs.error_log("Error while testing API credentials: ".concat(error));
res.json({
error: true,
message: 'an unknown error has occurred',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,6 @@
</div>
</div>
</div>
<div class="form-group">
<label class="form-title mb-0" for="3dSecure">3D Secure 2 (3DS2)</label>
<small id="3dSecureHelp" class="form-text mb-1">With 3DS2, the card issuer can perform authentication inside your app or payment form.</small>
<div class="radio-buttons">
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="Adyen3DS2Enabled" id="3dSecureYes" value=true ${AdyenConfigs.getAdyen3DS2Enabled() ? 'checked': ''}>
<label class="form-check-label" for="3dSecureYes">Enable</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="Adyen3DS2Enabled" id="3dSecureNo" value=false ${!AdyenConfigs.getAdyen3DS2Enabled() ? 'checked': ''}>
<label class="form-check-label" for="3dSecureNo">Disable</label>
</div>
</div>
</div>
<div class="form-group">
<label class="form-title mb-0" for="installments">Credit card installments <small class="text-secondary">(optional)</small></label>
<small id="installmentsHelp" class="form-text mb-1">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ if (window.cardholderNameBool !== 'null') {
store.checkoutConfiguration.paymentMethodsConfiguration.card.holderNameRequired = true;
}
if (window.googleMerchantID !== 'null' && window.Configuration.environment === 'live') {
var id = 'merchantIdentifier';
var id = 'merchantId';
store.checkoutConfiguration.paymentMethodsConfiguration.paywithgoogle.configuration[id] = window.googleMerchantID;
store.checkoutConfiguration.paymentMethodsConfiguration.googlepay.configuration[id] = window.googleMerchantID;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Helpers should make payment ajax call that fails 1`] = `
Object {
"data": Object {},
{
"data": {},
"paymentMethod": "mocked_paymentMethod",
}
`;
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Render Generic Component should render 1`] = `
Object {
{
"amount": "mocked_amount",
"countryCode": "mocked_countrycode",
"paymentMethodsConfiguration": Object {
"amazonpay": Object {
"addressDetails": Object {
"paymentMethodsConfiguration": {
"amazonpay": {
"addressDetails": {
"addressLine1": "test",
"city": "test",
"countryCode": "test",
Expand All @@ -18,8 +18,8 @@ Object {
"configuration": undefined,
},
},
"session": Object {
"adyenDescriptions": Object {},
"session": {
"adyenDescriptions": {},
"id": "mock_id",
"imagePath": "example.com",
"sessionData": "mock_session_data",
Expand Down
Loading

0 comments on commit 2e929de

Please sign in to comment.