Skip to content

Commit

Permalink
Release 20.1.3 (#399)
Browse files Browse the repository at this point in the history
  • Loading branch information
zaiddreakh authored Dec 4, 2020
1 parent 1170048 commit 3156500
Show file tree
Hide file tree
Showing 22 changed files with 744 additions and 449 deletions.
4 changes: 2 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"no-restricted-syntax": "off",
"guard-for-in": "off",
"prefer-arrow-callback": "off",
"object-shorthand": "off"
"object-shorthand": "off",
"no-control-regex": "off"
}
}

26 changes: 25 additions & 1 deletion metadata/site_import/meta/system-objecttype-extensions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
<attribute-definition attribute-id="adyenAction">
<display-name xml:lang="x-default">adyenAction</display-name>
<description xml:lang="x-default">Action data from payment response</description>
<type>string</type>
<type>text</type>
<mandatory-flag>false</mandatory-flag>
<externally-managed-flag>false</externally-managed-flag>
<min-length>0</min-length>
Expand Down Expand Up @@ -344,6 +344,19 @@
<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>
<mandatory-flag>false</mandatory-flag>
<externally-managed-flag>false</externally-managed-flag>
<default-value>true</default-value>
</attribute-definition>
<attribute-definition attribute-id="AdyenLevel23_CommodityCode">
<display-name xml:lang="x-default">Commodity Code that best describes your products (only applicable for Level 2/3 Data Authorisation) https://www.unspsc.org/search-code</display-name>
<type>string</type>
<mandatory-flag>false</mandatory-flag>
<externally-managed-flag>false</externally-managed-flag>
</attribute-definition>
<attribute-definition attribute-id="Adyen_Mode">
<display-name xml:lang="x-default">Test/Production Mode</display-name>
<description xml:lang="x-default">Set to live for Production or test for test mode</description>
Expand Down Expand Up @@ -479,6 +492,14 @@
<externally-managed-flag>false</externally-managed-flag>
<min-length>0</min-length>
</attribute-definition>
<attribute-definition attribute-id="Adyen_IntegratorName">
<display-name xml:lang="x-default">System Integrator </display-name>
<description xml:lang="x-default">Name of system integrator (if any)</description>
<type>string</type>
<mandatory-flag>false</mandatory-flag>
<externally-managed-flag>false</externally-managed-flag>
<min-length>0</min-length>
</attribute-definition>
</custom-attribute-definitions>
<group-definitions>
<attribute-group group-id="Adyen">
Expand All @@ -492,9 +513,12 @@
<attribute attribute-id="AdyenOneClickEnabled"/>
<attribute attribute-id="AdyenCreditCardInstallments"/>
<attribute attribute-id="AdyenBasketFieldsEnabled"/>
<attribute attribute-id="AdyenLevel23DataEnabled"/>
<attribute attribute-id="AdyenLevel23_CommodityCode"/>
<attribute attribute-id="Adyen_notification_user"/>
<attribute attribute-id="Adyen_notification_password"/>
<attribute attribute-id="Adyen_PaypalMerchantID"/>
<attribute attribute-id="Adyen_IntegratorName"/>
<attribute attribute-id="Adyen_GooglePayMerchantID"/>
<attribute attribute-id="AdyenRatePayID"/>
<attribute attribute-id="Adyen_StoreId"/>
Expand Down
29 changes: 24 additions & 5 deletions metadata/site_import/services.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<password/>
</service-credential>
<service-credential service-credential-id="AdyenPaymentLive">
<url>https://[YOUR_LIVE_PREFIX]-checkout-live.adyen.com/checkout/v51/payments</url>
<url>https://[YOUR_LIVE_PREFIX]-checkout-live.adyenpayments.com/checkout/v51/payments</url>
<user-id></user-id>
<password/>
</service-credential>
Expand All @@ -16,7 +16,7 @@
<password/>
</service-credential>
<service-credential service-credential-id="AdyenPaymentDetailsLive">
<url>https://[YOUR_LIVE_PREFIX]-checkout-live.adyen.com/checkout/v51/payments/details</url>
<url>https://[YOUR_LIVE_PREFIX]-checkout-live.adyenpayments.com/checkout/v51/payments/details</url>
<user-id></user-id>
<password/>
</service-credential>
Expand All @@ -26,7 +26,7 @@
<password/>
</service-credential>
<service-credential service-credential-id="AdyenCheckoutPaymentMethodsLive">
<url>https://[YOUR_LIVE_PREFIX]-checkout-live.adyen.com/v51/paymentMethods</url>
<url>https://[YOUR_LIVE_PREFIX]-checkout-live.adyenpayments.com/v51/paymentMethods</url>
<user-id></user-id>
<password/>
</service-credential>
Expand All @@ -45,22 +45,41 @@
<user-id></user-id>
<password/>
</service-credential>
<service-credential service-credential-id="AdyenPosPaymentLive">
<url>https://[YOUR_LIVE_PREFIX]-terminal-api-live.adyenpayments.com/sync</url>
<user-id></user-id>
<password/>
</service-credential>
<service-credential service-credential-id="AdyenOriginKeys">
<url>https://checkout-test.adyen.com/v1/originKeys</url>
<user-id></user-id>
<password/>
</service-credential>
<service-credential service-credential-id="AdyenOriginKeysLive">
<url>https://[YOUR_LIVE_PREFIX]-checkout-live.adyenpayments.com/v1/originKeys</url>
<user-id></user-id>
<password/>
</service-credential>
<service-credential service-credential-id="AdyenConnectedTerminals">
<url>https://terminal-api-test.adyen.com/connectedTerminals</url>
<user-id></user-id>
<password/>
</service-credential>
<service-credential service-credential-id="AdyenConnectedTerminalsLive">
<url>https://[YOUR_LIVE_PREFIX]-terminal-api-live.adyenpayments.com/connectedTerminals</url>
<user-id></user-id>
<password/>
</service-credential>
<service-credential service-credential-id="AdyenGiving">
<url>https://pal-test.adyen.com/pal/servlet/Payment/v40/donate</url>
<user-id></user-id>
<password/>
</service-credential>

