Completed
Branch BUG/3575-event-deletion-previe... (bbeda1)
by
unknown
06:40 queued 04:49
created
caffeinated/core/libraries/shortcodes/EE_Newsletter_Shortcodes.lib.php 1 patch
Indentation   +81 added lines, -81 removed lines patch added patch discarded remove patch
@@ -14,93 +14,93 @@
 block discarded – undo
14 14
 class EE_Newsletter_Shortcodes extends EE_Shortcodes
15 15
 {
16 16
 
17
-    protected function _init_props()
18
-    {
19
-        $this->label = esc_html__("Batch Messages Shortcodes", 'event_espresso');
20
-        $this->description = esc_html__('All shortcodes used for the batch message type', 'event_espresso');
21
-        $this->_shortcodes = array(
22
-            '[NEWSLETTER_CONTENT]' => esc_html__(
23
-                'This will parse to whatever is found in the related [newsletter_content] field.  Note that when triggering a batch message, whatever is added for the custom message will be inserted where this shortcode is placed.',
24
-                'event_espresso'
25
-            ),
26
-        );
27
-    }
17
+	protected function _init_props()
18
+	{
19
+		$this->label = esc_html__("Batch Messages Shortcodes", 'event_espresso');
20
+		$this->description = esc_html__('All shortcodes used for the batch message type', 'event_espresso');
21
+		$this->_shortcodes = array(
22
+			'[NEWSLETTER_CONTENT]' => esc_html__(
23
+				'This will parse to whatever is found in the related [newsletter_content] field.  Note that when triggering a batch message, whatever is added for the custom message will be inserted where this shortcode is placed.',
24
+				'event_espresso'
25
+			),
26
+		);
27
+	}
28 28
 
29 29
 
30
-    protected function _parser($shortcode)
31
-    {
32
-        if ($shortcode == '[NEWSLETTER_CONTENT]') {
33
-            $this->_validate_list_requirements();
34
-            $valid_shortcodes = array('recipient_details', 'organization');
35
-            $template = $this->_data['template']['newsletter_content'];
36
-            $data = $this->_data;
37
-            return $this->_shortcode_helper->parse_message_template(
38
-                $template,
39
-                $data['data'],
40
-                $valid_shortcodes,
41
-                $this->_message_type,
42
-                $this->_messenger,
43
-                $this->_message
44
-            );
45
-        }
46
-    }
30
+	protected function _parser($shortcode)
31
+	{
32
+		if ($shortcode == '[NEWSLETTER_CONTENT]') {
33
+			$this->_validate_list_requirements();
34
+			$valid_shortcodes = array('recipient_details', 'organization');
35
+			$template = $this->_data['template']['newsletter_content'];
36
+			$data = $this->_data;
37
+			return $this->_shortcode_helper->parse_message_template(
38
+				$template,
39
+				$data['data'],
40
+				$valid_shortcodes,
41
+				$this->_message_type,
42
+				$this->_messenger,
43
+				$this->_message
44
+			);
45
+		}
46
+	}
47 47
 
48 48
 
49
-    /**
50
-     * Callback set in args for EE_Register_Messages_Shortcode_Library::register for 'msgr_validator_callback'.
51
-     *
52
-     * EE_Register_Messages_Shortcode_Library::register registers this callback with the
53
-     * 'FHEE__EE_messenger__get_validator_config' filter.
54
-     *
55
-     * @since    4.3.0
56
-     * @param  array        $validator_config current validator configuration array
57
-     * @param  EE_messenger $messenger
58
-     * @return  array                                             new validator config.
59
-     */
60
-    public static function messenger_validator_config($validator_config, EE_messenger $messenger)
61
-    {
62
-        if ($messenger->name !== 'email') {
63
-            return $validator_config;
64
-        }
49
+	/**
50
+	 * Callback set in args for EE_Register_Messages_Shortcode_Library::register for 'msgr_validator_callback'.
51
+	 *
52
+	 * EE_Register_Messages_Shortcode_Library::register registers this callback with the
53
+	 * 'FHEE__EE_messenger__get_validator_config' filter.
54
+	 *
55
+	 * @since    4.3.0
56
+	 * @param  array        $validator_config current validator configuration array
57
+	 * @param  EE_messenger $messenger
58
+	 * @return  array                                             new validator config.
59
+	 */
60
+	public static function messenger_validator_config($validator_config, EE_messenger $messenger)
61
+	{
62
+		if ($messenger->name !== 'email') {
63
+			return $validator_config;
64
+		}
65 65
 
66
-        $validator_config['content']['shortcodes'][] = 'newsletter';
67
-        $validator_config['newsletter_content'] = array(
68
-            'shortcodes' => array('recipient_details', 'organization'),
69
-            'required'   => array('[NEWSLETTER_CONTENT]'),
70
-        );
71
-        return $validator_config;
72
-    }
66
+		$validator_config['content']['shortcodes'][] = 'newsletter';
67
+		$validator_config['newsletter_content'] = array(
68
+			'shortcodes' => array('recipient_details', 'organization'),
69
+			'required'   => array('[NEWSLETTER_CONTENT]'),
70
+		);
71
+		return $validator_config;
72
+	}
73 73
 
74 74
 
75
-    /**
76
-     * Callback set in args for EE_Register_Messages_Shortcode_Library::register for
77
-     * 'msgr_template_fields_callback'.
78
-     *
79
-     * EE_Register_Messages_Shortcode_Library::register registers this callback with the
80
-     * FHEE__EE_messenger__get_template_fields filter.
81
-     *
82
-     * @since    4.3.0
83
-     *
84
-     * @param  array        $template_fields current template fields setup array.
85
-     * @param  EE_messenger $messenger
86
-     * @return  array                                           new/modified template fields array.
87
-     */
88
-    public static function messenger_template_fields($template_fields, EE_messenger $messenger)
89
-    {
90
-        if ($messenger->name !== 'email') {
91
-            return $template_fields;
92
-        }
75
+	/**
76
+	 * Callback set in args for EE_Register_Messages_Shortcode_Library::register for
77
+	 * 'msgr_template_fields_callback'.
78
+	 *
79
+	 * EE_Register_Messages_Shortcode_Library::register registers this callback with the
80
+	 * FHEE__EE_messenger__get_template_fields filter.
81
+	 *
82
+	 * @since    4.3.0
83
+	 *
84
+	 * @param  array        $template_fields current template fields setup array.
85
+	 * @param  EE_messenger $messenger
86
+	 * @return  array                                           new/modified template fields array.
87
+	 */
88
+	public static function messenger_template_fields($template_fields, EE_messenger $messenger)
89
+	{
90
+		if ($messenger->name !== 'email') {
91
+			return $template_fields;
92
+		}
93 93
 
94
-        $template_fields['extra']['content']['newsletter_content'] = array(
95
-            'input'               => 'wp_editor',
96
-            'label'               => '[NEWSLETTER_CONTENT]',
97
-            'type'                => 'string',
98
-            'required'            => true,
99
-            'validation'          => true,
100
-            'format'              => '%s',
101
-            'rows'                => '15',
102
-            'shortcodes_required' => array('[NEWSLETTER_CONTENT]'),
103
-        );
104
-        return $template_fields;
105
-    }
94
+		$template_fields['extra']['content']['newsletter_content'] = array(
95
+			'input'               => 'wp_editor',
96
+			'label'               => '[NEWSLETTER_CONTENT]',
97
+			'type'                => 'string',
98
+			'required'            => true,
99
+			'validation'          => true,
100
+			'format'              => '%s',
101
+			'rows'                => '15',
102
+			'shortcodes_required' => array('[NEWSLETTER_CONTENT]'),
103
+		);
104
+		return $template_fields;
105
+	}
106 106
 }
Please login to merge, or discard this patch.
caffeinated/payment_methods/Paypal_Pro/forms/PayPalProSettingsForm.php 1 patch
Indentation   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -18,30 +18,30 @@
 block discarded – undo
18 18
  */
19 19
 class PayPalProSettingsForm extends PayPalSettingsForm
