PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 6.33
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v6.33
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 / FrmStrpLiteSettingsController.php

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

87 lines 2.1 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 FrmStrpLiteSettingsController {
7
8 /**
9 * Add Stripe section to Global Settings.
10 *
11 * @param array $sections
12 *
13 * @return array
14 */
15 public static function add_settings_section( $sections ) {
16 $sections['stripe'] = array(
17 'class' => self::class,
18 'function' => 'route',
19 'icon' => 'frmfont frm_stripe_icon',
20 );
21
22 add_action(
23 'frm_messages_settings_form',
24 /**
25 * @param object $frm_settings
26 *
27 * @return void
28 */
29 function ( $frm_settings ) {
30 $stripe_settings = FrmStrpLiteAppHelper::get_settings()->settings;
31 require FrmStrpLiteAppHelper::plugin_path() . '/views/settings/messages.php';
32 }
33 );
34
35 return $sections;
36 }
37
38 /**
39 * Handle global settings routing.
40 *
41 * @return void
42 */
43 public static function route() {
44 self::global_settings_form();
45 }
46
47 /**
48 * Print the Stripe section for Global settings.
49 *
50 * @param array $atts
51 *
52 * @return void
53 */
54 public static function global_settings_form( $atts = array() ) {
55 $atts = array_merge( $atts, self::get_default_settings_atts() );
56 $errors = $atts['errors'];
57 $message = $atts['message'];
58 $settings = FrmStrpLiteAppHelper::get_settings();
59 $stripe_connect_is_live = FrmStrpLiteConnectHelper::stripe_connect_is_setup( 'live' );
60 $stripe_connect_is_on_for_test = FrmStrpLiteConnectHelper::stripe_connect_is_setup( 'test' );
61
62 include FrmStrpLiteAppHelper::plugin_path() . '/views/settings/form.php';
63 }
64
65 /**
66 * @return array
67 */
68 private static function get_default_settings_atts() {
69 return array(
70 'errors' => array(),
71 'message' => '',
72 );
73 }
74
75 /**
76 * Handle processing changes to global Stripe Settings.
77 *
78 * @return void
79 */
80 public static function process_form() {
81 $settings = FrmStrpLiteAppHelper::get_settings();
82 // phpcs:ignore WordPress.Security.NonceVerification.Missing
83 $settings->update( wp_unslash( $_POST ) );
84 $settings->store();
85 }
86 }
87