type; } ); } ); add_filter( 'frm_payment_gateways', 'FrmStrpLiteAppController::add_gateway' ); add_filter( 'frm_validate_credit_card_field_entry', 'FrmStrpLiteActionsController::remove_cc_validation', 20, 3 ); // Stripe link. add_filter( 'frm_form_object', 'FrmStrpLiteLinkController::force_ajax_submit_for_stripe_link' ); add_action( 'frm_form_classes', 'FrmStrpLiteLinkController::add_form_classes' ); } /** * @return void */ public static function load_admin_hooks() { if ( class_exists( 'FrmStrpHooksController', false ) ) { // Exit early, let the Stripe add on handle everything. return; } // Actions. add_action( 'frm_after_uninstall', 'FrmStrpLiteAppController::uninstall' ); add_filter( 'frm_add_settings_section', 'FrmStrpLiteSettingsController::add_settings_section' ); add_action( 'frm_update_settings', 'FrmStrpLiteSettingsController::process_form' ); // Filters. add_filter( 'frm_pay_action_defaults', 'FrmStrpLiteActionsController::add_action_defaults' ); add_filter( 'frm_before_save_payment_action', 'FrmStrpLiteActionsController::before_save_settings', 10, 2 ); add_filter( 'frm_pay_stripe_receipt', 'FrmStrpLitePaymentsController::get_receipt_link' ); add_filter( 'frm_sub_stripe_receipt', 'FrmStrpLitePaymentsController::get_receipt_link' ); if ( defined( 'DOING_AJAX' ) ) { self::load_ajax_hooks(); } } /** * @return void */ private static function load_ajax_hooks() { $frm_strp_events_controller = new FrmStrpLiteEventsController(); add_action( 'wp_ajax_nopriv_frm_strp_process_events', array( &$frm_strp_events_controller, 'process_connect_events' ) ); add_action( 'wp_ajax_frm_strp_process_events', array( &$frm_strp_events_controller, 'process_connect_events' ) ); add_action( 'wp_ajax_nopriv_frm_strp_amount', 'FrmStrpLiteAuth::update_intent_ajax' ); add_action( 'wp_ajax_frm_strp_amount', 'FrmStrpLiteAuth::update_intent_ajax' ); // Stripe link. add_action( 'wp_ajax_nopriv_frmstrplinkreturn', 'FrmStrpLiteLinkController::handle_return_url' ); add_action( 'wp_ajax_frmstrplinkreturn', 'FrmStrpLiteLinkController::handle_return_url' ); // Stripe Lite. add_action( 'wp_ajax_nopriv_frm_strp_lite_verify', 'FrmStrpLiteConnectHelper::verify' ); } }