20 20
 {
21
-    /**
22
-     * SettingsForm constructor.
23
-     *
24
-     * @param array $options_array
25
-     * @param string $help_tab_link
26
-     */
27
-    public function __construct(array $options_array = array(), $help_tab_link = '')
28
-    {
29
-        $options_array = array_replace_recursive(
30
-            array(
31
-                'extra_meta_inputs' => array(
32
-                    'credit_card_types' => new EE_Checkbox_Multi_Input(
33
-                        EE_PMT_Paypal_Pro::card_types_supported(),
34
-                        array(
35
-                            'html_label_text' => esc_html__('Card Types Supported', 'event_espresso'),
36
-                            'required' => true
37
-                        )
38
-                    ),
39
-                )
40
-            ),
41
-            $options_array
42
-        );
43
-        parent::__construct($options_array, $help_tab_link);
44
-    }
21
+	/**
22
+	 * SettingsForm constructor.
23
+	 *
24
+	 * @param array $options_array
25
+	 * @param string $help_tab_link
26
+	 */
27
+	public function __construct(array $options_array = array(), $help_tab_link = '')
28
+	{
29
+		$options_array = array_replace_recursive(
30
+			array(
31
+				'extra_meta_inputs' => array(
32
+					'credit_card_types' => new EE_Checkbox_Multi_Input(
33
+						EE_PMT_Paypal_Pro::card_types_supported(),
34
+						array(
35
+							'html_label_text' => esc_html__('Card Types Supported', 'event_espresso'),
36
+							'required' => true
37
+						)
38
+					),
39
+				)
40
+			),
41
+			$options_array
42
+		);
43
+		parent::__construct($options_array, $help_tab_link);
44
+	}
45 45
 }
46 46
 // End of file SettingsForm.php
47 47
 // Location: EventEspresso/caffeinated/payment_methods/PayPal_Pro/forms/PayPalProSettingsForm.php
Please login to merge, or discard this patch.
caffeinated/payment_methods/Aim/EE_PMT_Aim.pm.php 2 patches
Indentation   +239 added lines, -239 removed lines patch added patch discarded remove patch
@@ -12,261 +12,261 @@
 block discarded – undo
