PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 6.5
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v6.5
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.5, at stripe/controllers/FrmStrpLiteSettingsController.php

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