@@ 1188-1194 (lines=7) @@ | ||
1185 | } |
|
1186 | } |
|
1187 | ||
1188 | public function validate_publishable_key_field( $key, $value ) { |
|
1189 | $value = $this->validate_text_field( $key, $value ); |
|
1190 | if ( ! empty( $value ) && ! preg_match( '/^pk_live_/', $value ) ) { |
|
1191 | throw new Exception( __( 'The "Live Publishable Key" should start with "pk_live", enter the correct key.', 'woocommerce-gateway-stripe' ) ); |
|
1192 | } |
|
1193 | return $value; |
|
1194 | } |
|
1195 | ||
1196 | public function validate_secret_key_field( $key, $value ) { |
|
1197 | $value = $this->validate_text_field( $key, $value ); |
|
@@ 1196-1202 (lines=7) @@ | ||
1193 | return $value; |
|
1194 | } |
|
1195 | ||
1196 | public function validate_secret_key_field( $key, $value ) { |
|
1197 | $value = $this->validate_text_field( $key, $value ); |
|
1198 | if ( ! empty( $value ) && ! preg_match( '/^[rs]k_live_/', $value ) ) { |
|
1199 | throw new Exception( __( 'The "Live Secret Key" should start with "sk_live" or "rk_live", enter the correct key.', 'woocommerce-gateway-stripe' ) ); |
|
1200 | } |
|
1201 | return $value; |
|
1202 | } |
|
1203 | ||
1204 | public function validate_test_publishable_key_field( $key, $value ) { |
|
1205 | $value = $this->validate_text_field( $key, $value ); |
|
@@ 1204-1210 (lines=7) @@ | ||
1201 | return $value; |
|
1202 | } |
|
1203 | ||
1204 | public function validate_test_publishable_key_field( $key, $value ) { |
|
1205 | $value = $this->validate_text_field( $key, $value ); |
|
1206 | if ( ! empty( $value ) && ! preg_match( '/^pk_test_/', $value ) ) { |
|
1207 | throw new Exception( __( 'The "Test Publishable Key" should start with "pk_test", enter the correct key.', 'woocommerce-gateway-stripe' ) ); |
|
1208 | } |
|
1209 | return $value; |
|
1210 | } |
|
1211 | ||
1212 | public function validate_test_secret_key_field( $key, $value ) { |
|
1213 | $value = $this->validate_text_field( $key, $value ); |
|
@@ 1212-1218 (lines=7) @@ | ||
1209 | return $value; |
|
1210 | } |
|
1211 | ||
1212 | public function validate_test_secret_key_field( $key, $value ) { |
|
1213 | $value = $this->validate_text_field( $key, $value ); |
|
1214 | if ( ! empty( $value ) && ! preg_match( '/^[rs]k_test_/', $value ) ) { |
|
1215 | throw new Exception( __( 'The "Test Secret Key" should start with "sk_test" or "rk_test", enter the correct key.', 'woocommerce-gateway-stripe' ) ); |
|
1216 | } |
|
1217 | return $value; |
|
1218 | } |
|
1219 | } |
|
1220 |