12 12
 {
13 13
 
14 14
 
15
-    /**
16
-     * @param EE_Payment_Method $pm_instance
17
-     * @return EE_PMT_Aim
18
-     * @throws \EE_Error
19
-     */
20
-    public function __construct($pm_instance = null)
21
-    {
22
-        $this->_setup_properties();
23
-        parent::__construct($pm_instance);
24
-    }
15
+	/**
16
+	 * @param EE_Payment_Method $pm_instance
17
+	 * @return EE_PMT_Aim
18
+	 * @throws \EE_Error
19
+	 */
20
+	public function __construct($pm_instance = null)
21
+	{
22
+		$this->_setup_properties();
23
+		parent::__construct($pm_instance);
24
+	}
25 25
 
26
-    /**
27
-     * Sets up payment method type properties for this gateway, which is normally
28
-     * done in the constructor, but we want this to be easy for similar gateways to override
29
-     * while still calling the parent constructor.
30
-     * So children should override this method instead of __construct
31
-     */
32
-    protected function _setup_properties()
33
-    {
34
-        require_once($this->file_folder() . 'EEG_Aim.gateway.php');
35
-        $this->_gateway = new EEG_Aim();
36
-        $this->_pretty_name = esc_html__("Authorize.net AIM", 'event_espresso');
37
-        $this->_default_description = esc_html__('Please provide the following billing information.', 'event_espresso');
38
-        $this->_requires_https = true;
39
-    }
26
+	/**
27
+	 * Sets up payment method type properties for this gateway, which is normally
28
+	 * done in the constructor, but we want this to be easy for similar gateways to override
29
+	 * while still calling the parent constructor.
30
+	 * So children should override this method instead of __construct
31
+	 */
32
+	protected function _setup_properties()
33
+	{
34
+		require_once($this->file_folder() . 'EEG_Aim.gateway.php');
35
+		$this->_gateway = new EEG_Aim();
36
+		$this->_pretty_name = esc_html__("Authorize.net AIM", 'event_espresso');
37
+		$this->_default_description = esc_html__('Please provide the following billing information.', 'event_espresso');
38
+		$this->_requires_https = true;
39
+	}
40 40
 
41 41
 
42 42
 
43
-    /**
44
-     * Creates the billing form for this payment method type
45
-     *
46
-     * @param \EE_Transaction $transaction
47
-     * @return EE_Billing_Info_Form
48
-     * @throws \EE_Error
49
-     */
50
-    public function generate_new_billing_form(EE_Transaction $transaction = null)
51
-    {
52
-        $billing_form = new EE_Billing_Attendee_Info_Form($this->_pm_instance, array(
53
-            'name' => 'AIM_Form',
54
-            'subsections' => array(
55
-                'credit_card' => new EE_Credit_Card_Input(array(
56
-                    'required' => true,
57
-                    'html_label_text' => esc_html__('Card Number', 'event_espresso')
58
-                )),
59
-                'exp_month' => new EE_Credit_Card_Month_Input(true, array(
60
-                    'required' => true,
61
-                    'html_label_text' => esc_html__('Expiry Month', 'event_espresso')
62
-                )),
63
-                'exp_year' => new EE_Credit_Card_Year_Input(array(
64
-                    'required' => true,
65
-                    'html_label_text' => esc_html__('Expiry Year', 'event_espresso')
66
-                )),
67
-                'cvv' => new EE_CVV_Input(array(
68
-                    'required' => true,
69
-                    'html_label_text' => esc_html__('CVV', 'event_espresso') )),
70
-            )
71
-        ));
72
-        $billing_form->add_subsections(array(
73
-            'company' => new EE_Text_Input(array(
74
-                'html_label_text' => esc_html__('Company', 'event_espresso')
75
-            ))
76
-        ), 'email', false);
77
-        $billing_form->add_subsections(
78
-            array(
79
-                    'fax' => new EE_Text_Input(array(
80
-                        'html_label_text' => esc_html__('Fax', 'event_espresso')
81
-                    ))
82
-                ),
83
-            'phone',
84
-            false
85
-        );
86
-        $settings_form = $this->settings_form();
87
-        if ($settings_form->get_input('excluded_billing_inputs') instanceof EE_Checkbox_Multi_Input) {
88
-                $billing_form->exclude($settings_form->get_input('excluded_billing_inputs')->normalized_value());
89
-        }
90
-        if ($settings_form->get_input('required_billing_inputs') instanceof EE_Checkbox_Multi_Input) {
91
-            $required_inputs = $settings_form->get_input('required_billing_inputs')->normalized_value();
92
-            // only change the requirement of inputs which are allowed to be changed
93
-            /** @var EE_Form_Input_Base[] $inputs_to_evaluate */
94
-            $inputs_to_evaluate = array_intersect_key(
95
-                $billing_form->inputs(),
96
-                $this->billing_input_names()
97
-            );
98
-            foreach ($inputs_to_evaluate as $input_name => $input) {
99
-                if (in_array($input_name, $required_inputs)) {
100
-                    $input->set_required(true);
101
-                } else {
102
-                    $input->set_required(false);
103
-                }
104
-            }
105
-        }
106
-        return $this->apply_billing_form_debug_settings($billing_form);
107
-    }
43
+	/**
44
+	 * Creates the billing form for this payment method type
45
+	 *
46
+	 * @param \EE_Transaction $transaction
47
+	 * @return EE_Billing_Info_Form
48
+	 * @throws \EE_Error
49
+	 */
50
+	public function generate_new_billing_form(EE_Transaction $transaction = null)
51
+	{
52
+		$billing_form = new EE_Billing_Attendee_Info_Form($this->_pm_instance, array(
53
+			'name' => 'AIM_Form',
54
+			'subsections' => array(
55
+				'credit_card' => new EE_Credit_Card_Input(array(
56
+					'required' => true,
57
+					'html_label_text' => esc_html__('Card Number', 'event_espresso')
58
+				)),
59
+				'exp_month' => new EE_Credit_Card_Month_Input(true, array(
60
+					'required' => true,
61
+					'html_label_text' => esc_html__('Expiry Month', 'event_espresso')
62
+				)),
63
+				'exp_year' => new EE_Credit_Card_Year_Input(array(
64
+					'required' => true,
65
+					'html_label_text' => esc_html__('Expiry Year', 'event_espresso')
66
+				)),
67
+				'cvv' => new EE_CVV_Input(array(
68
+					'required' => true,
69
+					'html_label_text' => esc_html__('CVV', 'event_espresso') )),
70
+			)
71
+		));
72
+		$billing_form->add_subsections(array(
73
+			'company' => new EE_Text_Input(array(
74
+				'html_label_text' => esc_html__('Company', 'event_espresso')
75
+			))
76
+		), 'email', false);
77
+		$billing_form->add_subsections(
78
+			array(
79
+					'fax' => new EE_Text_Input(array(
80
+						'html_label_text' => esc_html__('Fax', 'event_espresso')
81
+					))
82
+				),
83
+			'phone',
84
+			false
85
+		);
86
+		$settings_form = $this->settings_form();
87
+		if ($settings_form->get_input('excluded_billing_inputs') instanceof EE_Checkbox_Multi_Input) {
88
+				$billing_form->exclude($settings_form->get_input('excluded_billing_inputs')->normalized_value());
89
+		}
90
+		if ($settings_form->get_input('required_billing_inputs') instanceof EE_Checkbox_Multi_Input) {
91
+			$required_inputs = $settings_form->get_input('required_billing_inputs')->normalized_value();
92
+			// only change the requirement of inputs which are allowed to be changed
93
+			/** @var EE_Form_Input_Base[] $inputs_to_evaluate */
94
+			$inputs_to_evaluate = array_intersect_key(
95
+				$billing_form->inputs(),
96
+				$this->billing_input_names()
97
+			);
98
+			foreach ($inputs_to_evaluate as $input_name => $input) {
99
+				if (in_array($input_name, $required_inputs)) {
100
+					$input->set_required(true);
101
+				} else {
102
+					$input->set_required(false);
103
+				}
104
+			}
105
+		}
106
+		return $this->apply_billing_form_debug_settings($billing_form);
107
+	}
108 108
 
109 109
 
110 110
 
111
-    /**
112
-     * apply_billing_form_debug_settings
113
-     * applies debug data to the form
114
-     *
115
-     * @param \EE_Billing_Info_Form $billing_form
116
-     * @return \EE_Billing_Info_Form
117
-     * @throws \EE_Error
118
-     */
119
-    public function apply_billing_form_debug_settings(EE_Billing_Info_Form $billing_form)
120
-    {
121
-        if (
122
-            $this->_pm_instance->debug_mode()
123
-            || $this->_pm_instance->get_extra_meta('test_transactions', true, false)
124
-        ) {
125
-            $billing_form->get_input('credit_card')->set_default('4007000000027');
126
-            $billing_form->get_input('exp_year')->set_default('2020');
127
-            if ($billing_form->get_subsection('cvv') instanceof EE_Form_Input_Base) {
128
-                $billing_form->get_input('cvv')->set_default('123');
129
-            }
130
-            $billing_form->add_subsections(
131
-                array( 'fyi_about_autofill' => $billing_form->payment_fields_autofilled_notice_html() ),
132
-                'credit_card'
133
-            );
134
-            $billing_form->add_subsections(
135
-                array(
136
-                    'debug_content' => new EE_Form_Section_HTML_From_Template(
137
-                        __DIR__ . '/templates/authorize_net_aim_debug_info.template.php'
138
-                    )
139
-                ),
140
-                'first_name'
141
-            );
142
-        }
143
-        return $billing_form;
144
-    }
111
+	/**
112
+	 * apply_billing_form_debug_settings
113
+	 * applies debug data to the form
114
+	 *
115
+	 * @param \EE_Billing_Info_Form $billing_form
116
+	 * @return \EE_Billing_Info_Form
117
+	 * @throws \EE_Error
118
+	 */
119
+	public function apply_billing_form_debug_settings(EE_Billing_Info_Form $billing_form)
120
+	{
121
+		if (
122
+			$this->_pm_instance->debug_mode()
123
+			|| $this->_pm_instance->get_extra_meta('test_transactions', true, false)
124
+		) {
125
+			$billing_form->get_input('credit_card')->set_default('4007000000027');
126
+			$billing_form->get_input('exp_year')->set_default('2020');
127
+			if ($billing_form->get_subsection('cvv') instanceof EE_Form_Input_Base) {
128
+				$billing_form->get_input('cvv')->set_default('123');
129
+			}
130
+			$billing_form->add_subsections(
131
+				array( 'fyi_about_autofill' => $billing_form->payment_fields_autofilled_notice_html() ),
132
+				'credit_card'
133
+			);
134
+			$billing_form->add_subsections(
135
+				array(
136
+					'debug_content' => new EE_Form_Section_HTML_From_Template(
137
+						__DIR__ . '/templates/authorize_net_aim_debug_info.template.php'
138
+					)
139
+				),
140
+				'first_name'
141
+			);
142
+		}
143
+		return $billing_form;
144
+	}
145 145
 
146 146
 
147 147
 
148
-    /**
149
-     * Gets the form for all the settings related to this payment method type
150
-     * @return EE_Payment_Method_Form
151
-     */
152
-    public function generate_new_settings_form()
153
-    {
154
-        $billing_input_names = $this->billing_input_names();
155
-        return new EE_Payment_Method_Form(
156
-            array(
157
-                'extra_meta_inputs' => array(
158
-                    'login_id' => new EE_Text_Input(
159
-                        array(
160
-                            'html_label_text' =>  sprintf(esc_html__("Authorize.net API Login ID %s", "event_espresso"), $this->get_help_tab_link()),
161
-                            'required' => true )
162
-                    ),
163
-                    'transaction_key' => new EE_Text_Input(
164
-                        array(
165
-                            'html_label_text' => sprintf(esc_html__("Authorize.net Transaction Key %s", "event_espresso"), $this->get_help_tab_link()),
166
-                            'required' => true )
167
-                    ),
168
-                    'test_transactions' => new EE_Yes_No_Input(
169
-                        array(
170
-                            'html_label_text' =>  sprintf(esc_html__("Send test transactions? %s", 'event_espresso'), $this->get_help_tab_link()),
171
-                            'html_help_text' =>  esc_html__("Send test transactions, even to live server", 'event_espresso'),
172
-                            'default' => false,
173
-                            'required' => true
174
-                        )
175
-                    ),
176
-                    'excluded_billing_inputs' => new EE_Checkbox_Multi_Input(
177
-                        $billing_input_names,
178
-                        array(
179
-                        'html_label_text' => sprintf(esc_html__("Excluded Payment Form Fields %s", 'event_espresso'), $this->get_help_tab_link()),
180
-                        'default' => array(
181
-                            'company',
182
-                            'fax',
183
-                        )
184
-                        )
185
-                    ),
186
-                    'required_billing_inputs' => new EE_Checkbox_Multi_Input(
187
-                        $billing_input_names,
188
-                        array(
189
-                            'html_label_text' => sprintf(esc_html__("Required Payment Form Fields %s", 'event_espresso'), $this->get_help_tab_link()),
190
-                            'default' => array_diff(
191
-                                array_keys($billing_input_names),
192
-                                array( 'address2', 'phone', 'company', 'fax' )
193
-                            ),
194
-                            'html_help_text' => esc_html__('Note: if fields are excluded they cannot be required.', 'event_espresso')
195
-                        )
196
-                    ),
197
-                )
198
-            )
199
-        );
200
-    }
148
+	/**
149
+	 * Gets the form for all the settings related to this payment method type
150
+	 * @return EE_Payment_Method_Form
151
+	 */
152
+	public function generate_new_settings_form()
153
+	{
154
+		$billing_input_names = $this->billing_input_names();
155
+		return new EE_Payment_Method_Form(
156
+			array(
157
+				'extra_meta_inputs' => array(
158
+					'login_id' => new EE_Text_Input(
159
+						array(
160
+							'html_label_text' =>  sprintf(esc_html__("Authorize.net API Login ID %s", "event_espresso"), $this->get_help_tab_link()),
161
+							'required' => true )
162
+					),
163
+					'transaction_key' => new EE_Text_Input(
164
+						array(
165
+							'html_label_text' => sprintf(esc_html__("Authorize.net Transaction Key %s", "event_espresso"), $this->get_help_tab_link()),
166
+							'required' => true )
167
+					),
168
+					'test_transactions' => new EE_Yes_No_Input(
169
+						array(
170
+							'html_label_text' =>  sprintf(esc_html__("Send test transactions? %s", 'event_espresso'), $this->get_help_tab_link()),
171
+							'html_help_text' =>  esc_html__("Send test transactions, even to live server", 'event_espresso'),
172
+							'default' => false,
173
+							'required' => true
174
+						)
175
+					),
176
+					'excluded_billing_inputs' => new EE_Checkbox_Multi_Input(
177
+						$billing_input_names,
178
+						array(
179
+						'html_label_text' => sprintf(esc_html__("Excluded Payment Form Fields %s", 'event_espresso'), $this->get_help_tab_link()),
180
+						'default' => array(
181
+							'company',
182
+							'fax',
183
+						)
184
+						)
185
+					),
186
+					'required_billing_inputs' => new EE_Checkbox_Multi_Input(
187
+						$billing_input_names,
188
+						array(
189
+							'html_label_text' => sprintf(esc_html__("Required Payment Form Fields %s", 'event_espresso'), $this->get_help_tab_link()),
190
+							'default' => array_diff(
191
+								array_keys($billing_input_names),
192
+								array( 'address2', 'phone', 'company', 'fax' )
193
+							),
194
+							'html_help_text' => esc_html__('Note: if fields are excluded they cannot be required.', 'event_espresso')
195
+						)
196
+					),
197
+				)
198
+			)
199
+		);
200
+	}
201 201
 
202
-    /**
203
-     * Returns an array where keys are the slugs for billing inputs, and values
204
-     * are their i18n names
205
-     * @return array
206
-     */
207
-    public function billing_input_names()
208
-    {
209
-        return array(
210
-            'first_name' => esc_html__('First Name', 'event_espresso'),
211
-            'last_name' => esc_html__('Last Name', 'event_espresso'),
212
-            'email' => esc_html__('Email', 'event_espresso'),
213
-            'company' => esc_html__('Company', 'event_espresso'),
214
-            'address' => esc_html__('Address', 'event_espresso'),
215
-            'address2' => esc_html__('Address2', 'event_espresso'),
216
-            'city' => esc_html__('City', 'event_espresso'),
217
-            'state' => esc_html__('State', 'event_espresso'),
218
-            'country' => esc_html__('Country', 'event_espresso'),
219
-            'zip' =>  esc_html__('Zip', 'event_espresso'),
220
-            'phone' => esc_html__('Phone', 'event_espresso'),
221
-            'fax' => esc_html__('Fax', 'event_espresso'),
222
-            'cvv' => esc_html__('CVV', 'event_espresso')
223
-        );
224
-    }
202
+	/**
203
+	 * Returns an array where keys are the slugs for billing inputs, and values
204
+	 * are their i18n names
205
+	 * @return array
206
+	 */
207
+	public function billing_input_names()
208
+	{
209
+		return array(
210
+			'first_name' => esc_html__('First Name', 'event_espresso'),
211
+			'last_name' => esc_html__('Last Name', 'event_espresso'),
212
+			'email' => esc_html__('Email', 'event_espresso'),
213
+			'company' => esc_html__('Company', 'event_espresso'),
214
+			'address' => esc_html__('Address', 'event_espresso'),
215
+			'address2' => esc_html__('Address2', 'event_espresso'),
216
+			'city' => esc_html__('City', 'event_espresso'),
217
+			'state' => esc_html__('State', 'event_espresso'),
218
+			'country' => esc_html__('Country', 'event_espresso'),
219
+			'zip' =>  esc_html__('Zip', 'event_espresso'),
220
+			'phone' => esc_html__('Phone', 'event_espresso'),
221
+			'fax' => esc_html__('Fax', 'event_espresso'),
222
+			'cvv' => esc_html__('CVV', 'event_espresso')
223
+		);
224
+	}
225 225
 
226
-    /**
227
-     * Overrides parent so we always have all billing inputs in the returned array,
228
-     * not just the ones included at the time. This helps simplify the gateway code
229
-     *
230
-     * @param EE_Billing_Info_Form $billing_form
231
-     * @return array
232
-     */
233
-    protected function _get_billing_values_from_form($billing_form)
234
-    {
235
-        $all_billing_values_empty = array();
236
-        foreach (array_keys($this->billing_input_names()) as $input_name) {
237
-            $all_billing_values_empty[ $input_name ] = '';
238
-        }
239
-        return array_merge(
240
-            $all_billing_values_empty,
241
-            parent::_get_billing_values_from_form($billing_form)
242
-        );
243
-    }
226
+	/**
227
+	 * Overrides parent so we always have all billing inputs in the returned array,
228
+	 * not just the ones included at the time. This helps simplify the gateway code
229
+	 *
230
+	 * @param EE_Billing_Info_Form $billing_form
231
+	 * @return array
232
+	 */
233
+	protected function _get_billing_values_from_form($billing_form)
234
+	{
235
+		$all_billing_values_empty = array();
236
+		foreach (array_keys($this->billing_input_names()) as $input_name) {
237
+			$all_billing_values_empty[ $input_name ] = '';
238
+		}
239
+		return array_merge(
240
+			$all_billing_values_empty,
241
+			parent::_get_billing_values_from_form($billing_form)
242
+		);
243
+	}
244 244
 
245 245
 
246 246
 
247
-    /**
248
-     * Adds the help tab
249
-     * @see EE_PMT_Base::help_tabs_config()
250
-     * @return array
251
-     */
252
-    public function help_tabs_config()
253
-    {
254
-        return array(
255
-            $this->get_help_tab_name() => array(
256
-                'title' => esc_html__('Authorize.net AIM Settings', 'event_espresso'),
257
-                'filename' => 'payment_methods_overview_aim'
258
-            ),
259
-        );
260
-    }
247
+	/**
248
+	 * Adds the help tab
249
+	 * @see EE_PMT_Base::help_tabs_config()
250
+	 * @return array
251
+	 */
252
+	public function help_tabs_config()
253
+	{
254
+		return array(
255
+			$this->get_help_tab_name() => array(
256
+				'title' => esc_html__('Authorize.net AIM Settings', 'event_espresso'),
257
+				'filename' => 'payment_methods_overview_aim'
258
+			),
259
+		);
260
+	}
261 261
 
262 262
 
263 263
 
264
-    /**
265
-     * Gets a list of instructions and/or information regarding how the payment is to be completed
266
-     * @return string
267
-     */
268
-    public function payment_information()
269
-    {
270
-        // TODO: Implement payment_information() method.
271
-    }
264
+	/**
265
+	 * Gets a list of instructions and/or information regarding how the payment is to be completed
266
+	 * @return string
267
+	 */
268
+	public function payment_information()
269
+	{
270
+		// TODO: Implement payment_information() method.
271
+	}
272 272
 }
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
      */
