🐛 Fix incorrect validation rule

This commit is contained in:
Philipp Stracker 2024-10-09 14:04:21 +02:00
parent f41fa4f951
commit e95321cf82
No known key found for this signature in database
3 changed files with 3 additions and 2 deletions

View file

@ -220,7 +220,7 @@ class ApplePayButton extends PaymentButton {
registerValidationRules( invalidIf, validIf ) {
invalidIf(
() =>
[ 'TEST', 'PRODUCTION' ].includes(
! [ 'TEST', 'PRODUCTION' ].includes(
this.buttonConfig.environment
),
`Invalid environment: ${ this.buttonConfig.environment }`

View file

@ -683,6 +683,7 @@ export default class PaymentButton {
* @param {(condition: () => boolean, errorMessage: string) => void} invalidIf - Registers a validation step that fails if the condition returns true.
* @param {(condition: () => boolean) => void} validIf - Registers a validation step that passes if the condition returns true.
*/
// eslint-disable-next-line no-unused-vars
registerValidationRules( invalidIf, validIf ) {}
/**

View file

@ -218,7 +218,7 @@ class GooglepayButton extends PaymentButton {
registerValidationRules( invalidIf, validIf ) {
invalidIf(
() =>
[ 'TEST', 'PRODUCTION' ].includes(
! [ 'TEST', 'PRODUCTION' ].includes(
this.buttonConfig.environment
),
`Invalid environment: ${ this.buttonConfig.environment }`