PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 6.23
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v6.23
6.35 6.34 6.33.1 6.33 6.32.1 6.32 6.31 6.25 6.25.1 6.26 6.26.1 6.27 6.28 6.29 6.3 6.3.1 6.3.2 6.30 6.4 6.4.1 6.4.2 6.5 6.5.1 6.5.2 6.5.3 All 141 releases
formidable / stripe / controllers / FrmStrpLiteHooksController.php

FrmStrpLiteHooksController.php in Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More 6.23, at stripe/controllers/FrmStrpLiteHooksController.php

94 lines 3.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if ( ! defined( 'ABSPATH' ) ) {
3 die( 'You are not allowed to call this page directly.' );
4 }
5
6 class FrmStrpLiteHooksController {
7
8 /**
9 * @return void
10 */
11 public static function load_hooks() {
12 if ( class_exists( 'FrmStrpHooksController', false ) ) {
13 // Exit early, let the Stripe add on handle everything.
14 return;
15 }
16
17 // Actions.
18 add_action( 'frm_entry_form', 'FrmStrpLiteAuth::add_hidden_token_field' );
19 add_action( 'frm_enqueue_form_scripts', 'FrmStrpLiteActionsController::maybe_load_scripts' );
20 add_action( 'init', 'FrmStrpLiteConnectHelper::check_for_stripe_connect_webhooks' );
21
22 // Filters.
23 add_filter( 'frm_saved_errors', 'FrmStrpLiteAppController::maybe_add_payment_error', 10, 2 );
24 add_filter( 'frm_filter_final_form', 'FrmStrpLiteAuth::maybe_show_message' );
25 add_filter( 'frm_setup_edit_entry_vars', 'FrmStrpLiteAppController::maybe_delete_pay_entry', 20, 2 );
26
27 add_filter( 'frm_pro_show_card_callback', 'FrmStrpLiteActionsController::maybe_show_card', 10, 2 );
28
29 // This filter hides gateway fields from the entries list.
30 add_filter(
31 'frm_fields_in_entries_list_table',
32 function ( $form_cols ) {
33 return array_filter(
34 $form_cols,
35 function ( $form_col ) {
36 return 'gateway' !== $form_col->type;
37 }
38 );
39 }
40 );
41
42 add_filter( 'frm_payment_gateways', 'FrmStrpLiteAppController::add_gateway' );
43 add_filter( 'frm_validate_credit_card_field_entry', 'FrmStrpLiteActionsController::remove_cc_validation', 20, 3 );
44
45 // Stripe link.
46 add_filter( 'frm_form_object', 'FrmStrpLiteLinkController::force_ajax_submit_for_stripe_link' );
47 add_action( 'frm_form_classes', 'FrmStrpLiteLinkController::add_form_classes' );
48 }
49
50 /**
51 * @return void
52 */
53 public static function load_admin_hooks() {
54 if ( class_exists( 'FrmStrpHooksController', false ) ) {
55 // Exit early, let the Stripe add on handle everything.
56 return;
57 }
58
59 // Actions.
60 add_action( 'frm_after_uninstall', 'FrmStrpLiteAppController::uninstall' );
61 add_filter( 'frm_add_settings_section', 'FrmStrpLiteSettingsController::add_settings_section' );
62 add_action( 'admin_init', 'FrmStrpLiteAppController::maybe_redirect_to_stripe_settings' );
63 add_action( 'frm_update_settings', 'FrmStrpLiteSettingsController::process_form' );
64
65 // Filters.
66 add_filter( 'frm_pay_action_defaults', 'FrmStrpLiteActionsController::add_action_defaults' );
67 add_filter( 'frm_before_save_payment_action', 'FrmStrpLiteActionsController::before_save_settings', 10, 2 );
68 add_filter( 'frm_pay_stripe_receipt', 'FrmStrpLitePaymentsController::get_receipt_link' );
69 add_filter( 'frm_sub_stripe_receipt', 'FrmStrpLitePaymentsController::get_receipt_link' );
70
71 if ( defined( 'DOING_AJAX' ) ) {
72 self::load_ajax_hooks();
73 }
74 }
75
76 /**
77 * @return void
78 */
79 private static function load_ajax_hooks() {
80 $frm_strp_events_controller = new FrmStrpLiteEventsController();
81 add_action( 'wp_ajax_nopriv_frm_strp_process_events', array( &$frm_strp_events_controller, 'process_connect_events' ) );
82 add_action( 'wp_ajax_frm_strp_process_events', array( &$frm_strp_events_controller, 'process_connect_events' ) );
83 add_action( 'wp_ajax_nopriv_frm_strp_amount', 'FrmStrpLiteAuth::update_intent_ajax' );
84 add_action( 'wp_ajax_frm_strp_amount', 'FrmStrpLiteAuth::update_intent_ajax' );
85
86 // Stripe link.
87 add_action( 'wp_ajax_nopriv_frmstrplinkreturn', 'FrmStrpLiteLinkController::handle_return_url' );
88 add_action( 'wp_ajax_frmstrplinkreturn', 'FrmStrpLiteLinkController::handle_return_url' );
89
90 // Stripe Lite.
91 add_action( 'wp_ajax_nopriv_frm_strp_lite_verify', 'FrmStrpLiteConnectHelper::verify' );
92 }
93 }
94