32 32
     protected function _setup_properties()
33 33
     {
34
-        require_once($this->file_folder() . 'EEG_Aim.gateway.php');
34
+        require_once($this->file_folder().'EEG_Aim.gateway.php');
35 35
         $this->_gateway = new EEG_Aim();
36 36
         $this->_pretty_name = esc_html__("Authorize.net AIM", 'event_espresso');
37 37
         $this->_default_description = esc_html__('Please provide the following billing information.', 'event_espresso');
@@ -128,13 +128,13 @@  discard block
 block discarded – undo
128 128
                 $billing_form->get_input('cvv')->set_default('123');
129 129
             }
130 130
             $billing_form->add_subsections(
131
-                array( 'fyi_about_autofill' => $billing_form->payment_fields_autofilled_notice_html() ),
131
+                array('fyi_about_autofill' => $billing_form->payment_fields_autofilled_notice_html()),
132 132
                 'credit_card'
133 133
             );
134 134
             $billing_form->add_subsections(
135 135
                 array(
136 136
                     'debug_content' => new EE_Form_Section_HTML_From_Template(
137
-                        __DIR__ . '/templates/authorize_net_aim_debug_info.template.php'
137
+                        __DIR__.'/templates/authorize_net_aim_debug_info.template.php'
138 138
                     )
139 139
                 ),
140 140
                 'first_name'
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
                             'html_label_text' => sprintf(esc_html__("Required Payment Form Fields %s", 'event_espresso'), $this->get_help_tab_link()),
190 190
                             'default' => array_diff(
191 191
                                 array_keys($billing_input_names),
192
-                                array( 'address2', 'phone', 'company', 'fax' )
192
+                                array('address2', 'phone', 'company', 'fax')
193 193
                             ),
194 194
                             'html_help_text' => esc_html__('Note: if fields are excluded they cannot be required.', 'event_espresso')
195 195
                         )
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
     {
235 235
         $all_billing_values_empty = array();
236 236
         foreach (array_keys($this->billing_input_names()) as $input_name) {
237
-            $all_billing_values_empty[ $input_name ] = '';
237
+            $all_billing_values_empty[$input_name] = '';
238 238
         }
239 239
         return array_merge(
240 240
             $all_billing_values_empty,
Please login to merge, or discard this patch.
modules/feeds/templates/espresso_events_feed.template.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -16,17 +16,17 @@
 block discarded – undo
16 16
 
17 17
 ?>
18 18
 <p>
19
-    <?php esc_html_e('Event Organizer: ', 'event_espresso') . espresso_organization_name($EVT_ID); ?>
19
+    <?php esc_html_e('Event Organizer: ', 'event_espresso').espresso_organization_name($EVT_ID); ?>
20 20
     <br/>
21
-    <?php esc_html_e('Organizer Email: ', 'event_espresso') . espresso_organization_email($EVT_ID); ?>
21
+    <?php esc_html_e('Organizer Email: ', 'event_espresso').espresso_organization_email($EVT_ID); ?>
22 22
     <br/>
23
-    <?php esc_html_e('Event Phone: ', 'event_espresso') . espresso_event_phone($EVT_ID); ?>
23
+    <?php esc_html_e('Event Phone: ', 'event_espresso').espresso_event_phone($EVT_ID); ?>
24 24
 </p>
25
-<p><?php esc_html_e('Event Status: ', 'event_espresso') . espresso_event_status($EVT_ID); ?></p>
26
-<p><?php esc_html_e('Categories: ', 'event_espresso') . espresso_event_categories($EVT_ID); ?></p>
27
-<?php esc_html_e('Dates and Times: ', 'event_espresso') . espresso_list_of_event_dates($EVT_ID); ?>
28
-<?php esc_html_e('Available Tickets: ', 'event_espresso') . espresso_event_tickets_available($EVT_ID); ?>
29
-<p><?php esc_html_e('Event Venue: ', 'event_espresso') . espresso_venue_name(null, false); ?></p>
30
-<p><?php esc_html_e('Description: ', 'event_espresso') . $event_description; ?></p>
25
+<p><?php esc_html_e('Event Status: ', 'event_espresso').espresso_event_status($EVT_ID); ?></p>
26
+<p><?php esc_html_e('Categories: ', 'event_espresso').espresso_event_categories($EVT_ID); ?></p>
27
+<?php esc_html_e('Dates and Times: ', 'event_espresso').espresso_list_of_event_dates($EVT_ID); ?>
28
+<?php esc_html_e('Available Tickets: ', 'event_espresso').espresso_event_tickets_available($EVT_ID); ?>
29
+<p><?php esc_html_e('Event Venue: ', 'event_espresso').espresso_venue_name(null, false); ?></p>
30
+<p><?php esc_html_e('Description: ', 'event_espresso').$event_description; ?></p>
31 31
 <br/>
32 32
  
33 33
\ No newline at end of file
Please login to merge, or discard this patch.
modules/feeds/templates/espresso_venues_feed.template.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -16,15 +16,15 @@
 block discarded – undo
16 16
 
17 17
 ?>
18 18
 <p>
19
-    <?php esc_html_e('Organizer Name: ', 'event_espresso') . espresso_organization_name($VNU_ID); ?>
19
+    <?php esc_html_e('Organizer Name: ', 'event_espresso').espresso_organization_name($VNU_ID); ?>
20 20
     <br/>
21
-    <?php esc_html_e('Organizer Email: ', 'event_espresso') . espresso_organization_email($VNU_ID); ?>
21
+    <?php esc_html_e('Organizer Email: ', 'event_espresso').espresso_organization_email($VNU_ID); ?>
22 22
     <br/>
23
-    <?php esc_html_e('Venue Phone: ', 'event_espresso') . espresso_venue_phone($VNU_ID); ?>
23
+    <?php esc_html_e('Venue Phone: ', 'event_espresso').espresso_venue_phone($VNU_ID); ?>
24 24
 </p>
25
-<p><?php esc_html_e('Categories: ', 'event_espresso') . espresso_venue_categories($VNU_ID); ?></p>
26
-<p><?php esc_html_e('Address: ', 'event_espresso') . espresso_venue_address($VNU_ID); ?></p>
27
-<p><?php esc_html_e('Website: ', 'event_espresso') . espresso_venue_website($VNU_ID); ?></p>
28
-<p><?php esc_html_e('Description: ', 'event_espresso') . $venue_description; ?></p>
25
+<p><?php esc_html_e('Categories: ', 'event_espresso').espresso_venue_categories($VNU_ID); ?></p>
26
+<p><?php esc_html_e('Address: ', 'event_espresso').espresso_venue_address($VNU_ID); ?></p>
27
+<p><?php esc_html_e('Website: ', 'event_espresso').espresso_venue_website($VNU_ID); ?></p>
28
+<p><?php esc_html_e('Description: ', 'event_espresso').$venue_description; ?></p>
29 29
 <br/>
30 30
  
31 31
\ No newline at end of file
Please login to merge, or discard this patch.
modules/gateways/Invoice/lib/templates/invoice_header.template.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -10,9 +10,9 @@
 block discarded – undo
10 10
 <head>
11 11
     <title>[organization]<?php esc_html__(' Invoice #', 'event_espresso'); ?>[registration_code]
12 12
         <?php esc_html__(
13
-            ' for ',
14
-            'event_espresso'
15
-        ); ?>[name]</title>
13
+			' for ',
14
+			'event_espresso'
15
+		); ?>[name]</title>
16 16
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
17 17
     <!-- Base Stylesheet do not change or remove -->
18 18
     <link rel="stylesheet" type="text/css" href="[base_url]base.css" media="screen"/>
Please login to merge, or discard this patch.
modules/invoice/EED_Invoice.module.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -55,8 +55,8 @@
 block discarded – undo
55 55
      */
56 56
     public function run($WP)
57 57
     {
58
-        if (is_readable(EE_MODULES . 'gateways/Invoice/lib/Invoice.class.php')) {
59
-            require_once(EE_MODULES . 'gateways/Invoice/lib/Invoice.class.php');
58
+        if (is_readable(EE_MODULES.'gateways/Invoice/lib/Invoice.class.php')) {
59
+            require_once(EE_MODULES.'gateways/Invoice/lib/Invoice.class.php');
60 60
         } else {
61 61
             $msg = esc_html__('The Invoice.class.php file could not be loaded.', 'event_espresso');
62 62
             EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
Please login to merge, or discard this patch.
Indentation   +77 added lines, -77 removed lines patch added patch discarded remove patch
@@ -12,91 +12,91 @@
 block discarded – undo
12 12
 {
13 13
 
14 14
 
15
-    /**
16
-     * @return EED_Invoice|EED_Module
17
-     * @throws EE_Error
18
-     * @throws ReflectionException
19
-     */
20
-    public static function instance()
21
-    {
22
-        return parent::get_instance(__CLASS__);
23
-    }
15
+	/**
16
+	 * @return EED_Invoice|EED_Module
17
+	 * @throws EE_Error
18
+	 * @throws ReflectionException
19
+	 */
20
+	public static function instance()
21
+	{
22
+		return parent::get_instance(__CLASS__);
23
+	}
24 24
 
25 25
 
26
-    /**
27
-     *    set_hooks - for hooking into EE Core, other modules, etc
28
-     *
29
-     * @access    public
30
-     * @return    void
31
-     */
32
-    public static function set_hooks()
33
-    {
34
-        EE_Config::register_route('download_invoice', 'EED_Invoice', 'download_invoice');
35
-        EE_Config::register_route('launch_invoice', 'EED_Invoice', 'launch_invoice');
36
-    }
26
+	/**
27
+	 *    set_hooks - for hooking into EE Core, other modules, etc
28
+	 *
29
+	 * @access    public
30
+	 * @return    void
31
+	 */
32
+	public static function set_hooks()
33
+	{
34
+		EE_Config::register_route('download_invoice', 'EED_Invoice', 'download_invoice');
35
+		EE_Config::register_route('launch_invoice', 'EED_Invoice', 'launch_invoice');
36
+	}
37 37
 
38 38
 
39
-    /**
40
-     *    set_hooks_admin - for hooking into EE Admin Core, other modules, etc
41
-     *
42
-     * @access    public
43
-     * @return    void
44
-     */
45
-    public static function set_hooks_admin()
46
-    {
47
-    }
39
+	/**
40
+	 *    set_hooks_admin - for hooking into EE Admin Core, other modules, etc
41
+	 *
42
+	 * @access    public
43
+	 * @return    void
44
+	 */
45
+	public static function set_hooks_admin()
46
+	{
47
+	}
48 48
 
49 49
 
50
-    /**
51
-     *    run - initial module setup
52
-     *
53
-     * @access    public
54
-     * @return    void
55
-     */
56
-    public function run($WP)
57
-    {
58
-        if (is_readable(EE_MODULES . 'gateways/Invoice/lib/Invoice.class.php')) {
59
-            require_once(EE_MODULES . 'gateways/Invoice/lib/Invoice.class.php');
60
-        } else {
61
-            $msg = esc_html__('The Invoice.class.php file could not be loaded.', 'event_espresso');
62
-            EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
63
-        }
64
-    }
50
+	/**
51
+	 *    run - initial module setup
52
+	 *
53
+	 * @access    public
54
+	 * @return    void
55
+	 */
56
+	public function run($WP)
57
+	{
58
+		if (is_readable(EE_MODULES . 'gateways/Invoice/lib/Invoice.class.php')) {
59
+			require_once(EE_MODULES . 'gateways/Invoice/lib/Invoice.class.php');
60
+		} else {
61
+			$msg = esc_html__('The Invoice.class.php file could not be loaded.', 'event_espresso');
62
+			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
63
+		}
64
+	}
65 65
 
66 66
 
67
-    /**
68
-     *    invoice_launch
69
-     *
70
-     * @access    public
71
-     * @return    void
72
-     */
73
-    public function launch_invoice()
74
-    {
75
-        $this->run(null);
76
-        $request = self::getRequest();
77
-        if ($request->requestParamIsSet('id')) {
78
-            $id = $request->getRequestParam('id', '', 'key');
79
-            $invoice = new Invoice($id);
80
-            $invoice->send_invoice();
81
-        }
82
-    }
67
+	/**
68
+	 *    invoice_launch
69
+	 *
70
+	 * @access    public
71
+	 * @return    void
72
+	 */
73
+	public function launch_invoice()
74
+	{
75
+		$this->run(null);
76
+		$request = self::getRequest();
77
+		if ($request->requestParamIsSet('id')) {
78
+			$id = $request->getRequestParam('id', '', 'key');
79
+			$invoice = new Invoice($id);
80
+			$invoice->send_invoice();
81
+		}
82
+	}
83 83
 
84 84
 
85
-    /**
86
-     *    download_invoice
87
-     *
88
-     * @access    public
89
-     * @return    void
90
-     */
91
-    public function download_invoice()
92
-    {
93
-        $this->run(null);
94
-        $request = self::getRequest();
95
-        if ($request->requestParamIsSet('id')) {
96
-            $id = $request->getRequestParam('id', '', 'key');
97
-            $invoice = new Invoice($id);
98
-            // send invoice but force download
99
-            $invoice->send_invoice(true);
100
-        }
101
-    }
85
+	/**
86
+	 *    download_invoice
87
+	 *
88
+	 * @access    public
89
+	 * @return    void
90
+	 */
91
+	public function download_invoice()
92
+	{
93
+		$this->run(null);
94
+		$request = self::getRequest();
95
+		if ($request->requestParamIsSet('id')) {
96
+			$id = $request->getRequestParam('id', '', 'key');
97
+			$invoice = new Invoice($id);
98
+			// send invoice but force download
99
+			$invoice->send_invoice(true);
100
+		}
101
+	}
102 102
 }
Please login to merge, or discard this patch.
finalize_registration/EE_SPCO_Reg_Step_Finalize_Registration.class.php 2 patches
Indentation   +228 added lines, -228 removed lines patch added patch discarded remove patch
@@ -15,252 +15,252 @@
 block discarded – undo
15 15
 class EE_SPCO_Reg_Step_Finalize_Registration extends EE_SPCO_Reg_Step
16 16
 {
17 17
 
18
-    /**
19
-     *    class constructor
20
-     *
21
-     * @access    public
22
-     * @param EE_Checkout $checkout
23
-     */
24
-    public function __construct(EE_Checkout $checkout)
25
-    {
26
-        $this->request             = EED_Single_Page_Checkout::getRequest();
27
-        $this->_slug               = 'finalize_registration';
28
-        $this->_name               = esc_html__('Finalize Registration', 'event_espresso');
29
-        $this->_submit_button_text = $this->_name;
30
-        $this->_template           = '';
31
-        $this->checkout            = $checkout;
32
-    }
18
+	/**
19
+	 *    class constructor
20
+	 *
21
+	 * @access    public
22
+	 * @param EE_Checkout $checkout
23
+	 */
24
+	public function __construct(EE_Checkout $checkout)
25
+	{
26
+		$this->request             = EED_Single_Page_Checkout::getRequest();
27
+		$this->_slug               = 'finalize_registration';
28
+		$this->_name               = esc_html__('Finalize Registration', 'event_espresso');
29
+		$this->_submit_button_text = $this->_name;
30
+		$this->_template           = '';
31
+		$this->checkout            = $checkout;
32
+	}
33 33
 
34 34
 
35
-    public function translate_js_strings()
36
-    {
37
-    }
35
+	public function translate_js_strings()
36
+	{
37
+	}
38 38
 
39 39
 
40
-    public function enqueue_styles_and_scripts()
41
-    {
42
-    }
40
+	public function enqueue_styles_and_scripts()
41
+	{
42
+	}
43 43
 
44 44
 
45
-    /**
46
-     * @return boolean
47
-     */
48
-    public function initialize_reg_step()
49
-    {
50
-        // there's actually no reg form to process if this is the final step
51
-        if ($this->is_current_step()) {
52
-            $this->checkout->step              = $this->slug();
53
-            $this->checkout->action            = 'process_reg_step';
54
-            $this->checkout->generate_reg_form = false;
55
-            $this->request->setRequestParam('step', $this->checkout->step);
56
-            $this->request->setRequestParam('action', $this->checkout->action);
57
-        }
58
-        return true;
59
-    }
45
+	/**
46
+	 * @return boolean
47
+	 */
48
+	public function initialize_reg_step()
49
+	{
50
+		// there's actually no reg form to process if this is the final step
51
+		if ($this->is_current_step()) {
52
+			$this->checkout->step              = $this->slug();
53
+			$this->checkout->action            = 'process_reg_step';
54
+			$this->checkout->generate_reg_form = false;
55
+			$this->request->setRequestParam('step', $this->checkout->step);
56
+			$this->request->setRequestParam('action', $this->checkout->action);
57
+		}
58
+		return true;
59
+	}
60 60
 
61 61
 
62
-    /**
63
-     * @return string
64
-     */
65
-    public function generate_reg_form()
66
-    {
67
-        // create empty form so that things don't break
68
-        $this->reg_form = new EE_Form_Section_Proper();
69
-        return '';
70
-    }
62
+	/**
63
+	 * @return string
64
+	 */
65
+	public function generate_reg_form()
66
+	{
67
+		// create empty form so that things don't break
68
+		$this->reg_form = new EE_Form_Section_Proper();
69
+		return '';
70
+	}
71 71
 
72 72
 
73
-    /**
74
-     * @return boolean
75
-     * @throws RuntimeException
76
-     * @throws EE_Error
77
-     * @throws ReflectionException
78
-     */
79
-    public function process_reg_step()
80
-    {
81
-        // ensure all data gets refreshed from the db
82
-        $this->checkout->refresh_all_entities(true);
83
-        // ensures that all details and statuses for transaction, registration, and payments are updated
84
-        $txn_update_params = $this->_finalize_transaction();
85
-        // maybe send messages
86
-        $this->_set_notification_triggers();
87
-        // send messages
88
-        /** @type EE_Registration_Processor $registration_processor */
89
-        $registration_processor = EE_Registry::instance()->load_class('Registration_Processor');
90
-        $registration_processor->trigger_registration_update_notifications(
91
-            $this->checkout->transaction->primary_registration(),
92
-            $txn_update_params
93
-        );
94
-        // set a hook point
95
-        do_action(
96
-            'AHEE__EE_SPCO_Reg_Step_Finalize_Registration__process_reg_step__completed',
97
-            $this->checkout,
98
-            $txn_update_params
99
-        );
100
-        // check if transaction has a primary registrant and that it has a related Attendee object
101
-        if (! $this->_validate_primary_registrant()) {
102
-            return false;
103
-        }
104
-        // you don't have to go home but you can't stay here !
105
-        $this->checkout->redirect     = true;
106
-        $this->checkout->continue_reg = true;
107
-        $this->checkout->json_response->set_redirect_url($this->checkout->redirect_url);
108
-        if (
109
-            ! (
110
-            $this->checkout->payment_method instanceof EE_Payment_Method
111
-            && $this->checkout->payment_method->is_off_site()
112
-            )
113
-        ) {
114
-            // mark this reg step as completed
115
-            $this->set_completed();
116
-        }
117
-        $this->checkout->set_exit_spco();
118
-        return true;
119
-    }
73
+	/**
74
+	 * @return boolean
75
+	 * @throws RuntimeException
76
+	 * @throws EE_Error
77
+	 * @throws ReflectionException
78
+	 */
79
+	public function process_reg_step()
80
+	{
81
+		// ensure all data gets refreshed from the db
82
+		$this->checkout->refresh_all_entities(true);
83
+		// ensures that all details and statuses for transaction, registration, and payments are updated
84
+		$txn_update_params = $this->_finalize_transaction();
85
+		// maybe send messages
86
+		$this->_set_notification_triggers();
87
+		// send messages
88
+		/** @type EE_Registration_Processor $registration_processor */
89
+		$registration_processor = EE_Registry::instance()->load_class('Registration_Processor');
90
+		$registration_processor->trigger_registration_update_notifications(
91
+			$this->checkout->transaction->primary_registration(),
92
+			$txn_update_params
93
+		);
94
+		// set a hook point
95
+		do_action(
96
+			'AHEE__EE_SPCO_Reg_Step_Finalize_Registration__process_reg_step__completed',
97
+			$this->checkout,
98
+			$txn_update_params
99
+		);
100
+		// check if transaction has a primary registrant and that it has a related Attendee object
101
+		if (! $this->_validate_primary_registrant()) {
102
+			return false;
103
+		}
104
+		// you don't have to go home but you can't stay here !
105
+		$this->checkout->redirect     = true;
106
+		$this->checkout->continue_reg = true;
107
+		$this->checkout->json_response->set_redirect_url($this->checkout->redirect_url);
108
+		if (
109
+			! (
110
+			$this->checkout->payment_method instanceof EE_Payment_Method
111
+			&& $this->checkout->payment_method->is_off_site()
112
+			)
113
+		) {
114
+			// mark this reg step as completed
115
+			$this->set_completed();
116
+		}
117
+		$this->checkout->set_exit_spco();
118
+		return true;
119
+	}
120 120
 
121 121
 
122
-    /**
123
-     * _finalize_transaction
124
-     * ensures that all details and statuses for transaction, registration, and payments are updated
125
-     *
126
-     * @return array
127
-     * @throws RuntimeException
128
-     * @throws EE_Error
129
-     * @throws ReflectionException
130
-     */
131
-    protected function _finalize_transaction()
132
-    {
133
-        /** @type EE_Transaction_Processor $transaction_processor */
134
-        $transaction_processor = EE_Registry::instance()->load_class('Transaction_Processor');
135
-        // set revisit flag in txn processor
136
-        $transaction_processor->set_revisit($this->checkout->revisit);
137
-        // at this point we'll consider a TXN to not have been abandoned
138
-        $this->checkout->transaction->toggle_abandoned_transaction_status();
139
-        if ($this->checkout->cart instanceof EE_Cart) {
140
-            // save TXN data to the cart
141
-            $this->checkout->cart->get_grand_total()->save_this_and_descendants_to_txn(
142
-                $this->checkout->transaction->ID()
143
-            );
144
-        }
145
-        // maybe update status, but don't save transaction just yet
146
-        $this->checkout->transaction->update_status_based_on_total_paid(false);
147
-        // this will result in the base session properties getting saved to the TXN_Session_data field
148
-        $session_data = EE_Registry::instance()->SSN->get_session_data(null, true);
149
-        // anonymize the last part of the IP address, now that the transaction is complete (we won't be using the IP address
150
-        // for spam or bot detection now)
151
-        if (function_exists('wp_privacy_anonymize_ip') && isset($session_data['ip_address'])) {
152
-            $session_data['ip_address'] = wp_privacy_anonymize_ip($session_data['ip_address']);
153
-        }
154
-        $this->checkout->transaction->set_txn_session_data($session_data);
155
-        // update the TXN if payment conditions have changed, but do NOT trigger notifications,
156
-        // because we will do that in process_reg_step() after setting some more triggers
157
-        return $transaction_processor->update_transaction_and_registrations_after_checkout_or_payment(
158
-            $this->checkout->transaction,
159
-            $this->checkout->payment,
160
-            $this->checkout->reg_cache_where_params,
161
-            false
162
-        );
163
-    }
122
+	/**
123
+	 * _finalize_transaction
124
+	 * ensures that all details and statuses for transaction, registration, and payments are updated
125
+	 *
126
+	 * @return array
127
+	 * @throws RuntimeException
128
+	 * @throws EE_Error
129
+	 * @throws ReflectionException
130
+	 */
131
+	protected function _finalize_transaction()
132
+	{
133
+		/** @type EE_Transaction_Processor $transaction_processor */
134
+		$transaction_processor = EE_Registry::instance()->load_class('Transaction_Processor');
135
+		// set revisit flag in txn processor
136
+		$transaction_processor->set_revisit($this->checkout->revisit);
137
+		// at this point we'll consider a TXN to not have been abandoned
138
+		$this->checkout->transaction->toggle_abandoned_transaction_status();
139
+		if ($this->checkout->cart instanceof EE_Cart) {
140
+			// save TXN data to the cart
141
+			$this->checkout->cart->get_grand_total()->save_this_and_descendants_to_txn(
142
+				$this->checkout->transaction->ID()
143
+			);
144
+		}
145
+		// maybe update status, but don't save transaction just yet
146
+		$this->checkout->transaction->update_status_based_on_total_paid(false);
147
+		// this will result in the base session properties getting saved to the TXN_Session_data field
148
+		$session_data = EE_Registry::instance()->SSN->get_session_data(null, true);
149
+		// anonymize the last part of the IP address, now that the transaction is complete (we won't be using the IP address
150
+		// for spam or bot detection now)
151
+		if (function_exists('wp_privacy_anonymize_ip') && isset($session_data['ip_address'])) {
152
+			$session_data['ip_address'] = wp_privacy_anonymize_ip($session_data['ip_address']);
153
+		}
154
+		$this->checkout->transaction->set_txn_session_data($session_data);
155
+		// update the TXN if payment conditions have changed, but do NOT trigger notifications,
156
+		// because we will do that in process_reg_step() after setting some more triggers
157
+		return $transaction_processor->update_transaction_and_registrations_after_checkout_or_payment(
158
+			$this->checkout->transaction,
159
+			$this->checkout->payment,
160
+			$this->checkout->reg_cache_where_params,
161
+			false
162
+		);
163
+	}
164 164
 
165 165
 
166
-    /**
167
-     * If request is not a revisit, and an Off-Site gateway using IPNs has NOT been selected...
168
-     * OR
169
-     * if it IS a revisit and the TXN and/or one or more REG statuses have changed...
170
-     * then trigger notifications
171
-     *
172
-     * @return void
173
-     * @throws EE_Error
174
-     * @throws ReflectionException
175
-     */
176
-    protected function _set_notification_triggers()
177
-    {
166
+	/**
167
+	 * If request is not a revisit, and an Off-Site gateway using IPNs has NOT been selected...
168
+	 * OR
169
+	 * if it IS a revisit and the TXN and/or one or more REG statuses have changed...
170
+	 * then trigger notifications
171
+	 *
172
+	 * @return void
173
+	 * @throws EE_Error
174
+	 * @throws ReflectionException
175
+	 */
176
+	protected function _set_notification_triggers()
177
+	{
178 178
 
179
-        if ($this->checkout->payment_method instanceof EE_Payment_Method) {
180
-            // let's start with the assumption that we need to trigger notifications
181
-            // then toggle this to false for conditions where we know we don't need to
182
-            $deliver_notifications = true;
183
-            if (
179
+		if ($this->checkout->payment_method instanceof EE_Payment_Method) {
180
+			// let's start with the assumption that we need to trigger notifications
181
+			// then toggle this to false for conditions where we know we don't need to
182
+			$deliver_notifications = true;
183
+			if (
184 184
 // if SPCO revisit
185
-                filter_var($this->checkout->revisit, FILTER_VALIDATE_BOOLEAN)
186
-                // and TXN or REG statuses have NOT changed due to a payment
187
-                && ! (
188
-                    $this->checkout->transaction->txn_status_updated()
189
-                    || $this->checkout->any_reg_status_updated()
190
-                )
191
-            ) {
192
-                $deliver_notifications = false;
193
-            }
194
-            if ($this->checkout->payment_method->is_off_site()) {
195
-                /** @var EE_Gateway $gateway */
196
-                $gateway = $this->checkout->payment_method->type_obj()->get_gateway();
197
-                // and the gateway uses a separate request to process the IPN
198
-                /** @var RequestInterface $request */
199
-                $request = LoaderFactory::getLoader()->getShared(RequestInterface::class);
200
-                if (
201
-                    $gateway instanceof EE_Offsite_Gateway
202
-                    && $gateway->handle_IPN_in_this_request($request->requestParams(), true)
203
-                ) {
204
-                    // IPN request will handle triggering notifications
205
-                    $deliver_notifications = false;
206
-                    // no really... don't send any notices in this request
207
-                    remove_all_filters('FHEE__EED_Messages___maybe_registration__deliver_notifications');
208
-                    add_filter(
209
-                        'FHEE__EED_Messages___maybe_registration__deliver_notifications',
210
-                        '__return_false',
211
-                        15
212
-                    );
213
-                }
214
-            }
215
-            if ($deliver_notifications) {
216
-                // send out notifications
217
-                add_filter('FHEE__EED_Messages___maybe_registration__deliver_notifications', '__return_true', 10);
218
-            }
219
-        }
220
-    }
185
+				filter_var($this->checkout->revisit, FILTER_VALIDATE_BOOLEAN)
186
+				// and TXN or REG statuses have NOT changed due to a payment
187
+				&& ! (
188
+					$this->checkout->transaction->txn_status_updated()
189
+					|| $this->checkout->any_reg_status_updated()
190
+				)
191
+			) {
192
+				$deliver_notifications = false;
193
+			}
194
+			if ($this->checkout->payment_method->is_off_site()) {
195
+				/** @var EE_Gateway $gateway */
196
+				$gateway = $this->checkout->payment_method->type_obj()->get_gateway();
197
+				// and the gateway uses a separate request to process the IPN
198
+				/** @var RequestInterface $request */
199
+				$request = LoaderFactory::getLoader()->getShared(RequestInterface::class);
200
+				if (
201
+					$gateway instanceof EE_Offsite_Gateway
202
+					&& $gateway->handle_IPN_in_this_request($request->requestParams(), true)
203
+				) {
204
+					// IPN request will handle triggering notifications
205
+					$deliver_notifications = false;
206
+					// no really... don't send any notices in this request
207
+					remove_all_filters('FHEE__EED_Messages___maybe_registration__deliver_notifications');
208
+					add_filter(
209
+						'FHEE__EED_Messages___maybe_registration__deliver_notifications',
210
+						'__return_false',
211
+						15
212
+					);
213
+				}
214
+			}
215
+			if ($deliver_notifications) {
216
+				// send out notifications
217
+				add_filter('FHEE__EED_Messages___maybe_registration__deliver_notifications', '__return_true', 10);
218
+			}
219
+		}
220
+	}
221 221
 
222 222
 
223
-    /**
224
-     * check if transaction has a primary registrant and that it has a related Attendee object
225
-     *
226
-     * @return boolean
227
-     * @throws EE_Error
228
-     * @throws ReflectionException
229
-     */
230
-    protected function _validate_primary_registrant()
231
-    {
232
-        if (! $this->checkout->transaction_has_primary_registrant()) {
233
-            EE_Error::add_error(
234
-                esc_html__('A valid Primary Registration for this Transaction could not be found.', 'event_espresso'),
235
-                __FILE__,
236
-                __FUNCTION__,
237
-                __LINE__
238
-            );
239
-            $this->checkout->redirect     = false;
240
-            $this->checkout->continue_reg = false;
241
-            return false;
242
-        }
243
-        // setup URL for redirect
244
-        $this->checkout->redirect_url = add_query_arg(
245
-            ['e_reg_url_link' => $this->checkout->transaction->primary_registration()->reg_url_link()],
246
-            $this->checkout->thank_you_page_url
247
-        );
248
-        return true;
249
-    }
223
+	/**
224
+	 * check if transaction has a primary registrant and that it has a related Attendee object
225
+	 *
226
+	 * @return boolean
227
+	 * @throws EE_Error
228
+	 * @throws ReflectionException
229
+	 */
230
+	protected function _validate_primary_registrant()
231
+	{
232
+		if (! $this->checkout->transaction_has_primary_registrant()) {
233
+			EE_Error::add_error(
234
+				esc_html__('A valid Primary Registration for this Transaction could not be found.', 'event_espresso'),
235
+				__FILE__,
236
+				__FUNCTION__,
237
+				__LINE__
238
+			);
239
+			$this->checkout->redirect     = false;
240
+			$this->checkout->continue_reg = false;
241
+			return false;
242
+		}
243
+		// setup URL for redirect
244
+		$this->checkout->redirect_url = add_query_arg(
245
+			['e_reg_url_link' => $this->checkout->transaction->primary_registration()->reg_url_link()],
246
+			$this->checkout->thank_you_page_url
247
+		);
248
+		return true;
249
+	}
250 250
 
251 251
 
252
-    /**
253
-     * @return void
254
-     */
255
-    public function update_reg_step()
256
-    {
257
-        EE_Error::doing_it_wrong(
258
-            __CLASS__ . '::' . __FILE__,
259
-            esc_html__(
260
-                'Can not call update_reg_step() on the Finalize Registration reg step.',
261
-                'event_espresso'
262
-            ),
263
-            '4.6.0'
264
-        );
265
-    }
252
+	/**
253
+	 * @return void
254
+	 */
255
+	public function update_reg_step()
256
+	{
257
+		EE_Error::doing_it_wrong(
258
+			__CLASS__ . '::' . __FILE__,
259
+			esc_html__(
260
+				'Can not call update_reg_step() on the Finalize Registration reg step.',
261
+				'event_espresso'
262
+			),
263
+			'4.6.0'
264
+		);
265
+	}
266 266
 }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
             $txn_update_params
99 99
         );
100 100
         // check if transaction has a primary registrant and that it has a related Attendee object
101
-        if (! $this->_validate_primary_registrant()) {
101
+        if ( ! $this->_validate_primary_registrant()) {
102 102
             return false;
103 103
         }
104 104
         // you don't have to go home but you can't stay here !
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
      */
230 230
     protected function _validate_primary_registrant()
231 231
     {
232
-        if (! $this->checkout->transaction_has_primary_registrant()) {
232
+        if ( ! $this->checkout->transaction_has_primary_registrant()) {
233 233
             EE_Error::add_error(
234 234
                 esc_html__('A valid Primary Registration for this Transaction could not be found.', 'event_espresso'),
235 235
                 __FILE__,
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
     public function update_reg_step()
256 256
     {
257 257
         EE_Error::doing_it_wrong(
258
-            __CLASS__ . '::' . __FILE__,
258
+            __CLASS__.'::'.__FILE__,
259 259
             esc_html__(
260 260
                 'Can not call update_reg_step() on the Finalize Registration reg step.',
261 261
                 'event_espresso'
Please login to merge, or discard this patch.
reg_steps/attendee_information/auto_copy_attendee_info.template.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@
 block discarded – undo
1 1
 <p id="spco-auto-copy-attendee-pg" class="smaller-text lt-grey-text">
2 2
     <?php echo apply_filters(
3
-        'FHEE__registration_page_attendee_information__auto_copy_attendee_pg',
4
-        esc_html__(
5
-            'The above information will be used for any additional tickets/attendees.',
6
-            'event_espresso'
7
-        )
8
-    ); ?>
3
+		'FHEE__registration_page_attendee_information__auto_copy_attendee_pg',
4
+		esc_html__(
5
+			'The above information will be used for any additional tickets/attendees.',
6
+			'event_espresso'
7
+		)
8
+	); ?>
9 9
 </p>
10 10
\ No newline at end of file
Please login to merge, or discard this patch.