Merge pull request #1691 from woocommerce/PCP-1943-validate-email-address-api-credentials-field

validate email address API credentials field (1943)
This commit is contained in:
Emili Castells 2023-09-19 17:21:06 +02:00 committed by GitHub
commit b3df2374fd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 3 deletions

View file

@ -238,7 +238,7 @@ return function ( ContainerInterface $container, array $fields ): array {
'merchant_email_production' => array(
'title' => __( 'Live Email address', 'woocommerce-paypal-payments' ),
'classes' => array( State::STATE_ONBOARDED === $state->production_state() ? 'onboarded' : '', 'ppcp-always-shown-element' ),
'type' => 'text',
'type' => 'email',
'required' => true,
'desc_tip' => true,
'description' => __( 'The email address of your PayPal account.', 'woocommerce-paypal-payments' ),
@ -304,7 +304,7 @@ return function ( ContainerInterface $container, array $fields ): array {
'merchant_email_sandbox' => array(
'title' => __( 'Sandbox Email address', 'woocommerce-paypal-payments' ),
'classes' => array( State::STATE_ONBOARDED === $state->sandbox_state() ? 'onboarded' : '', 'ppcp-always-shown-element' ),
'type' => 'text',
'type' => 'email',
'required' => true,
'desc_tip' => true,
'description' => __( 'The email address of your PayPal account.', 'woocommerce-paypal-payments' ),

View file

@ -568,6 +568,7 @@ class SettingsListener {
break;
case 'text':
case 'number':
case 'email':
$settings[ $key ] = isset( $raw_data[ $key ] ) ? wp_kses_post( $raw_data[ $key ] ) : '';
break;
case 'ppcp-password':