mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
🐛 Fix incorrect validation rule
This commit is contained in:
parent
f41fa4f951
commit
e95321cf82
3 changed files with 3 additions and 2 deletions
|
@ -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 }`
|
||||
|
|
|
@ -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 ) {}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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 }`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue