← All changes
|
square/controllers/FrmSquareLiteActionsController.php
+2
-32
6.27
→
trunk
View file →
| @@ -115,9 +115,9 @@ | ||
| 115 | 115 | return $response; |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | if ( ! self::square_is_configured() ) { |
| 119 | - $response['error'] = __( 'There was a problem communicating with Square. Please try again.', 'formidable' ); | |
| 119 | + $response['error'] = __( 'Square still needs to be configured.', 'formidable' ); | |
| 120 | 120 | return $response; |
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | $payment_args = compact( 'form', 'entry', 'action', 'amount' ); |
| @@ -402,28 +402,8 @@ | ||
| 402 | 402 | return (bool) FrmSquareLiteConnectHelper::get_merchant_id(); |
| 403 | 403 | } |
| 404 | 404 | |
| 405 | 405 | /** |
| 406 | - * Replace an [email] shortcode with the current user email. | |
| 407 | - * | |
| 408 | - * @param string $email | |
| 409 | - * | |
| 410 | - * @return string | |
| 411 | - */ | |
| 412 | - private static function replace_email_shortcode( $email ) { | |
| 413 | - if ( ! str_contains( $email, '[email]' ) ) { | |
| 414 | - return $email; | |
| 415 | - } | |
| 416 | - | |
| 417 | - global $current_user; | |
| 418 | - return str_replace( | |
| 419 | - '[email]', | |
| 420 | - ! empty( $current_user->user_email ) ? $current_user->user_email : '', | |
| 421 | ||
| 422 | - ); | |
| 423 | - } | |
| 424 | - | |
| 425 | - /** | |
| 426 | 406 | * Convert the amount from 10.00 to 1000. |
| 427 | 407 | * |
| 428 | 408 | * @param mixed $amount |
| 429 | 409 | * @param array $atts |
| @@ -713,19 +693,9 @@ | ||
| 713 | 693 | if ( ! $has_processed ) { |
| 714 | 694 | return $errors; |
| 715 | 695 | } |
| 716 | 696 | |
| 717 | - $field_id = $field->temp_id ?? $field->id; | |
| 718 | - | |
| 719 | - if ( isset( $errors[ 'field' . $field_id . '-cc' ] ) ) { | |
| 720 | - unset( $errors[ 'field' . $field_id . '-cc' ] ); | |
| 721 | - } | |
| 722 | - | |
| 723 | - if ( isset( $errors[ 'field' . $field_id ] ) ) { | |
| 724 | - unset( $errors[ 'field' . $field_id ] ); | |
| 725 | - } | |
| 726 | - | |
| 727 | - return $errors; | |
| 697 | + return FrmTransLiteActionsController::remove_cc_errors( $errors, $field ); | |
| 728 | 698 | } |
| 729 | 699 | |
| 730 | 700 | /** |
| 731 | 701 | * @return void |