Skip to content

Commit

Permalink
Merge pull request #740 from Adyen/develop
Browse files Browse the repository at this point in the history
Release v22.2.1
  • Loading branch information
zaiddreakh committed Nov 18, 2022
2 parents 5eeb50c + beeeabd commit cecb949
Show file tree
Hide file tree
Showing 100 changed files with 27,594 additions and 3,687 deletions.
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "npm" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
target-branch: "develop"
4 changes: 2 additions & 2 deletions .github/workflows/E2E.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ jobs:
matrix:
include:
- sfra-version: "v5.3.0"
sfcc-hostname-secret: "SFCC_HOSTNAME_SFRA5"
sfcc-hostname-secret: "SFCC_STOREFRONT_URL_SFRA5"
code-version-secret: "SFCC_CODE_VERSION_SFRA5"
- sfra-version: "v6.1.0"
sfcc-hostname-secret: "SFCC_HOSTNAME_SFRA6"
sfcc-hostname-secret: "SFCC_STOREFRONT_URL_SFRA6"
code-version-secret: "SFCC_CODE_VERSION_SFRA6"
steps:
- name: setup Node
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/async function initializeBillingEvents(){$('#billing-submit').on('click',function(){var isAdyenPOS=document.querySelector('.payment-method-options :checked').value==='AdyenPOS';var isAdyen=document.querySelector('.payment-method-options :checked').value==='AdyenComponent';if(isAdyenPOS){document.querySelector('#dwfrm_adyPaydata_terminalId').value=document.querySelector('#terminalList').value;return true;}if(isAdyen){var adyenPaymentMethod=document.querySelector('#adyenPaymentMethodName');var paymentMethodLabel=document.querySelector(`#lb_${selectedMethod}`).innerHTML;adyenPaymentMethod.value=paymentMethodLabel;validateComponents();return showValidation();}});if(window.sessionsResponse){sessionsResponse=window.sessionsResponse;checkoutConfiguration=window.Configuration;checkoutConfiguration.onChange=function(state/* , component */){var type=state.data.paymentMethod.type;if(selectedMethod==="googlepay"&&type==="paywithgoogle"){type="googlepay";}isValid=state.isValid;if(!componentsObj[type]){componentsObj[type]={};}componentsObj[type].isValid=isValid;componentsObj[type].stateData=state.data;};checkoutConfiguration.showPayButton=false;checkoutConfiguration.paymentMethodsConfiguration={card:getCardConfig(),storedCard:getCardConfig(),boletobancario:{personalDetailsRequired:true,// turn personalDetails section on/off
billingAddressRequired:false,// turn billingAddress section on/off
showEmailAddress:false// allow shopper to specify their email address
},paywithgoogle:getGooglePayConfig(),googlepay:getGooglePayConfig(),paypal:{environment:window.Configuration.environment,showPayButton:true,onClick:(data,actions)=>{if(paypalTerminatedEarly){paymentFromComponent({cancelTransaction:true,merchantReference:document.querySelector('#merchantReference').value});paypalTerminatedEarly=false;return actions.resolve();}paypalTerminatedEarly=true;$('#dwfrm_billing').trigger('submit');if(formErrorsExist){paypalTerminatedEarly=false;return actions.reject();}},onSubmit:(state,component)=>{assignPaymentMethodValue();paymentFromComponent(state.data,component);document.querySelector('#adyenStateData').value=JSON.stringify(state.data);},onCancel:(data,component)=>{paypalTerminatedEarly=false;paymentFromComponent({cancelTransaction:true,merchantReference:document.querySelector('#merchantReference').value},component);},onError:()=>{paypalTerminatedEarly=false;$('#dwfrm_billing').trigger('submit');},onAdditionalDetails:(state/* , component */)=>{paypalTerminatedEarly=false;document.querySelector('#paymentFromComponentStateData').value=JSON.stringify(state.data);$('#dwfrm_billing').trigger('submit');}},mbway:{showPayButton:true,onSubmit:(state,component)=>{$('#dwfrm_billing').trigger('submit');assignPaymentMethodValue();if(formErrorsExist){return false;}document.getElementById('component_mbway').querySelector('button').disabled=true;paymentFromComponent(state.data,component);document.querySelector('#adyenStateData').value=JSON.stringify(state.data);},onError:()=>{$('#dwfrm_billing').trigger('submit');},onAdditionalDetails:(state/* , component */)=>{document.querySelector('#paymentFromComponentStateData').value=JSON.stringify(state.data);$('#dwfrm_billing').trigger('submit');}},swish:getQRCodeConfig(),bcmc_mobile:getQRCodeConfig(),wechatpayQR:getQRCodeConfig(),pix:getQRCodeConfig(),amazonpay:getAmazonpayConfig()};if(window.googleMerchantID!=='null'&&window.Configuration.environment==='live'){checkoutConfiguration.paymentMethodsConfiguration.paywithgoogle.configuration.merchantIdentifier=window.googleMerchantID;checkoutConfiguration.paymentMethodsConfiguration.googlepay.configuration.merchantIdentifier=window.googleMerchantID;}if(window.cardholderNameBool!=='null'){checkoutConfiguration.paymentMethodsConfiguration.card.hasHolderName=true;checkoutConfiguration.paymentMethodsConfiguration.card.holderNameRequired=true;}checkoutConfiguration.session={id:window.sessionsResponse.id,sessionData:window.sessionsResponse.sessionData};checkout=await AdyenCheckout(checkoutConfiguration);paymentMethodsResponse=checkout.paymentMethodsResponse;document.querySelector('#paymentMethodsList').innerHTML='';renderGenericComponent();}}function zeroAuth(data,checkout){$.ajax({url:window.zeroAuthURL,type:'POST',contentType:'application/; charset=utf-8',data:JSON.stringify(data),async:false,success:function(data){if(data.zeroAuthResult.action){document.querySelector('#buttonsContainer').style.display='none';checkout.createFromAction(data.zeroAuthResult.action).mount('#newCard');}if(data.zeroAuthResult.resultCode==='Authorised'){window.location.href=window.paymentInstrumentsList;}else if(data.zeroAuthResult.resultCode==='Refused'){window.location.href=window.paymentInstrumentsListError;}}});}function paymentsDetails(state){$.ajax({type:'post',url:window.paymentsDetails,data:JSON.stringify({data:state.data}),contentType:'application/; charset=utf-8',async:false,success(data){if(data.response.isSuccessful){window.location.href=window.paymentInstrumentsList;}else if(!data.response.isFinal&&typeof data.response.action==='object'){checkout.createFromAction(data.action).mount('#action-container');}else{window.location.href=window.paymentInstrumentsListError;}}});}/**
},paywithgoogle:getGooglePayConfig(),googlepay:getGooglePayConfig(),paypal:{environment:window.Configuration.environment,showPayButton:true,onClick:(data,actions)=>{if(paypalTerminatedEarly){paymentFromComponent({cancelTransaction:true,merchantReference:document.querySelector('#merchantReference').value});paypalTerminatedEarly=false;return actions.resolve();}paypalTerminatedEarly=true;$('#dwfrm_billing').trigger('submit');if(formErrorsExist){paypalTerminatedEarly=false;return actions.reject();}},onSubmit:(state,component)=>{assignPaymentMethodValue();paymentFromComponent(state.data,component);document.querySelector('#adyenStateData').value=JSON.stringify(state.data);},onCancel:(data,component)=>{paypalTerminatedEarly=false;paymentFromComponent({cancelTransaction:true,merchantReference:document.querySelector('#merchantReference').value},component);},onError:(/* error, component */)=>{paypalTerminatedEarly=false;$('#dwfrm_billing').trigger('submit');},onAdditionalDetails:(state/* , component */)=>{paypalTerminatedEarly=false;document.querySelector('#paymentFromComponentStateData').value=JSON.stringify(state.data);$('#dwfrm_billing').trigger('submit');}},mbway:{showPayButton:true,onSubmit:(state,component)=>{$('#dwfrm_billing').trigger('submit');assignPaymentMethodValue();if(formErrorsExist){return false;}document.getElementById('component_mbway').querySelector('button').disabled=true;paymentFromComponent(state.data,component);document.querySelector('#adyenStateData').value=JSON.stringify(state.data);},onError:(/* error, component */)=>{$('#dwfrm_billing').trigger('submit');},onAdditionalDetails:(state/* , component */)=>{document.querySelector('#paymentFromComponentStateData').value=JSON.stringify(state.data);$('#dwfrm_billing').trigger('submit');}},swish:getQRCodeConfig(),bcmc_mobile:getQRCodeConfig(),wechatpayQR:getQRCodeConfig(),pix:getQRCodeConfig(),amazonpay:getAmazonpayConfig()};if(window.googleMerchantID!=='null'&&window.Configuration.environment==='live'){checkoutConfiguration.paymentMethodsConfiguration.paywithgoogle.configuration.merchantIdentifier=window.googleMerchantID;checkoutConfiguration.paymentMethodsConfiguration.googlepay.configuration.merchantIdentifier=window.googleMerchantID;}if(window.cardholderNameBool!=='null'){checkoutConfiguration.paymentMethodsConfiguration.card.hasHolderName=true;checkoutConfiguration.paymentMethodsConfiguration.card.holderNameRequired=true;}checkoutConfiguration.session={id:window.sessionsResponse.id,sessionData:window.sessionsResponse.sessionData};checkout=await AdyenCheckout(checkoutConfiguration);paymentMethodsResponse=checkout.paymentMethodsResponse;document.querySelector('#paymentMethodsList').innerHTML='';renderGenericComponent();}}function zeroAuth(data,checkout){$.ajax({url:window.zeroAuthURL,type:'POST',contentType:'application/; charset=utf-8',data:JSON.stringify(data),async:false,success:function(data){if(data.zeroAuthResult.action){document.querySelector('#buttonsContainer').style.display='none';checkout.createFromAction(data.zeroAuthResult.action).mount('#newCard');}if(data.zeroAuthResult.resultCode==='Authorised'){window.location.href=window.paymentInstrumentsList;}else if(data.zeroAuthResult.resultCode==='Refused'){window.location.href=window.paymentInstrumentsListError;}}});}function paymentsDetails(state){$.ajax({type:'post',url:window.paymentsDetails,data:JSON.stringify({data:state.data}),contentType:'application/; charset=utf-8',async:false,success(data){if(data.response.isSuccessful){window.location.href=window.paymentInstrumentsList;}else if(!data.response.isFinal&&typeof data.response.action==='object'){checkout.createFromAction(data.action).mount('#action-container');}else{window.location.href=window.paymentInstrumentsListError;}}});}/**
* @function
* @description Initializes Adyen Checkout My Account events
*/async function initializeAccountEvents(){checkoutConfiguration=window.Configuration;checkoutConfiguration.onAdditionalDetails=function(state){paymentsDetails(state);};checkoutConfiguration.session=window.sessionData;checkout=await AdyenCheckout(checkoutConfiguration);var newCard=document.getElementById('newCard');var adyenStateData;var isValid=false;var node=checkout.create('card',{hasHolderName:true,holderNameRequired:true,onChange:function(state){adyenStateData=state.data;isValid=state.isValid;}}).mount(newCard);$('#applyBtn').on('click',function(e){e.preventDefault();if(!isValid){node.showValidation();return false;}document.querySelector('#adyenStateData').value=JSON.stringify(adyenStateData);zeroAuth(adyenStateData,checkout);});}function assignPaymentMethodValue(){var adyenPaymentMethod=document.querySelector('#adyenPaymentMethodName');adyenPaymentMethod.value=document.querySelector(`#lb_${selectedMethod}`).innerHTML;}/**
Expand Down Expand Up @@ -10567,7 +10567,7 @@ return digit+22+75*(digit<26)-((flag!=0)<<5);}/**
* Bias adaptation function as per section 3.4 of RFC 3492.
* https://tools.ietf.org/html/rfc3492#section-3.4
* @private
*/function adapt(delta,numPoints,firstTime){var k=0;delta=firstTime?floor(delta/damp):delta>>1;delta+=floor(delta/numPoints);for(;delta>baseMinusTMin*tMax>>1;k+=base){delta=floor(delta/baseMinusTMin);}return floor(k+(baseMinusTMin+1)*delta/(delta+skew));}/**
*/function adapt(delta,numPoints,firstTime){var k=0;delta=firstTime?floor(delta/damp):delta>>1;delta+=floor(delta/numPoints);for/* no initialization */(;delta>baseMinusTMin*tMax>>1;k+=base){delta=floor(delta/baseMinusTMin);}return floor(k+(baseMinusTMin+1)*delta/(delta+skew));}/**
* Converts a Punycode string of ASCII-only symbols to a string of Unicode
* symbols.
* @memberOf punycode
Expand All @@ -10580,12 +10580,12 @@ var output=[],inputLength=input.length,out,i=0,n=initialN,bias=initialBias,basic
basic=input.lastIndexOf(delimiter);if(basic<0){basic=0;}for(j=0;j<basic;++j){// if it's not a basic code point
if(input.charCodeAt(j)>=0x80){error('not-basic');}output.push(input.charCodeAt(j));}// Main decoding loop: start just after the last delimiter if any basic code
// points were copied; start at the beginning otherwise.
for(index=basic>0?basic+1:0;index<inputLength;){// `index` is the index of the next character to be consumed.
for/* no final expression */(index=basic>0?basic+1:0;index<inputLength;){// `index` is the index of the next character to be consumed.
// Decode a generalized variable-length integer into `delta`,
// which gets added to `i`. The overflow checking is easier
// if we increase `i` as we go, then subtract off its starting
// value at the end to obtain `delta`.
for(oldi=i,w=1,k=base;;k+=base){if(index>=inputLength){error('invalid-input');}digit=basicToDigit(input.charCodeAt(index++));if(digit>=base||digit>floor((maxInt-i)/w)){error('overflow');}i+=digit*w;t=k<=bias?tMin:k>=bias+tMax?tMax:k-bias;if(digit<t){break;}baseMinusT=base-t;if(w>floor(maxInt/baseMinusT)){error('overflow');}w*=baseMinusT;}out=output.length+1;bias=adapt(i-oldi,out,oldi==0);// `i` was supposed to wrap around from `out` to `0`,
for/* no condition */(oldi=i,w=1,k=base;;k+=base){if(index>=inputLength){error('invalid-input');}digit=basicToDigit(input.charCodeAt(index++));if(digit>=base||digit>floor((maxInt-i)/w)){error('overflow');}i+=digit*w;t=k<=bias?tMin:k>=bias+tMax?tMax:k-bias;if(digit<t){break;}baseMinusT=base-t;if(w>floor(maxInt/baseMinusT)){error('overflow');}w*=baseMinusT;}out=output.length+1;bias=adapt(i-oldi,out,oldi==0);// `i` was supposed to wrap around from `out` to `0`,
// incrementing `n` each time, so we'll fix that now:
if(floor(i/out)>maxInt-n){error('overflow');}n+=floor(i/out);i%=out;// Insert `n` at position `i` of the output
output.splice(i++,0,n);}return ucs2encode(output);}/**
Expand All @@ -10607,7 +10607,7 @@ while(handledCPCount<inputLength){// All non-basic code points < n have been han
for(m=maxInt,j=0;j<inputLength;++j){currentValue=input[j];if(currentValue>=n&&currentValue<m){m=currentValue;}}// Increase `delta` enough to advance the decoder's <n,i> state to <m,0>,
// but guard against overflow
handledCPCountPlusOne=handledCPCount+1;if(m-n>floor((maxInt-delta)/handledCPCountPlusOne)){error('overflow');}delta+=(m-n)*handledCPCountPlusOne;n=m;for(j=0;j<inputLength;++j){currentValue=input[j];if(currentValue<n&&++delta>maxInt){error('overflow');}if(currentValue==n){// Represent delta as a generalized variable-length integer
for(q=delta,k=base;;k+=base){t=k<=bias?tMin:k>=bias+tMax?tMax:k-bias;if(q<t){break;}qMinusT=q-t;baseMinusT=base-t;output.push(stringFromCharCode(digitToBasic(t+qMinusT%baseMinusT,0)));q=floor(qMinusT/baseMinusT);}output.push(stringFromCharCode(digitToBasic(q,0)));bias=adapt(delta,handledCPCountPlusOne,handledCPCount==basicLength);delta=0;++handledCPCount;}}++delta;++n;}return output.join('');}/**
for/* no condition */(q=delta,k=base;;k+=base){t=k<=bias?tMin:k>=bias+tMax?tMax:k-bias;if(q<t){break;}qMinusT=q-t;baseMinusT=base-t;output.push(stringFromCharCode(digitToBasic(t+qMinusT%baseMinusT,0)));q=floor(qMinusT/baseMinusT);}output.push(stringFromCharCode(digitToBasic(q,0)));bias=adapt(delta,handledCPCountPlusOne,handledCPCount==basicLength);delta=0;++handledCPCount;}}++delta;++n;}return output.join('');}/**
* Converts a Punycode string representing a domain name or an email address
* to Unicode. Only the Punycoded parts of the input will be converted, i.e.
* it doesn't matter if you call it on a string that has already been
Expand Down
Loading

0 comments on commit cecb949

Please sign in to comment.