@@ -111,7 +111,7 @@ public function validate_fields() {
111111
112112 // unknown token?
113113 if ( ! $ this ->has_payment_token ( get_current_user_id (), SV_WC_Helper::get_post ( 'wc- ' . $ this ->get_id_dasherized () . '-payment-token ' ) ) ) {
114- wc_add_notice ( _x ( 'Payment error, please try another payment method or contact us to complete your transaction. ' , 'Supports tokenization ' , $ this ->text_domain ), 'error ' );
114+ SV_WC_Helper:: wc_add_notice ( _x ( 'Payment error, please try another payment method or contact us to complete your transaction. ' , 'Supports tokenization ' , $ this ->text_domain ), 'error ' );
115115 $ is_valid = false ;
116116 }
117117
@@ -184,7 +184,7 @@ protected function validate_credit_card_expiration_date( $expiration_month, $exp
184184 ( $ expiration_year == $ current_year && $ expiration_month < $ current_month ) ||
185185 $ expiration_year > $ current_year + 20
186186 ) {
187- wc_add_notice ( _x ( 'Card expiration date is invalid ' , 'Supports direct credit card ' , $ this ->text_domain ), 'error ' );
187+ SV_WC_Helper:: wc_add_notice ( _x ( 'Card expiration date is invalid ' , 'Supports direct credit card ' , $ this ->text_domain ), 'error ' );
188188 $ is_valid = false ;
189189 }
190190
@@ -208,23 +208,23 @@ protected function validate_credit_card_account_number( $account_number ) {
208208
209209 if ( empty ( $ account_number ) ) {
210210
211- wc_add_notice ( _x ( 'Card number is missing ' , 'Supports direct credit card ' , $ this ->text_domain ), 'error ' );
211+ SV_WC_Helper:: wc_add_notice ( _x ( 'Card number is missing ' , 'Supports direct credit card ' , $ this ->text_domain ), 'error ' );
212212 $ is_valid = false ;
213213
214214 } else {
215215
216216 if ( strlen ( $ account_number ) < 12 || strlen ( $ account_number ) > 19 ) {
217- wc_add_notice ( _x ( 'Card number is invalid (wrong length) ' , 'Supports direct credit card ' , $ this ->text_domain ), 'error ' );
217+ SV_WC_Helper:: wc_add_notice ( _x ( 'Card number is invalid (wrong length) ' , 'Supports direct credit card ' , $ this ->text_domain ), 'error ' );
218218 $ is_valid = false ;
219219 }
220220
221221 if ( ! ctype_digit ( $ account_number ) ) {
222- wc_add_notice ( _x ( 'Card number is invalid (only digits allowed) ' , 'Supports direct credit card ' , $ this ->text_domain ), 'error ' );
222+ SV_WC_Helper:: wc_add_notice ( _x ( 'Card number is invalid (only digits allowed) ' , 'Supports direct credit card ' , $ this ->text_domain ), 'error ' );
223223 $ is_valid = false ;
224224 }
225225
226226 if ( ! SV_WC_Payment_Gateway_Helper::luhn_check ( $ account_number ) ) {
227- wc_add_notice ( _x ( 'Card number is invalid ' , 'Supports direct credit card ' , $ this ->text_domain ), 'error ' );
227+ SV_WC_Helper:: wc_add_notice ( _x ( 'Card number is invalid ' , 'Supports direct credit card ' , $ this ->text_domain ), 'error ' );
228228 $ is_valid = false ;
229229 }
230230
@@ -249,20 +249,20 @@ protected function validate_csc( $csc ) {
249249 // validate security code
250250 if ( empty ( $ csc ) ) {
251251
252- wc_add_notice ( _x ( 'Card security code is missing ' , 'Supports direct credit card ' , $ this ->text_domain ), 'error ' );
252+ SV_WC_Helper:: wc_add_notice ( _x ( 'Card security code is missing ' , 'Supports direct credit card ' , $ this ->text_domain ), 'error ' );
253253 $ is_valid = false ;
254254
255255 } else {
256256
257257 // digit validation
258258 if ( ! ctype_digit ( $ csc ) ) {
259- wc_add_notice ( _x ( 'Card security code is invalid (only digits are allowed) ' , 'Supports direct credit card ' , $ this ->text_domain ), 'error ' );
259+ SV_WC_Helper:: wc_add_notice ( _x ( 'Card security code is invalid (only digits are allowed) ' , 'Supports direct credit card ' , $ this ->text_domain ), 'error ' );
260260 $ is_valid = false ;
261261 }
262262
263263 // length validation
264264 if ( strlen ( $ csc ) < 3 || strlen ( $ csc ) > 4 ) {
265- wc_add_notice ( _x ( 'Card security code is invalid (must be 3 or 4 digits) ' , 'Supports direct credit card ' , $ this ->text_domain ), 'error ' );
265+ SV_WC_Helper:: wc_add_notice ( _x ( 'Card security code is invalid (must be 3 or 4 digits) ' , 'Supports direct credit card ' , $ this ->text_domain ), 'error ' );
266266 $ is_valid = false ;
267267 }
268268
@@ -291,20 +291,20 @@ protected function validate_check_fields( $is_valid ) {
291291 // routing number exists?
292292 if ( empty ( $ routing_number ) ) {
293293
294- wc_add_notice ( _x ( 'Routing Number is missing ' , 'Supports direct cheque ' , $ this ->text_domain ), 'error ' );
294+ SV_WC_Helper:: wc_add_notice ( _x ( 'Routing Number is missing ' , 'Supports direct cheque ' , $ this ->text_domain ), 'error ' );
295295 $ is_valid = false ;
296296
297297 } else {
298298
299299 // routing number digit validation
300300 if ( ! ctype_digit ( $ routing_number ) ) {
301- wc_add_notice ( _x ( 'Routing Number is invalid (only digits are allowed) ' , 'Supports direct cheque ' , $ this ->text_domain ), 'error ' );
301+ SV_WC_Helper:: wc_add_notice ( _x ( 'Routing Number is invalid (only digits are allowed) ' , 'Supports direct cheque ' , $ this ->text_domain ), 'error ' );
302302 $ is_valid = false ;
303303 }
304304
305305 // routing number length validation
306306 if ( 9 != strlen ( $ routing_number ) ) {
307- wc_add_notice ( _x ( 'Routing number is invalid (must be 9 digits) ' , 'Supports direct cheque ' , $ this ->text_domain ), 'error ' );
307+ SV_WC_Helper:: wc_add_notice ( _x ( 'Routing number is invalid (must be 9 digits) ' , 'Supports direct cheque ' , $ this ->text_domain ), 'error ' );
308308 $ is_valid = false ;
309309 }
310310
@@ -313,33 +313,33 @@ protected function validate_check_fields( $is_valid ) {
313313 // account number exists?
314314 if ( empty ( $ account_number ) ) {
315315
316- wc_add_notice ( _x ( 'Account Number is missing ' , 'Supports direct cheque ' , $ this ->text_domain ), 'error ' );
316+ SV_WC_Helper:: wc_add_notice ( _x ( 'Account Number is missing ' , 'Supports direct cheque ' , $ this ->text_domain ), 'error ' );
317317 $ is_valid = false ;
318318
319319 } else {
320320
321321 // account number digit validation
322322 if ( ! ctype_digit ( $ account_number ) ) {
323- wc_add_notice ( _x ( 'Account Number is invalid (only digits are allowed) ' , 'Supports direct cheque ' , $ this ->text_domain ), 'error ' );
323+ SV_WC_Helper:: wc_add_notice ( _x ( 'Account Number is invalid (only digits are allowed) ' , 'Supports direct cheque ' , $ this ->text_domain ), 'error ' );
324324 $ is_valid = false ;
325325 }
326326
327327 // account number length validation
328328 if ( strlen ( $ account_number ) < 5 || strlen ( $ account_number ) > 17 ) {
329- wc_add_notice ( _x ( 'Account number is invalid (must be between 5 and 17 digits) ' , 'Supports direct cheque ' , $ this ->text_domain ), 'error ' );
329+ SV_WC_Helper:: wc_add_notice ( _x ( 'Account number is invalid (must be between 5 and 17 digits) ' , 'Supports direct cheque ' , $ this ->text_domain ), 'error ' );
330330 $ is_valid = false ;
331331 }
332332 }
333333
334334 // optional drivers license number validation
335335 if ( ! empty ( $ drivers_license_number ) && preg_match ( '/^[a-zA-Z0-9 -]+$/ ' , $ drivers_license_number ) ) {
336- wc_add_notice ( _x ( 'Drivers license number is invalid ' , 'Supports direct cheque ' , $ this ->text_domain ), 'error ' );
336+ SV_WC_Helper:: wc_add_notice ( _x ( 'Drivers license number is invalid ' , 'Supports direct cheque ' , $ this ->text_domain ), 'error ' );
337337 $ is_valid = false ;
338338 }
339339
340340 // optional check number validation
341341 if ( ! empty ( $ check_number ) && ! ctype_digit ( $ check_number ) ) {
342- wc_add_notice ( _x ( 'Check Number is invalid (only digits are allowed) ' , 'Supports direct cheque ' , $ this ->text_domain ), 'error ' );
342+ SV_WC_Helper:: wc_add_notice ( _x ( 'Check Number is invalid (only digits are allowed) ' , 'Supports direct cheque ' , $ this ->text_domain ), 'error ' );
343343 $ is_valid = false ;
344344 }
345345
@@ -2162,7 +2162,7 @@ public function handle_my_payment_methods_actions() {
21622162 // security check
21632163 if ( false === wp_verify_nonce ( $ _GET ['_wpnonce ' ], 'wc- ' . $ this ->get_id_dasherized () . '-token-action ' ) ) {
21642164
2165- wc_add_notice ( _x ( 'There was an error with your request, please try again. ' , 'Supports direct payment method tokenization ' , $ this ->text_domain ), 'error ' );
2165+ SV_WC_Helper:: wc_add_notice ( _x ( 'There was an error with your request, please try again. ' , 'Supports direct payment method tokenization ' , $ this ->text_domain ), 'error ' );
21662166
21672167 wp_redirect ( get_permalink ( wc_get_page_id ( 'myaccount ' ) ) );
21682168 exit ;
@@ -2177,10 +2177,10 @@ public function handle_my_payment_methods_actions() {
21772177
21782178 if ( ! $ this ->remove_payment_token ( $ user_id , $ token ) ) {
21792179
2180- wc_add_notice ( _x ( 'Error removing payment method ' , 'Supports direct payment method tokenization ' , $ this ->text_domain ), 'error ' );
2180+ SV_WC_Helper:: wc_add_notice ( _x ( 'Error removing payment method ' , 'Supports direct payment method tokenization ' , $ this ->text_domain ), 'error ' );
21812181
21822182 } else {
2183- wc_add_notice ( _x ( 'Payment method deleted. ' , 'Supports direct payment method tokenization ' , $ this ->text_domain ) );
2183+ SV_WC_Helper:: wc_add_notice ( _x ( 'Payment method deleted. ' , 'Supports direct payment method tokenization ' , $ this ->text_domain ) );
21842184 }
21852185
21862186 }
0 commit comments