<service-credential service-credential-id="AdyenGivingLive">
<url>https://[YOUR_LIVE_PREFIX]-pal-live.adyenpayments.com/pal/servlet/Payment/v40/donate</url>
<user-id></user-id>
<password/>
</service-credential>
<service-profile service-profile-id="Adyen">
<timeout-millis>30000</timeout-millis>
<cb-enabled>false</cb-enabled>
Expand All @@ -69,7 +88,7 @@
<timeout-millis>100000</timeout-millis>
<cb-enabled>false</cb-enabled>
</service-profile>

<service service-id="AdyenPayment">
<service-type>HTTP</service-type>
<enabled>true</enabled>
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "int_adyen_SFRA",
"version": "20.1.2",
"version": "20.1.3",
"description": "SFRA cartridge",
"main": "index.js",
"paths": {
Expand Down Expand Up @@ -31,7 +31,7 @@
"dependencies": {
"babel-loader": "^8.0.4",
"cleave.js": "^1.0.1",
"eslint-config-airbnb-base": "^14.2.0",
"eslint-config-airbnb-base": "^14.2.1",
"url": "^0.11.0"
},
"devDependencies": {
Expand All @@ -45,7 +45,7 @@
"eslint-config-prettier": "^6.11.0",
"eslint-formatter-pretty": "^1.3.0",
"eslint-formatter-summary": "^1.0.2",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-prettier": "^3.1.3",
"istanbul": "^0.4.4",
"jest": "^25.1.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ checkoutConfiguration.paymentMethodsConfiguration = {
const componentName = state.data.paymentMethod.storedPaymentMethodId
? `storedCard${state.data.paymentMethod.storedPaymentMethodId}`
: state.data.paymentMethod.type;
if (componentName === selectedMethod) {
if (componentName === selectedMethod || selectedMethod === 'bcmc') {
componentsObj[selectedMethod].isValid = isValid;
componentsObj[selectedMethod].stateData = state.data;
}
Expand Down Expand Up @@ -113,6 +113,29 @@ checkoutConfiguration.paymentMethodsConfiguration = {
}
},
},
mbway: {
showPayButton: true,
onSubmit: (state, component) => {
$('#dwfrm_billing').trigger('submit');
assignPaymentMethodValue();
if (!formErrorsExist) {
document.getElementById('component_mbway').querySelector('button').disabled = true;
paymentFromComponent(state.data, component);
document.querySelector('#adyenStateData').value = JSON.stringify(
state.data,
);
}
},
onError: (/* error, component */) => {
document.querySelector('#showConfirmationForm').submit();
},
onAdditionalDetails: (state /* , component */) => {
document.querySelector('#additionalDetailsHidden').value = JSON.stringify(
state.data,
);
document.querySelector('#showConfirmationForm').submit();
},
},
afterpay_default: {
visibility: {
personalDetails: 'editable',
Expand Down Expand Up @@ -155,8 +178,8 @@ if (window.installments) {
if (window.paypalMerchantID !== 'null') {
checkoutConfiguration.paymentMethodsConfiguration.paypal.merchantId = window.paypalMerchantID;
}
if (window.googleMerchantID !== 'null' && window.Configuration.environment === 'LIVE') {
checkoutConfiguration.paymentMethodsConfiguration.paywithgoogle.merchantIdentifier = window.googleMerchantID;
if (window.googleMerchantID !== 'null' && window.Configuration.environment === 'live') {
checkoutConfiguration.paymentMethodsConfiguration.paywithgoogle.configuration.merchantIdentifier = window.googleMerchantID;
}

/**
Expand All @@ -165,7 +188,7 @@ if (window.googleMerchantID !== 'null' && window.Configuration.environment === '
function displaySelectedMethod(type) {
selectedMethod = type;
resetPaymentMethod();
if (['paypal', 'paywithgoogle'].indexOf(type) > -1) {
if (['paypal', 'paywithgoogle', 'mbway'].indexOf(type) > -1) {
document.querySelector('button[value="submit-payment"]').disabled = true;
} else {
document.querySelector('button[value="submit-payment"]').disabled = false;
Expand Down Expand Up @@ -224,6 +247,7 @@ async function renderGenericComponent() {
checkoutConfiguration.paymentMethodsResponse = data.AdyenPaymentMethods;
if (data.amount) {
checkoutConfiguration.amount = data.amount;
checkoutConfiguration.paymentMethodsConfiguration.paypal.amount = data.amount;
}
if (data.countryCode) {
checkoutConfiguration.countryCode = data.countryCode;
Expand Down Expand Up @@ -353,6 +377,10 @@ function renderPaymentMethod(
displaySelectedMethod(event.target.value);
};

if (paymentMethodID === 'giropay') {
container.innerHTML = '';
}

if (componentsObj[paymentMethodID] && !container.childNodes[0]) {
componentsObj[paymentMethodID].isValid = true;
}
Expand Down Expand Up @@ -409,6 +437,12 @@ function paymentFromComponent(data, component) {
paymentMethod: document.querySelector('#adyenPaymentMethodName').value,
},
success: function (data) {
if (data.orderNo) {
document.querySelector('#merchantReference').value = data.orderNo;
}
if (data.orderToken) {
document.querySelector('#orderToken').value = data.orderToken;
}
if (data.fullResponse && data.fullResponse.action) {
component.handleAction(data.fullResponse.action);
} else {
Expand Down
Loading

0 comments on commit 3156500

Please sign in to comment.