| @@ -23,23 +23,22 @@ | ||
| 23 | 23 | add_filter( 'frm_saved_errors', 'FrmStrpLiteAppController::maybe_add_payment_error', 10, 2 ); |
| 24 | 24 | add_filter( 'frm_filter_final_form', 'FrmStrpLiteAuth::maybe_show_message' ); |
| 25 | 25 | add_filter( 'frm_setup_edit_entry_vars', 'FrmStrpLiteAppController::maybe_delete_pay_entry', 20, 2 ); |
| 26 | 26 | |
| 27 | - // This filter flags the Pro credit card field that Stripe is enabled. | |
| 28 | - add_filter( | |
| 29 | - 'frm_pro_show_card_callback', | |
| 30 | - function() { | |
| 31 | - return 'FrmStrpLiteActionsController::show_card'; | |
| 32 | - } | |
| 33 | - ); | |
| 27 | + add_filter( 'frm_pro_show_card_callback', 'FrmStrpLiteActionsController::maybe_show_card', 10, 2 ); | |
| 34 | 28 | |
| 35 | 29 | // This filter hides gateway fields from the entries list. |
| 36 | 30 | add_filter( |
| 37 | 31 | 'frm_fields_in_entries_list_table', |
| 38 | - function( $form_cols ) { | |
| 32 | + function ( $form_cols ) { | |
| 39 | 33 | return array_filter( |
| 40 | 34 | $form_cols, |
| 41 | - function( $form_col ) { | |
| 35 | + /** | |
| 36 | + * @param stdClass $form_col | |
| 37 | + * | |
| 38 | + * @return bool | |
| 39 | + */ | |
| 40 | + function ( $form_col ) { | |
| 42 | 41 | return 'gateway' !== $form_col->type; |
| 43 | 42 | } |
| 44 | 43 | ); |
| 45 | 44 | } |
| @@ -45,12 +44,13 @@ | ||
| 45 | 44 | } |
| 46 | 45 | ); |
| 47 | 46 | |
| 48 | 47 | add_filter( 'frm_payment_gateways', 'FrmStrpLiteAppController::add_gateway' ); |
| 48 | + add_filter( 'frm_validate_credit_card_field_entry', 'FrmStrpLiteActionsController::remove_cc_validation', 20, 3 ); | |
| 49 | 49 | |
| 50 | 50 | // Stripe link. |
| 51 | 51 | add_filter( 'frm_form_object', 'FrmStrpLiteLinkController::force_ajax_submit_for_stripe_link' ); |
| 52 | - add_filter( 'frm_form_classes', 'FrmStrpLiteLinkController::add_form_classes' ); | |
| 52 | + add_action( 'frm_form_classes', 'FrmStrpLiteLinkController::add_form_classes' ); | |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | /** |
| 56 | 56 | * @return void |
| @@ -62,10 +62,9 @@ | ||
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | // Actions. |
| 65 | 65 | add_action( 'frm_after_uninstall', 'FrmStrpLiteAppController::uninstall' ); |
| 66 | - add_action( 'frm_add_settings_section', 'FrmStrpLiteSettingsController::add_settings_section' ); | |
| 67 | - add_action( 'admin_init', 'FrmStrpLiteAppController::maybe_redirect_to_stripe_settings' ); | |
| 66 | + add_filter( 'frm_add_settings_section', 'FrmStrpLiteSettingsController::add_settings_section' ); | |
| 68 | 67 | add_action( 'frm_update_settings', 'FrmStrpLiteSettingsController::process_form' ); |
| 69 | 68 | |
| 70 | 69 | // Filters. |
| 71 | 70 | add_filter( 'frm_pay_action_defaults', 'FrmStrpLiteActionsController::add_action_defaults' ); |
| @@ -91,8 +90,8 @@ | ||
| 91 | 90 | // Stripe link. |
| 92 | 91 | add_action( 'wp_ajax_nopriv_frmstrplinkreturn', 'FrmStrpLiteLinkController::handle_return_url' ); |
| 93 | 92 | add_action( 'wp_ajax_frmstrplinkreturn', 'FrmStrpLiteLinkController::handle_return_url' ); |
| 94 | 93 | |
| 95 | - // Stripe Lite | |
| 94 | + // Stripe Lite. | |
| 96 | 95 | add_action( 'wp_ajax_nopriv_frm_strp_lite_verify', 'FrmStrpLiteConnectHelper::verify' ); |
| 97 | 96 | } |
| 98 | 97 | } |