|
@@ 1174-1180 (lines=7) @@
|
| 1171 |
|
} |
| 1172 |
|
} |
| 1173 |
|
|
| 1174 |
|
public function validate_publishable_key_field( $key, $value ) { |
| 1175 |
|
$value = $this->validate_text_field( $key, $value ); |
| 1176 |
|
if ( ! empty( $value ) && ! preg_match( '/^pk_live_/', $value ) ) { |
| 1177 |
|
throw new Exception( __( 'The "Live Publishable Key" should start with "pk_live", enter the correct key.', 'woocommerce-gateway-stripe' ) ); |
| 1178 |
|
} |
| 1179 |
|
return $value; |
| 1180 |
|
} |
| 1181 |
|
|
| 1182 |
|
public function validate_secret_key_field( $key, $value ) { |
| 1183 |
|
$value = $this->validate_text_field( $key, $value ); |
|
@@ 1182-1188 (lines=7) @@
|
| 1179 |
|
return $value; |
| 1180 |
|
} |
| 1181 |
|
|
| 1182 |
|
public function validate_secret_key_field( $key, $value ) { |
| 1183 |
|
$value = $this->validate_text_field( $key, $value ); |
| 1184 |
|
if ( ! empty( $value ) && ! preg_match( '/^[rs]k_live_/', $value ) ) { |
| 1185 |
|
throw new Exception( __( 'The "Live Secret Key" should start with "sk_live" or "rk_live", enter the correct key.', 'woocommerce-gateway-stripe' ) ); |
| 1186 |
|
} |
| 1187 |
|
return $value; |
| 1188 |
|
} |
| 1189 |
|
|
| 1190 |
|
public function validate_test_publishable_key_field( $key, $value ) { |
| 1191 |
|
$value = $this->validate_text_field( $key, $value ); |
|
@@ 1190-1196 (lines=7) @@
|
| 1187 |
|
return $value; |
| 1188 |
|
} |
| 1189 |
|
|
| 1190 |
|
public function validate_test_publishable_key_field( $key, $value ) { |
| 1191 |
|
$value = $this->validate_text_field( $key, $value ); |
| 1192 |
|
if ( ! empty( $value ) && ! preg_match( '/^pk_test_/', $value ) ) { |
| 1193 |
|
throw new Exception( __( 'The "Test Publishable Key" should start with "pk_test", enter the correct key.', 'woocommerce-gateway-stripe' ) ); |
| 1194 |
|
} |
| 1195 |
|
return $value; |
| 1196 |
|
} |
| 1197 |
|
|
| 1198 |
|
public function validate_test_secret_key_field( $key, $value ) { |
| 1199 |
|
$value = $this->validate_text_field( $key, $value ); |
|
@@ 1198-1204 (lines=7) @@
|
| 1195 |
|
return $value; |
| 1196 |
|
} |
| 1197 |
|
|
| 1198 |
|
public function validate_test_secret_key_field( $key, $value ) { |
| 1199 |
|
$value = $this->validate_text_field( $key, $value ); |
| 1200 |
|
if ( ! empty( $value ) && ! preg_match( '/^[rs]k_test_/', $value ) ) { |
| 1201 |
|
throw new Exception( __( 'The "Test Secret Key" should start with "sk_test" or "rk_test", enter the correct key.', 'woocommerce-gateway-stripe' ) ); |
| 1202 |
|
} |
| 1203 |
|
return $value; |
| 1204 |
|
} |
| 1205 |
|
} |
| 1206 |
|
|