Skip to content

Commit dcf990e

Browse files
Merge pull request #748 from Adyen/develop
Release version 5.0.9
2 parents 83bca46 + 355c345 commit dcf990e

4 files changed

Lines changed: 19 additions & 16 deletions

File tree

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
}
77
],
88
"description": "Official Shopware 6 Plugin to connect to Payment Service Provider Adyen",
9-
"version": "5.0.8",
9+
"version": "5.0.9",
1010
"type": "shopware-platform-plugin",
1111
"license": "MIT",
1212
"require": {

src/Resources/app/storefront/dist/storefront/js/adyen-payment-shopware6/adyen-payment-shopware6.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Resources/app/storefront/src/configuration/adyen.js

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,16 @@
1919
* See the LICENSE file for more info.
2020
*
2121
*/
22-
function validateTOS(self) {
23-
const tosCheckbox = document.querySelector('#tos');
24-
if(adyenCheckoutOptions?.accessibilityTweaks === '1' && tosCheckbox && !tosCheckbox.checked) {
25-
tosCheckbox.scrollIntoView({ behavior: 'smooth', block: 'center' });
26-
tosCheckbox.focus();
27-
return false;
22+
23+
function validateRequired(self) {
24+
const requiredFields = document.querySelectorAll("input[required]");
25+
for (const field of requiredFields) {
26+
if (!field.checkValidity()) {
27+
field.scrollIntoView({behavior: 'smooth', block: 'center'});
28+
field.focus();
29+
30+
return false;
31+
}
2832
}
2933

3034
return self.confirmOrderForm.checkValidity();
@@ -41,7 +45,7 @@ export default {
4145
'applepay': {
4246
extra: {},
4347
onClick(resolve, reject, self) {
44-
if(!validateTOS(self)) {
48+
if (!validateRequired(self)) {
4549
reject();
4650
return false;
4751
}
@@ -59,7 +63,7 @@ export default {
5963
buttonSizeMode: 'fill',
6064
},
6165
onClick: function (resolve, reject, self) {
62-
if(!validateTOS(self)) {
66+
if (!validateRequired(self)) {
6367
reject();
6468
return false;
6569
}
@@ -71,7 +75,7 @@ export default {
7175
return true;
7276
}
7377
},
74-
onError: function(error, component, self) {
78+
onError: function (error, component, self) {
7579
if (error.statusCode !== 'CANCELED') {
7680
if ('statusMessage' in error) {
7781
console.log(error.statusMessage);
@@ -84,9 +88,9 @@ export default {
8488
'paypal': {
8589
extra: {},
8690
onClick: function (source, event, self) {
87-
return validateTOS(self);
91+
return validateRequired(self);
8892
},
89-
onError: function(error, component, self) {
93+
onError: function (error, component, self) {
9094
component.setStatus('ready');
9195
window.location.href = self.errorUrl.toString();
9296
},
@@ -134,7 +138,7 @@ export default {
134138
prePayRedirect: true,
135139
sessionKey: 'amazonCheckoutSessionId',
136140
onClick: function (resolve, reject, self) {
137-
if(!validateTOS(self)) {
141+
if (!validateRequired(self)) {
138142
reject();
139143
return false;
140144
}
@@ -199,4 +203,4 @@ export default {
199203
'ebanking_FI': 'handler_adyen_onlinebankingfinlandpaymentmethodhandler',
200204
'onlineBanking_PL': 'handler_adyen_onlinebankingpolandpaymentmethodhandler'
201205
}
202-
}
206+
}

src/Resources/views/storefront/page/checkout/confirm/confirm-payment.html.twig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@
6868
data-translation-adyen-giftcard-remaining-amount="{{ "adyen.giftcard.remainingAmount" | trans }}"
6969
data-google-merchant-id="{{ adyenFrontendData.googleMerchantId }}"
7070
data-gateway-merchant-id="{{ adyenFrontendData.gatewayMerchantId }}"
71-
data-accessibility-tweaks="{{ feature('ACCESSIBILITY_TWEAKS') ? 1 : 0 }}"
7271
>
7372
</div>
7473
<script>

0 commit comments

Comments
 (0)