| @@ -57,20 +57,16 @@ | ||
| 57 | 57 | } |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | /** |
| 61 | - * Redirect to Stripe settings when payments are not yet installed | |
| 62 | - * and the payments page is accessed by its URL. | |
| 61 | + * Gets payments settings URL. | |
| 63 | 62 | * |
| 64 | - * @return void | |
| 63 | + * @since 6.30 | |
| 64 | + * | |
| 65 | + * @return string | |
| 65 | 66 | */ |
| 66 | - public static function maybe_redirect_to_stripe_settings() { | |
| 67 | - if ( ! FrmAppHelper::is_admin_page( 'formidable-payments' ) || FrmTransLiteAppHelper::payments_table_exists() ) { | |
| 68 | - return; | |
| 69 | - } | |
| 70 | - | |
| 71 | - wp_safe_redirect( admin_url( 'admin.php?page=formidable-settings&t=stripe_settings' ) ); | |
| 72 | - die(); | |
| 67 | + public static function get_payments_settings_url() { | |
| 68 | + return admin_url( 'admin.php?page=formidable-settings&t=stripe_settings' ); | |
| 73 | 69 | } |
| 74 | 70 | |
| 75 | 71 | /** |
| 76 | 72 | * Add the gateway for compatibility with the Payments submodule. |
| @@ -152,9 +148,9 @@ | ||
| 152 | 148 | if ( ! $cc_field_id ) { |
| 153 | 149 | return $errors; |
| 154 | 150 | } |
| 155 | 151 | |
| 156 | - $is_setup_intent = 0 === strpos( $intent->id, 'seti_' ); | |
| 152 | + $is_setup_intent = str_starts_with( $intent->id, 'seti_' ); | |
| 157 | 153 | |
| 158 | 154 | if ( $is_setup_intent ) { |
| 159 | 155 | $errors[ 'field' . $cc_field_id ] = is_object( $intent->last_setup_error ) ? $intent->last_setup_error->message : ''; |
| 160 | 156 | } else { |
| @@ -237,6 +233,18 @@ | ||
| 237 | 233 | self::$delete_pay_entry = false; |
| 238 | 234 | return FrmTransLiteActionsController::fill_entry_from_previous( $values, $field ); |
| 239 | 235 | } |
| 240 | 236 | return $values; |
| 237 | + } | |
| 238 | + | |
| 239 | + /** | |
| 240 | + * Redirect to Stripe settings when payments are not yet installed | |
| 241 | + * and the payments page is accessed by its URL. | |
| 242 | + * | |
| 243 | + * @deprecated 6.33 | |
| 244 | + * | |
| 245 | + * @return void | |
| 246 | + */ | |
| 247 | + public static function maybe_redirect_to_stripe_settings() { | |
| 248 | + _deprecated_function( __METHOD__, '6.33' ); | |
| 241 | 249 | } |
| 242 | 250 | } |