mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 18:16:38 +08:00
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:
commit
b3df2374fd
3 changed files with 4 additions and 3 deletions
|
@ -45,7 +45,7 @@ label.error {
|
||||||
font-size: 1.1em;
|
font-size: 1.1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.input-text[pattern]:invalid {
|
.input-text[pattern]:invalid, .input-text[type=email]:invalid {
|
||||||
border: red solid 2px;
|
border: red solid 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -238,7 +238,7 @@ return function ( ContainerInterface $container, array $fields ): array {
|
||||||
'merchant_email_production' => array(
|
'merchant_email_production' => array(
|
||||||
'title' => __( 'Live Email address', 'woocommerce-paypal-payments' ),
|
'title' => __( 'Live Email address', 'woocommerce-paypal-payments' ),
|
||||||
'classes' => array( State::STATE_ONBOARDED === $state->production_state() ? 'onboarded' : '', 'ppcp-always-shown-element' ),
|
'classes' => array( State::STATE_ONBOARDED === $state->production_state() ? 'onboarded' : '', 'ppcp-always-shown-element' ),
|
||||||
'type' => 'text',
|
'type' => 'email',
|
||||||
'required' => true,
|
'required' => true,
|
||||||
'desc_tip' => true,
|
'desc_tip' => true,
|
||||||
'description' => __( 'The email address of your PayPal account.', 'woocommerce-paypal-payments' ),
|
'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(
|
'merchant_email_sandbox' => array(
|
||||||
'title' => __( 'Sandbox Email address', 'woocommerce-paypal-payments' ),
|
'title' => __( 'Sandbox Email address', 'woocommerce-paypal-payments' ),
|
||||||
'classes' => array( State::STATE_ONBOARDED === $state->sandbox_state() ? 'onboarded' : '', 'ppcp-always-shown-element' ),
|
'classes' => array( State::STATE_ONBOARDED === $state->sandbox_state() ? 'onboarded' : '', 'ppcp-always-shown-element' ),
|
||||||
'type' => 'text',
|
'type' => 'email',
|
||||||
'required' => true,
|
'required' => true,
|
||||||
'desc_tip' => true,
|
'desc_tip' => true,
|
||||||
'description' => __( 'The email address of your PayPal account.', 'woocommerce-paypal-payments' ),
|
'description' => __( 'The email address of your PayPal account.', 'woocommerce-paypal-payments' ),
|
||||||
|
|
|
@ -568,6 +568,7 @@ class SettingsListener {
|
||||||
break;
|
break;
|
||||||
case 'text':
|
case 'text':
|
||||||
case 'number':
|
case 'number':
|
||||||
|
case 'email':
|
||||||
$settings[ $key ] = isset( $raw_data[ $key ] ) ? wp_kses_post( $raw_data[ $key ] ) : '';
|
$settings[ $key ] = isset( $raw_data[ $key ] ) ? wp_kses_post( $raw_data[ $key ] ) : '';
|
||||||
break;
|
break;
|
||||||
case 'ppcp-password':
|
case 'ppcp-password':
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue