Completed
Branch dependabot/composer/wp-graphql... (64393b)
by
unknown
04:29
created
payment_methods/Paypal_Express/templates/paypal_express_intro.template.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 printf(
4
-    esc_html__(
5
-        'PayPal Express (Express Checkout) is an off-site payment method for accepting payments via PayPal and is available to event organizers in many countries. A PayPal premier or business account is needed to accept payments. Need a PayPal account? Call 1-855-456-1338 or %1$sclick here to sign up for a merchant account%2$s.',
6
-        'event_espresso'
7
-    ),
8
-    '<a href="https://eventespresso.com/go/paypalexpress/" target="_blank">',
9
-    '</a>'
4
+	esc_html__(
5
+		'PayPal Express (Express Checkout) is an off-site payment method for accepting payments via PayPal and is available to event organizers in many countries. A PayPal premier or business account is needed to accept payments. Need a PayPal account? Call 1-855-456-1338 or %1$sclick here to sign up for a merchant account%2$s.',
6
+		'event_espresso'
7
+	),
8
+	'<a href="https://eventespresso.com/go/paypalexpress/" target="_blank">',
9
+	'</a>'
10 10
 );
Please login to merge, or discard this patch.
payment_methods/Paypal_Standard/EE_Paypal_Standard_Form.form.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
         $paypal_calculates_taxes = $this->get_input_value('paypal_taxes');
68 68
         $paypal_requests_address_info = $this->get_input_value('shipping_details');
69 69
         if (
70
-            ( $paypal_calculates_shipping || $paypal_calculates_taxes ) &&
70
+            ($paypal_calculates_shipping || $paypal_calculates_taxes) &&
71 71
             $paypal_requests_address_info == EE_PMT_Paypal_Standard::shipping_info_none
72 72
         ) {
73 73
             // they want paypal to calculate taxes or shipping. They need to ask for
@@ -80,8 +80,8 @@  discard block
 block discarded – undo
80 80
                 sprintf(
81 81
                     esc_html__('Automatically set "%s" to "%s" because Paypal requires address info in order to calculate shipping or taxes.', 'event_espresso'),
82 82
                     strip_tags($shipping_details_input->html_label_text()),
83
-                    isset($shipping_details_input_options[ EE_PMT_Paypal_Standard::shipping_info_optional ])
84
-                        ? $shipping_details_input_options[ EE_PMT_Paypal_Standard::shipping_info_optional ]
83
+                    isset($shipping_details_input_options[EE_PMT_Paypal_Standard::shipping_info_optional])
84
+                        ? $shipping_details_input_options[EE_PMT_Paypal_Standard::shipping_info_optional]
85 85
                         : esc_html__('Unknown', 'event_espresso')
86 86
                 ),
87 87
                 __FILE__,
Please login to merge, or discard this patch.
Indentation   +71 added lines, -71 removed lines patch added patch discarded remove patch
@@ -13,78 +13,78 @@
 block discarded – undo
13 13
  */
14 14
 class EE_Paypal_Standard_Form extends EE_Payment_Method_Form
15 15
 {
16
-    /**
17
-     * @param EE_PMT_Paypal_Standard $payment_method_type
18
-     */
19
-    public function __construct($payment_method_type)
20
-    {
21
-        parent::__construct(
22
-            array(
23
-                'payment_method_type'          => $payment_method_type,
24
-                'extra_meta_inputs'            => array(
25
-                    'paypal_id'        => new EE_Text_Input(array(
26
-                        'html_label_text' => sprintf(esc_html__("Paypal Email %s", 'event_espresso'), $payment_method_type->get_help_tab_link()),
27
-                        'html_help_text'  => esc_html__("Typically [email protected]", 'event_espresso'),
28
-                        'required'        => true
29
-                    )),
30
-                    'image_url'        => new EE_Admin_File_Uploader_Input(array(
31
-                        'html_help_text'  => esc_html__("Used for your business/personal logo on the PayPal page", 'event_espresso'),
32
-                        'html_label_text' => esc_html__('Image URL', 'event_espresso')
33
-                    )),
34
-                    'paypal_taxes'     => new EE_Yes_No_Input(array(
35
-                        'html_label_text' => sprintf(esc_html__('Paypal Calculates Taxes %s', 'event_espresso'), $payment_method_type->get_help_tab_link()),
36
-                        'html_help_text'  => esc_html__('Whether Paypal should add taxes to the order', 'event_espresso'),
37
-                        'default'         => false
38
-                    )),
39
-                    'paypal_shipping'  => new EE_Yes_No_Input(array(
40
-                        'html_label_text' => sprintf(esc_html__('Paypal Calculates Shipping %s', 'event_espresso'), $payment_method_type->get_help_tab_link()),
41
-                        'html_help_text'  => esc_html__('Whether Paypal should add shipping surcharges', 'event_espresso'),
42
-                        'default'         => false
43
-                    )),
44
-                    'shipping_details' => new EE_Select_Input(array(
45
-                        EE_PMT_Paypal_Standard::shipping_info_none     => esc_html__("Do not prompt for an address", 'event_espresso'),
46
-                        EE_PMT_Paypal_Standard::shipping_info_optional => esc_html__("Prompt for an address, but do not require it", 'event_espresso'),
47
-                        EE_PMT_Paypal_Standard::shipping_info_required => esc_html__("Prompt for an address, and require it", 'event_espresso')
48
-                    ))
49
-                )
50
-            )
51
-        );
52
-    }
16
+	/**
17
+	 * @param EE_PMT_Paypal_Standard $payment_method_type
18
+	 */
19
+	public function __construct($payment_method_type)
20
+	{
21
+		parent::__construct(
22
+			array(
23
+				'payment_method_type'          => $payment_method_type,
24
+				'extra_meta_inputs'            => array(
25
+					'paypal_id'        => new EE_Text_Input(array(
26
+						'html_label_text' => sprintf(esc_html__("Paypal Email %s", 'event_espresso'), $payment_method_type->get_help_tab_link()),
27
+						'html_help_text'  => esc_html__("Typically [email protected]", 'event_espresso'),
28
+						'required'        => true
29
+					)),
30
+					'image_url'        => new EE_Admin_File_Uploader_Input(array(
31
+						'html_help_text'  => esc_html__("Used for your business/personal logo on the PayPal page", 'event_espresso'),
32
+						'html_label_text' => esc_html__('Image URL', 'event_espresso')
33
+					)),
34
+					'paypal_taxes'     => new EE_Yes_No_Input(array(
35
+						'html_label_text' => sprintf(esc_html__('Paypal Calculates Taxes %s', 'event_espresso'), $payment_method_type->get_help_tab_link()),
36
+						'html_help_text'  => esc_html__('Whether Paypal should add taxes to the order', 'event_espresso'),
37
+						'default'         => false
38
+					)),
39
+					'paypal_shipping'  => new EE_Yes_No_Input(array(
40
+						'html_label_text' => sprintf(esc_html__('Paypal Calculates Shipping %s', 'event_espresso'), $payment_method_type->get_help_tab_link()),
41
+						'html_help_text'  => esc_html__('Whether Paypal should add shipping surcharges', 'event_espresso'),
42
+						'default'         => false
43
+					)),
44
+					'shipping_details' => new EE_Select_Input(array(
45
+						EE_PMT_Paypal_Standard::shipping_info_none     => esc_html__("Do not prompt for an address", 'event_espresso'),
46
+						EE_PMT_Paypal_Standard::shipping_info_optional => esc_html__("Prompt for an address, but do not require it", 'event_espresso'),
47
+						EE_PMT_Paypal_Standard::shipping_info_required => esc_html__("Prompt for an address, and require it", 'event_espresso')
48
+					))
49
+				)
50
+			)
51
+		);
52
+	}
53 53
 
54 54
 
55 55
 
56
-    /**
57
-     * @param array $req_data
58
-     * @throws EE_Error
59
-     */
60
-    public function _normalize($req_data)
61
-    {
62
-        parent::_normalize($req_data);
63
-        $paypal_calculates_shipping = $this->get_input_value('paypal_shipping');
64
-        $paypal_calculates_taxes = $this->get_input_value('paypal_taxes');
65
-        $paypal_requests_address_info = $this->get_input_value('shipping_details');
66
-        if (
67
-            ( $paypal_calculates_shipping || $paypal_calculates_taxes ) &&
68
-            $paypal_requests_address_info == EE_PMT_Paypal_Standard::shipping_info_none
69
-        ) {
70
-            // they want paypal to calculate taxes or shipping. They need to ask for
71
-            // address info, otherwise paypal can't calculate taxes or shipping
72
-            /** @type EE_Select_Input $shipping_details_input */
73
-            $shipping_details_input = $this->get_input('shipping_details');
74
-            $shipping_details_input->set_default(EE_PMT_Paypal_Standard::shipping_info_optional);
75
-            $shipping_details_input_options = $shipping_details_input->options();
76
-            EE_Error::add_attention(
77
-                sprintf(
78
-                    esc_html__('Automatically set "%s" to "%s" because Paypal requires address info in order to calculate shipping or taxes.', 'event_espresso'),
79
-                    strip_tags($shipping_details_input->html_label_text()),
80
-                    isset($shipping_details_input_options[ EE_PMT_Paypal_Standard::shipping_info_optional ])
81
-                        ? $shipping_details_input_options[ EE_PMT_Paypal_Standard::shipping_info_optional ]
82
-                        : esc_html__('Unknown', 'event_espresso')
83
-                ),
84
-                __FILE__,
85
-                __FUNCTION__,
86
-                __LINE__
87
-            );
88
-        }
89
-    }
56
+	/**
57
+	 * @param array $req_data
58
+	 * @throws EE_Error
59
+	 */
60
+	public function _normalize($req_data)
61
+	{
62
+		parent::_normalize($req_data);
63
+		$paypal_calculates_shipping = $this->get_input_value('paypal_shipping');
64
+		$paypal_calculates_taxes = $this->get_input_value('paypal_taxes');
65
+		$paypal_requests_address_info = $this->get_input_value('shipping_details');
66
+		if (
67
+			( $paypal_calculates_shipping || $paypal_calculates_taxes ) &&
68
+			$paypal_requests_address_info == EE_PMT_Paypal_Standard::shipping_info_none
69
+		) {
70
+			// they want paypal to calculate taxes or shipping. They need to ask for
71
+			// address info, otherwise paypal can't calculate taxes or shipping
72
+			/** @type EE_Select_Input $shipping_details_input */
73
+			$shipping_details_input = $this->get_input('shipping_details');
74
+			$shipping_details_input->set_default(EE_PMT_Paypal_Standard::shipping_info_optional);
75
+			$shipping_details_input_options = $shipping_details_input->options();
76
+			EE_Error::add_attention(
77
+				sprintf(
78
+					esc_html__('Automatically set "%s" to "%s" because Paypal requires address info in order to calculate shipping or taxes.', 'event_espresso'),
79
+					strip_tags($shipping_details_input->html_label_text()),
80
+					isset($shipping_details_input_options[ EE_PMT_Paypal_Standard::shipping_info_optional ])
81
+						? $shipping_details_input_options[ EE_PMT_Paypal_Standard::shipping_info_optional ]
82
+						: esc_html__('Unknown', 'event_espresso')
83
+				),
84
+				__FILE__,
85
+				__FUNCTION__,
86
+				__LINE__
87
+			);
88
+		}
89
+	}
90 90
 }
Please login to merge, or discard this patch.
admin_pages/registrations/qtips/Registration_List_Table_Tips.lib.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -84,7 +84,7 @@
 block discarded – undo
84 84
                . esc_html__(
85 85
                    'This lock-icon means that this registration cannot be trashed.  Registrations that belong to a transaction that has payments cannot be trashed.  If you wish to trash this registration then you must delete all payments attached to the related transaction first.',
86 86
                    'event_espresso'
87
-               ) . '</p>';
87
+               ).'</p>';
88 88
     }
89 89
 
90 90
 
Please login to merge, or discard this patch.
Indentation   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -13,16 +13,16 @@  discard block
 block discarded – undo
13 13
  */
14 14
 class Registration_List_Table_Tips extends EE_Qtip_Config
15 15
 {
16
-    protected function _set_tips_array()
17
-    {
18
-        $this->_qtipsa = array(
19
-            0 => array(
20
-                'content_id' => 'registration-trash-lock',
21
-                'target'     => '.ee-lock-icon',
22
-                'content'    => $this->_registration_trash_message(),
23
-            ),
24
-            /** removing status strips for now because they are triggered anywhere on the row. */
25
-            /**1 => array(
16
+	protected function _set_tips_array()
17
+	{
18
+		$this->_qtipsa = array(
19
+			0 => array(
20
+				'content_id' => 'registration-trash-lock',
21
+				'target'     => '.ee-lock-icon',
22
+				'content'    => $this->_registration_trash_message(),
23
+			),
24
+			/** removing status strips for now because they are triggered anywhere on the row. */
25
+			/**1 => array(
26 26
              * 'content_id' => 'registration-status-' . EEM_Registration::status_id_approved,
27 27
              * 'target' => '.reg-status-' . EEM_Registration::status_id_approved,
28 28
              * 'content' => $this->_registration_status_legend(EEM_Registration::status_id_approved),
@@ -72,37 +72,37 @@  discard block
 block discarded – undo
72 72
              * )
73 73
              * )
74 74
              * )/**/
75
-        );
76
-    }
75
+		);
76
+	}
77 77
 
78 78
 
79
-    private function _registration_trash_message()
80
-    {
81
-        return '<p>'
82
-               . esc_html__(
83
-                   'This lock-icon means that this registration cannot be trashed.  Registrations that belong to a transaction that has payments cannot be trashed.  If you wish to trash this registration then you must delete all payments attached to the related transaction first.',
84
-                   'event_espresso'
85
-               ) . '</p>';
86
-    }
79
+	private function _registration_trash_message()
80
+	{
81
+		return '<p>'
82
+			   . esc_html__(
83
+				   'This lock-icon means that this registration cannot be trashed.  Registrations that belong to a transaction that has payments cannot be trashed.  If you wish to trash this registration then you must delete all payments attached to the related transaction first.',
84
+				   'event_espresso'
85
+			   ) . '</p>';
86
+	}
87 87
 
88 88
 
89
-    /**
90
-     * output the relevant ee-status-legend with the designated status highlighted.
91
-     *
92
-     * @param  EEM_Registration constant $status What status is set (by class)
93
-     * @return string         The status legend with the related status highlighted
94
-     */
95
-    private function _registration_status_legend($status)
96
-    {
89
+	/**
90
+	 * output the relevant ee-status-legend with the designated status highlighted.
91
+	 *
92
+	 * @param  EEM_Registration constant $status What status is set (by class)
93
+	 * @return string         The status legend with the related status highlighted
94
+	 */
95
+	private function _registration_status_legend($status)
96
+	{
97 97
 
98
-        $status_array = array(
99
-            'approved_status' => EEM_Registration::status_id_approved,
100
-            'pending_status' => EEM_Registration::status_id_pending_payment,
101
-            'not_approved' => EEM_Registration::status_id_not_approved,
102
-            'declined_status' => EEM_Registration::status_id_declined,
103
-            'cancelled_status' => EEM_Registration::status_id_cancelled,
104
-        );
98
+		$status_array = array(
99
+			'approved_status' => EEM_Registration::status_id_approved,
100
+			'pending_status' => EEM_Registration::status_id_pending_payment,
101
+			'not_approved' => EEM_Registration::status_id_not_approved,
102
+			'declined_status' => EEM_Registration::status_id_declined,
103
+			'cancelled_status' => EEM_Registration::status_id_cancelled,
104
+		);
105 105
 
106
-        return EEH_Template::status_legend($status_array, $status);
107
-    }
106
+		return EEH_Template::status_legend($status_array, $status);
107
+	}
108 108
 }
Please login to merge, or discard this patch.
admin_pages/events/Events_Admin_Page_Init.core.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -21,13 +21,13 @@
 block discarded – undo
21 21
          * define some events related constants but only if not defined (need to check because unit tests
22 22
          *  may load)
23 23
          */
24
-        if (! defined('EVENTS_PG_SLUG')) {
24
+        if ( ! defined('EVENTS_PG_SLUG')) {
25 25
             define('EVENTS_PG_SLUG', 'espresso_events');
26 26
             define('EVENTS_LABEL', esc_html__('Events', 'event_espresso'));
27
-            define('EVENTS_ADMIN', EE_ADMIN_PAGES . 'events/');
28
-            define('EVENTS_ADMIN_URL', admin_url('admin.php?page=' . EVENTS_PG_SLUG));
29
-            define('EVENTS_TEMPLATE_PATH', EVENTS_ADMIN . 'templates/');
30
-            define('EVENTS_ASSETS_URL', EE_ADMIN_PAGES_URL . 'events/assets/');
27
+            define('EVENTS_ADMIN', EE_ADMIN_PAGES.'events/');
28
+            define('EVENTS_ADMIN_URL', admin_url('admin.php?page='.EVENTS_PG_SLUG));
29
+            define('EVENTS_TEMPLATE_PATH', EVENTS_ADMIN.'templates/');
30
+            define('EVENTS_ASSETS_URL', EE_ADMIN_PAGES_URL.'events/assets/');
31 31
         }
32 32
         parent::__construct();
33 33
     }
Please login to merge, or discard this patch.
Indentation   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -14,41 +14,41 @@
 block discarded – undo
14 14
  */
15 15
 class Events_Admin_Page_Init extends EE_Admin_Page_CPT_Init
16 16
 {
17
-    public function __construct()
18
-    {
19
-        /**
20
-         * define some events related constants but only if not defined (need to check because unit tests
21
-         *  may load)
22
-         */
23
-        if (! defined('EVENTS_PG_SLUG')) {
24
-            define('EVENTS_PG_SLUG', 'espresso_events');
25
-            define('EVENTS_LABEL', esc_html__('Events', 'event_espresso'));
26
-            define('EVENTS_ADMIN', EE_ADMIN_PAGES . 'events/');
27
-            define('EVENTS_ADMIN_URL', admin_url('admin.php?page=' . EVENTS_PG_SLUG));
28
-            define('EVENTS_TEMPLATE_PATH', EVENTS_ADMIN . 'templates/');
29
-            define('EVENTS_ASSETS_URL', EE_ADMIN_PAGES_URL . 'events/assets/');
30
-        }
31
-        parent::__construct();
32
-    }
17
+	public function __construct()
18
+	{
19
+		/**
20
+		 * define some events related constants but only if not defined (need to check because unit tests
21
+		 *  may load)
22
+		 */
23
+		if (! defined('EVENTS_PG_SLUG')) {
24
+			define('EVENTS_PG_SLUG', 'espresso_events');
25
+			define('EVENTS_LABEL', esc_html__('Events', 'event_espresso'));
26
+			define('EVENTS_ADMIN', EE_ADMIN_PAGES . 'events/');
27
+			define('EVENTS_ADMIN_URL', admin_url('admin.php?page=' . EVENTS_PG_SLUG));
28
+			define('EVENTS_TEMPLATE_PATH', EVENTS_ADMIN . 'templates/');
29
+			define('EVENTS_ASSETS_URL', EE_ADMIN_PAGES_URL . 'events/assets/');
30
+		}
31
+		parent::__construct();
32
+	}
33 33
 
34 34
 
35
-    protected function _set_init_properties()
36
-    {
37
-        $this->label = esc_html__('Event Espresso - Event Details', 'event_espresso');
38
-    }
35
+	protected function _set_init_properties()
36
+	{
37
+		$this->label = esc_html__('Event Espresso - Event Details', 'event_espresso');
38
+	}
39 39
 
40 40
 
41
-    public function getMenuProperties(): array
42
-    {
43
-        return [
44
-            'menu_type'       => AdminMenuItem::TYPE_MENU_SUB_ITEM,
45
-            'menu_group'      => 'main',
46
-            'menu_order'      => 10,
47
-            'show_on_menu'    => AdminMenuItem::DISPLAY_BLOG_ONLY,
48
-            'parent_slug'     => 'espresso_events',
49
-            'menu_slug'       => 'espresso_events',
50
-            'menu_label'      => esc_html__('Events', 'event_espresso'),
51
-            'capability'      => 'ee_read_events',
52
-        ];
53
-    }
41
+	public function getMenuProperties(): array
42
+	{
43
+		return [
44
+			'menu_type'       => AdminMenuItem::TYPE_MENU_SUB_ITEM,
45
+			'menu_group'      => 'main',
46
+			'menu_order'      => 10,
47
+			'show_on_menu'    => AdminMenuItem::DISPLAY_BLOG_ONLY,
48
+			'parent_slug'     => 'espresso_events',
49
+			'menu_slug'       => 'espresso_events',
50
+			'menu_label'      => esc_html__('Events', 'event_espresso'),
51
+			'capability'      => 'ee_read_events',
52
+		];
53
+	}
54 54
 }
Please login to merge, or discard this patch.
message_type/newsletter/EE_Messages_Contacts_incoming_data.class.php 2 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 
27 27
         // validate that the first element in the array is an EE_Attendee object.  Note that the array may be indexed by REG_ID so we will just shift off the first element.
28 28
         $ctc_chk = reset($data);
29
-        if (! $ctc_chk instanceof EE_Attendee) {
29
+        if ( ! $ctc_chk instanceof EE_Attendee) {
30 30
             throw new EE_Error(esc_html__('The EE_Message_Contacts_incoming_data class expects an array of EE_Attendee objects.', 'event_espresso'));
31 31
         }
32 32
 
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
     {
44 44
         $attendee_ids = array_filter(
45 45
             array_map(
46
-                function ($attendee) {
46
+                function($attendee) {
47 47
                     if ($attendee instanceof EE_Attendee) {
48 48
                         return $attendee->ID();
49 49
                     }
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
         $attendee_ids = (array) $attendee_ids;
69 69
         $attendees = EEM_Attendee::instance()->get_all(
70 70
             array(
71
-              array( 'ATT_ID' => array( 'IN', $attendee_ids ) )
71
+              array('ATT_ID' => array('IN', $attendee_ids))
72 72
             )
73 73
         );
74 74
         return $attendees;
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
         $this->payment = null;
99 99
         $this->billing = array();
100 100
         $this->reg_objs = array();
101
-        $this->attendees = $this->events = $this->tickets = $this->datetimes = $this->questions = $this->answer =  $this->registrations = array();
101
+        $this->attendees = $this->events = $this->tickets = $this->datetimes = $this->questions = $this->answer = $this->registrations = array();
102 102
         $this->total_ticket_count = 0;
103 103
         $this->primary_attendee_data = array(
104 104
             'registration_id' => 0,
@@ -111,11 +111,11 @@  discard block
 block discarded – undo
111 111
         foreach ($this->_data as $contact) {
112 112
             $id = $contact->ID();
113 113
             $reg = $contact->get_first_related('Registration');
114
-            $this->attendees[ $id ]['att_obj'] = $contact;
115
-            $this->attendees[ $id ]['reg_objs'][ $reg->ID() ] = $reg;
116
-            $this->attendees[ $id ]['attendee_email'] = $contact->email();
117
-            $this->attendees[ $id ]['tkt_objs'] = array();
118
-            $this->attendees[ $id ]['evt_objs'] = array();
114
+            $this->attendees[$id]['att_obj'] = $contact;
115
+            $this->attendees[$id]['reg_objs'][$reg->ID()] = $reg;
116
+            $this->attendees[$id]['attendee_email'] = $contact->email();
117
+            $this->attendees[$id]['tkt_objs'] = array();
118
+            $this->attendees[$id]['evt_objs'] = array();
119 119
         }
120 120
     }
121 121
 }
Please login to merge, or discard this patch.
Indentation   +91 added lines, -91 removed lines patch added patch discarded remove patch
@@ -11,109 +11,109 @@
 block discarded – undo
11 11
  */
12 12
 class EE_Messages_Contacts_incoming_data extends EE_Messages_incoming_data
13 13
 {
14
-    /**
15
-     * Constructor.
16
-     *
17
-     * @since    4.3.0
18
-     * @param  EE_Attendee[]     $data expecting an array of EE_Attendee objects.
19
-     * @throws EE_Error
20
-     * @access protected
21
-     */
22
-    public function __construct($data = array())
23
-    {
14
+	/**
15
+	 * Constructor.
16
+	 *
17
+	 * @since    4.3.0
18
+	 * @param  EE_Attendee[]     $data expecting an array of EE_Attendee objects.
19
+	 * @throws EE_Error
20
+	 * @access protected
21
+	 */
22
+	public function __construct($data = array())
23
+	{
24 24
 
25
-        // validate that the first element in the array is an EE_Attendee object.  Note that the array may be indexed by REG_ID so we will just shift off the first element.
26
-        $ctc_chk = reset($data);
27
-        if (! $ctc_chk instanceof EE_Attendee) {
28
-            throw new EE_Error(esc_html__('The EE_Message_Contacts_incoming_data class expects an array of EE_Attendee objects.', 'event_espresso'));
29
-        }
25
+		// validate that the first element in the array is an EE_Attendee object.  Note that the array may be indexed by REG_ID so we will just shift off the first element.
26
+		$ctc_chk = reset($data);
27
+		if (! $ctc_chk instanceof EE_Attendee) {
28
+			throw new EE_Error(esc_html__('The EE_Message_Contacts_incoming_data class expects an array of EE_Attendee objects.', 'event_espresso'));
29
+		}
30 30
 
31
-        parent::__construct($data);
32
-    }
31
+		parent::__construct($data);
32
+	}
33 33
 
34 34
 
35
-    /**
36
-     * @see parent class for phpdocs.
37
-     * @param array $attendees
38
-     * @return array
39
-     */
40
-    public static function convert_data_for_persistent_storage($attendees)
41
-    {
42
-        $attendee_ids = array_filter(
43
-            array_map(
44
-                function ($attendee) {
45
-                    if ($attendee instanceof EE_Attendee) {
46
-                        return $attendee->ID();
47
-                    }
48
-                    return false;
49
-                },
50
-                $attendees
51
-            )
52
-        );
53
-        return $attendee_ids;
54
-    }
35
+	/**
36
+	 * @see parent class for phpdocs.
37
+	 * @param array $attendees
38
+	 * @return array
39
+	 */
40
+	public static function convert_data_for_persistent_storage($attendees)
41
+	{
42
+		$attendee_ids = array_filter(
43
+			array_map(
44
+				function ($attendee) {
45
+					if ($attendee instanceof EE_Attendee) {
46
+						return $attendee->ID();
47
+					}
48
+					return false;
49
+				},
50
+				$attendees
51
+			)
52
+		);
53
+		return $attendee_ids;
54
+	}
55 55
 
56 56
 
57 57
 
58 58
 
59
-    /**
60
-     * @see parent class for phpdocs
61
-     * @param array $attendee_ids
62
-     * @return EE_Attendee[]
63
-     */
64
-    public static function convert_data_from_persistent_storage($attendee_ids)
65
-    {
66
-        $attendee_ids = (array) $attendee_ids;
67
-        $attendees = EEM_Attendee::instance()->get_all(
68
-            array(
69
-              array( 'ATT_ID' => array( 'IN', $attendee_ids ) )
70
-            )
71
-        );
72
-        return $attendees;
73
-    }
59
+	/**
60
+	 * @see parent class for phpdocs
61
+	 * @param array $attendee_ids
62
+	 * @return EE_Attendee[]
63
+	 */
64
+	public static function convert_data_from_persistent_storage($attendee_ids)
65
+	{
66
+		$attendee_ids = (array) $attendee_ids;
67
+		$attendees = EEM_Attendee::instance()->get_all(
68
+			array(
69
+			  array( 'ATT_ID' => array( 'IN', $attendee_ids ) )
70
+			)
71
+		);
72
+		return $attendees;
73
+	}
74 74
 
75 75
 
76 76
 
77 77
 
78
-    /**
79
-     * setup the data.
80
-     *
81
-     * Sets up the expected data object for the messages prep using incoming registration objects.
82
-     *
83
-     * @since   4.3.0
84
-     *
85
-     * @return void
86
-     * @access protected
87
-     */
88
-    protected function _setup_data()
89
-    {
78
+	/**
79
+	 * setup the data.
80
+	 *
81
+	 * Sets up the expected data object for the messages prep using incoming registration objects.
82
+	 *
83
+	 * @since   4.3.0
84
+	 *
85
+	 * @return void
86
+	 * @access protected
87
+	 */
88
+	protected function _setup_data()
89
+	{
90 90
 
91
-        // we'll loop through each contact and setup the data needed.  Note that many properties will just be set as empty because the contacts data handler is for a very specific set of data (i.e. just what's related to the contact).
92
-        $this->txn = null;
93
-        $this->taxes = null;
94
-        $this->grand_total_price_object = '';
95
-        $this->user_id = $this->ip_address = $this->user_agent = $this->init_access = '';
96
-        $this->payment = null;
97
-        $this->billing = array();
98
-        $this->reg_objs = array();
99
-        $this->attendees = $this->events = $this->tickets = $this->datetimes = $this->questions = $this->answer =  $this->registrations = array();
100
-        $this->total_ticket_count = 0;
101
-        $this->primary_attendee_data = array(
102
-            'registration_id' => 0,
103
-            'att_obj' => null,
104
-            'reg_obj' => null,
105
-            'primary_att_obj' => null,
106
-            'primary_reg_obj' => null
107
-            );
91
+		// we'll loop through each contact and setup the data needed.  Note that many properties will just be set as empty because the contacts data handler is for a very specific set of data (i.e. just what's related to the contact).
92
+		$this->txn = null;
93
+		$this->taxes = null;
94
+		$this->grand_total_price_object = '';
95
+		$this->user_id = $this->ip_address = $this->user_agent = $this->init_access = '';
96
+		$this->payment = null;
97
+		$this->billing = array();
98
+		$this->reg_objs = array();
99
+		$this->attendees = $this->events = $this->tickets = $this->datetimes = $this->questions = $this->answer =  $this->registrations = array();
100
+		$this->total_ticket_count = 0;
101
+		$this->primary_attendee_data = array(
102
+			'registration_id' => 0,
103
+			'att_obj' => null,
104
+			'reg_obj' => null,
105
+			'primary_att_obj' => null,
106
+			'primary_reg_obj' => null
107
+			);
108 108
 
109
-        foreach ($this->_data as $contact) {
110
-            $id = $contact->ID();
111
-            $reg = $contact->get_first_related('Registration');
112
-            $this->attendees[ $id ]['att_obj'] = $contact;
113
-            $this->attendees[ $id ]['reg_objs'][ $reg->ID() ] = $reg;
114
-            $this->attendees[ $id ]['attendee_email'] = $contact->email();
115
-            $this->attendees[ $id ]['tkt_objs'] = array();
116
-            $this->attendees[ $id ]['evt_objs'] = array();
117
-        }
118
-    }
109
+		foreach ($this->_data as $contact) {
110
+			$id = $contact->ID();
111
+			$reg = $contact->get_first_related('Registration');
112
+			$this->attendees[ $id ]['att_obj'] = $contact;
113
+			$this->attendees[ $id ]['reg_objs'][ $reg->ID() ] = $reg;
114
+			$this->attendees[ $id ]['attendee_email'] = $contact->email();
115
+			$this->attendees[ $id ]['tkt_objs'] = array();
116
+			$this->attendees[ $id ]['evt_objs'] = array();
117
+		}
118
+	}
119 119
 }
Please login to merge, or discard this patch.
message_type/payment_reminder/EE_Payment_Reminder_message_type.class.php 1 patch
Indentation   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -15,49 +15,49 @@
 block discarded – undo
15 15
 class EE_Payment_Reminder_message_type extends EE_Payment_Base_message_type
16 16
 {
17 17
 
18
-    public function __construct()
19
-    {
20
-
21
-        // setup type details for reference
22
-        $this->name = 'payment_reminder';
23
-        $this->description = esc_html__('This message type is used for all payment reminder messages.  These are triggered when an offline gateway registration is completed or when manually triggered via event administrators via the transaction admin page(s).', 'event_espresso');
24
-        $this->label = array(
25
-            'singular' => esc_html__('payment reminder', 'event_espresso'),
26
-            'plural' => esc_html__('payment reminders', 'event_espresso')
27
-            );
28
-        $this->_master_templates = array(
29
-            'email' => 'payment'
30
-            );
31
-
32
-        parent::__construct();
33
-    }
34
-
35
-
36
-
37
-    /**
38
-     * _set_contexts
39
-     * This sets up the contexts associated with the message_type
40
-     *
41
-     * @access  protected
42
-     * @return  void
43
-     */
44
-    protected function _set_contexts()
45
-    {
46
-        $this->_context_label = array(
47
-            'label' => esc_html__('recipient', 'event_espresso'),
48
-            'plural' => esc_html__('recipients', 'event_espresso'),
49
-            'description' => esc_html__('Recipient\'s are who will receive the template.  You may want different payment details sent out depending on who the recipient is', 'event_espresso')
50
-            );
51
-
52
-        $this->_contexts = array(
53
-            'admin' => array(
54
-                'label' => esc_html__('Event Admin', 'event_espresso'),
55
-                'description' => esc_html__('This template is what event administrators will receive on a successful payment', 'event_espresso')
56
-                ),
57
-            'primary_attendee' => array(
58
-                'label' => esc_html__('Primary Registrant', 'event_espresso'),
59
-                'description' => esc_html__('This template is what the primary registrant (the person who made the main registration) will receive on successful payment', 'event_espresso')
60
-                )
61
-            );
62
-    }
18
+	public function __construct()
19
+	{
20
+
21
+		// setup type details for reference
22
+		$this->name = 'payment_reminder';
23
+		$this->description = esc_html__('This message type is used for all payment reminder messages.  These are triggered when an offline gateway registration is completed or when manually triggered via event administrators via the transaction admin page(s).', 'event_espresso');
24
+		$this->label = array(
25
+			'singular' => esc_html__('payment reminder', 'event_espresso'),
26
+			'plural' => esc_html__('payment reminders', 'event_espresso')
27
+			);
28
+		$this->_master_templates = array(
29
+			'email' => 'payment'
30
+			);
31
+
32
+		parent::__construct();
33
+	}
34
+
35
+
36
+
37
+	/**
38
+	 * _set_contexts
39
+	 * This sets up the contexts associated with the message_type
40
+	 *
41
+	 * @access  protected
42
+	 * @return  void
43
+	 */
44
+	protected function _set_contexts()
45
+	{
46
+		$this->_context_label = array(
47
+			'label' => esc_html__('recipient', 'event_espresso'),
48
+			'plural' => esc_html__('recipients', 'event_espresso'),
49
+			'description' => esc_html__('Recipient\'s are who will receive the template.  You may want different payment details sent out depending on who the recipient is', 'event_espresso')
50
+			);
51
+
52
+		$this->_contexts = array(
53
+			'admin' => array(
54
+				'label' => esc_html__('Event Admin', 'event_espresso'),
55
+				'description' => esc_html__('This template is what event administrators will receive on a successful payment', 'event_espresso')
56
+				),
57
+			'primary_attendee' => array(
58
+				'label' => esc_html__('Primary Registrant', 'event_espresso'),
59
+				'description' => esc_html__('This template is what the primary registrant (the person who made the main registration) will receive on successful payment', 'event_espresso')
60
+				)
61
+			);
62
+	}
63 63
 }
Please login to merge, or discard this patch.
message_type/payment_declined/EE_Payment_Declined_message_type.class.php 1 patch
Indentation   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -15,49 +15,49 @@
 block discarded – undo
15 15
 class EE_Payment_Declined_message_type extends EE_Payment_Base_message_type
16 16
 {
17 17
 
18
-    public function __construct()
19
-    {
20
-
21
-        // setup type details for reference
22
-        $this->name = 'payment_declined';
23
-        $this->description = esc_html__('This message type is used for all declined payment notification messages that go out including any manual payments entered by an event administrator.', 'event_espresso');
24
-        $this->label = array(
25
-            'singular' => esc_html__('payment declined', 'event_espresso'),
26
-            'plural' => esc_html__('payments declined', 'event_espresso')
27
-            );
28
-
29
-        $this->_master_templates = array(
30
-            'email' => 'payment'
31
-            );
32
-
33
-        parent::__construct();
34
-    }
35
-
36
-
37
-    /**
38
-     * _set_contexts
39
-     * This sets up the contexts associated with the message_type
40
-     *
41
-     * @access  protected
42
-     * @return  void
43
-     */
44
-    protected function _set_contexts()
45
-    {
46
-        $this->_context_label = array(
47
-            'label' => esc_html__('recipient', 'event_espresso'),
48
-            'plural' => esc_html__('recipients', 'event_espresso'),
49
-            'description' => esc_html__('Recipient\'s are who will receive the template.  You may want different payment details sent out depending on who the recipient is', 'event_espresso')
50
-            );
51
-
52
-        $this->_contexts = array(
53
-            'admin' => array(
54
-                'label' => esc_html__('Event Admin', 'event_espresso'),
55
-                'description' => esc_html__('This template is what event administrators will receive when payment is declined', 'event_espresso')
56
-                ),
57
-            'primary_attendee' => array(
58
-                'label' => esc_html__('Primary Registrant', 'event_espresso'),
59
-                'description' => esc_html__('This template is what the primary registrant (the person who made the main registration) will receive when the payment is declined', 'event_espresso')
60
-                )
61
-            );
62
-    }
18
+	public function __construct()
19
+	{
20
+
21
+		// setup type details for reference
22
+		$this->name = 'payment_declined';
23
+		$this->description = esc_html__('This message type is used for all declined payment notification messages that go out including any manual payments entered by an event administrator.', 'event_espresso');
24
+		$this->label = array(
25
+			'singular' => esc_html__('payment declined', 'event_espresso'),
26
+			'plural' => esc_html__('payments declined', 'event_espresso')
27
+			);
28
+
29
+		$this->_master_templates = array(
30
+			'email' => 'payment'
31
+			);
32
+
33
+		parent::__construct();
34
+	}
35
+
36
+
37
+	/**
38
+	 * _set_contexts
39
+	 * This sets up the contexts associated with the message_type
40
+	 *
41
+	 * @access  protected
42
+	 * @return  void
43
+	 */
44
+	protected function _set_contexts()
45
+	{
46
+		$this->_context_label = array(
47
+			'label' => esc_html__('recipient', 'event_espresso'),
48
+			'plural' => esc_html__('recipients', 'event_espresso'),
49
+			'description' => esc_html__('Recipient\'s are who will receive the template.  You may want different payment details sent out depending on who the recipient is', 'event_espresso')
50
+			);
51
+
52
+		$this->_contexts = array(
53
+			'admin' => array(
54
+				'label' => esc_html__('Event Admin', 'event_espresso'),
55
+				'description' => esc_html__('This template is what event administrators will receive when payment is declined', 'event_espresso')
56
+				),
57
+			'primary_attendee' => array(
58
+				'label' => esc_html__('Primary Registrant', 'event_espresso'),
59
+				'description' => esc_html__('This template is what the primary registrant (the person who made the main registration) will receive when the payment is declined', 'event_espresso')
60
+				)
61
+			);
62
+	}
63 63
 }
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
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.
Indentation   +245 added lines, -245 removed lines patch added patch discarded remove patch
@@ -10,266 +10,266 @@
 block discarded – undo
10 10
  */
11 11
 class EE_PMT_Aim extends EE_PMT_Base
12 12
 {
13
-    /**
14
-     * @param EE_Payment_Method|null $pm_instance
15
-     * @throws ReflectionException
16
-     * @throws EE_Error
17
-     */
18
-    public function __construct($pm_instance = null)
19
-    {
20
-        $this->_setup_properties();
21
-        parent::__construct($pm_instance);
22
-    }
13
+	/**
14
+	 * @param EE_Payment_Method|null $pm_instance
15
+	 * @throws ReflectionException
16
+	 * @throws EE_Error
17
+	 */
18
+	public function __construct($pm_instance = null)
19
+	{
20
+		$this->_setup_properties();
21
+		parent::__construct($pm_instance);
22
+	}
23 23
 
24
-    /**
25
-     * Sets up payment method type properties for this gateway, which is normally
26
-     * done in the constructor, but we want this to be easy for similar gateways to override
27
-     * while still calling the parent constructor.
28
-     * So children should override this method instead of __construct
29
-     */
30
-    protected function _setup_properties()
31
-    {
32
-        require_once($this->file_folder() . 'EEG_Aim.gateway.php');
33
-        $this->_gateway = new EEG_Aim();
34
-        $this->_pretty_name = esc_html__("Authorize.net AIM", 'event_espresso');
35
-        $this->_default_description = esc_html__('Please provide the following billing information.', 'event_espresso');
36
-        $this->_requires_https = true;
37
-    }
24
+	/**
25
+	 * Sets up payment method type properties for this gateway, which is normally
26
+	 * done in the constructor, but we want this to be easy for similar gateways to override
27
+	 * while still calling the parent constructor.
28
+	 * So children should override this method instead of __construct
29
+	 */
30
+	protected function _setup_properties()
31
+	{
32
+		require_once($this->file_folder() . 'EEG_Aim.gateway.php');
33
+		$this->_gateway = new EEG_Aim();
34
+		$this->_pretty_name = esc_html__("Authorize.net AIM", 'event_espresso');
35
+		$this->_default_description = esc_html__('Please provide the following billing information.', 'event_espresso');
36
+		$this->_requires_https = true;
37
+	}
38 38
 
39 39
 
40 40
 
41
-    /**
42
-     * Creates the billing form for this payment method type
43
-     *
44
-     * @param EE_Transaction|null $transaction
45
-     * @return EE_Billing_Info_Form|null
46
-     * @throws EE_Error
47
-     * @throws ReflectionException
48
-     */
49
-    public function generate_new_billing_form(EE_Transaction $transaction = null)
50
-    {
51
-        $billing_form = new EE_Billing_Attendee_Info_Form($this->_pm_instance, array(
52
-            'name' => 'AIM_Form',
53
-            'subsections' => array(
54
-                'credit_card' => new EE_Credit_Card_Input(array(
55
-                    'required' => true,
56
-                    'html_label_text' => esc_html__('Card Number', 'event_espresso')
57
-                )),
58
-                'exp_month' => new EE_Credit_Card_Month_Input(true, array(
59
-                    'required' => true,
60
-                    'html_label_text' => esc_html__('Expiry Month', 'event_espresso')
61
-                )),
62
-                'exp_year' => new EE_Credit_Card_Year_Input(array(
63
-                    'required' => true,
64
-                    'html_label_text' => esc_html__('Expiry Year', 'event_espresso')
65
-                )),
66
-                'cvv' => new EE_CVV_Input(array(
67
-                    'required' => true,
68
-                    'html_label_text' => esc_html__('CVV', 'event_espresso') )),
69
-            )
70
-        ));
71
-        $billing_form->add_subsections(array(
72
-            'company' => new EE_Text_Input(array(
73
-                'html_label_text' => esc_html__('Company', 'event_espresso')
74
-            ))
75
-        ), 'email', false);
76
-        $billing_form->add_subsections(
77
-            array(
78
-                    'fax' => new EE_Text_Input(array(
79
-                        'html_label_text' => esc_html__('Fax', 'event_espresso')
80
-                    ))
81
-                ),
82
-            'phone',
83
-            false
84
-        );
85
-        $settings_form = $this->settings_form();
86
-        if ($settings_form->get_input('excluded_billing_inputs') instanceof EE_Checkbox_Multi_Input) {
87
-                $billing_form->exclude($settings_form->get_input('excluded_billing_inputs')->normalized_value());
88
-        }
89
-        if ($settings_form->get_input('required_billing_inputs') instanceof EE_Checkbox_Multi_Input) {
90
-            $required_inputs = $settings_form->get_input('required_billing_inputs')->normalized_value();
91
-            // only change the requirement of inputs which are allowed to be changed
92
-            /** @var EE_Form_Input_Base[] $inputs_to_evaluate */
93
-            $inputs_to_evaluate = array_intersect_key(
94
-                $billing_form->inputs(),
95
-                $this->billing_input_names()
96
-            );
97
-            foreach ($inputs_to_evaluate as $input_name => $input) {
98
-                if (in_array($input_name, $required_inputs)) {
99
-                    $input->set_required(true);
100
-                } else {
101
-                    $input->set_required(false);
102
-                }
103
-            }
104
-        }
105
-        return $this->apply_billing_form_debug_settings($billing_form);
106
-    }
41
+	/**
42
+	 * Creates the billing form for this payment method type
43
+	 *
44
+	 * @param EE_Transaction|null $transaction
45
+	 * @return EE_Billing_Info_Form|null
46
+	 * @throws EE_Error
47
+	 * @throws ReflectionException
48
+	 */
49
+	public function generate_new_billing_form(EE_Transaction $transaction = null)
50
+	{
51
+		$billing_form = new EE_Billing_Attendee_Info_Form($this->_pm_instance, array(
52
+			'name' => 'AIM_Form',
53
+			'subsections' => array(
54
+				'credit_card' => new EE_Credit_Card_Input(array(
55
+					'required' => true,
56
+					'html_label_text' => esc_html__('Card Number', 'event_espresso')
57
+				)),
58
+				'exp_month' => new EE_Credit_Card_Month_Input(true, array(
59
+					'required' => true,
60
+					'html_label_text' => esc_html__('Expiry Month', 'event_espresso')
61
+				)),
62
+				'exp_year' => new EE_Credit_Card_Year_Input(array(
63
+					'required' => true,
64
+					'html_label_text' => esc_html__('Expiry Year', 'event_espresso')
65
+				)),
66
+				'cvv' => new EE_CVV_Input(array(
67
+					'required' => true,
68
+					'html_label_text' => esc_html__('CVV', 'event_espresso') )),
69
+			)
70
+		));
71
+		$billing_form->add_subsections(array(
72
+			'company' => new EE_Text_Input(array(
73
+				'html_label_text' => esc_html__('Company', 'event_espresso')
74
+			))
75
+		), 'email', false);
76
+		$billing_form->add_subsections(
77
+			array(
78
+					'fax' => new EE_Text_Input(array(
79
+						'html_label_text' => esc_html__('Fax', 'event_espresso')
80
+					))
81
+				),
82
+			'phone',
83
+			false
84
+		);
85
+		$settings_form = $this->settings_form();
86
+		if ($settings_form->get_input('excluded_billing_inputs') instanceof EE_Checkbox_Multi_Input) {
87
+				$billing_form->exclude($settings_form->get_input('excluded_billing_inputs')->normalized_value());
88
+		}
89
+		if ($settings_form->get_input('required_billing_inputs') instanceof EE_Checkbox_Multi_Input) {
90
+			$required_inputs = $settings_form->get_input('required_billing_inputs')->normalized_value();
91
+			// only change the requirement of inputs which are allowed to be changed
92
+			/** @var EE_Form_Input_Base[] $inputs_to_evaluate */
93
+			$inputs_to_evaluate = array_intersect_key(
94
+				$billing_form->inputs(),
95
+				$this->billing_input_names()
96
+			);
97
+			foreach ($inputs_to_evaluate as $input_name => $input) {
98
+				if (in_array($input_name, $required_inputs)) {
99
+					$input->set_required(true);
100
+				} else {
101
+					$input->set_required(false);
102
+				}
103
+			}
104
+		}
105
+		return $this->apply_billing_form_debug_settings($billing_form);
106
+	}
107 107
 
108 108
 
109
-    /**
110
-     * apply_billing_form_debug_settings
111
-     * applies debug data to the form
112
-     *
113
-     * @param EE_Billing_Info_Form $billing_form
114
-     * @return EE_Billing_Info_Form|null
115
-     * @throws EE_Error
116
-     * @throws ReflectionException
117
-     */
118
-    public function apply_billing_form_debug_settings(EE_Billing_Info_Form $billing_form)
119
-    {
120
-        if (
121
-            $this->_pm_instance->debug_mode()
122
-            || $this->_pm_instance->get_extra_meta('test_transactions', true, false)
123
-        ) {
124
-            $billing_form->get_input('credit_card')->set_default('4007000000027');
125
-            $billing_form->get_input('exp_year')->set_default('2020');
126
-            if ($billing_form->get_subsection('cvv') instanceof EE_Form_Input_Base) {
127
-                $billing_form->get_input('cvv')->set_default('123');
128
-            }
129
-            $billing_form->add_subsections(
130
-                array( 'fyi_about_autofill' => $billing_form->payment_fields_autofilled_notice_html() ),
131
-                'credit_card'
132
-            );
133
-            $billing_form->add_subsections(
134
-                array(
135
-                    'debug_content' => new EE_Form_Section_HTML_From_Template(
136
-                        __DIR__ . '/templates/authorize_net_aim_debug_info.template.php'
137
-                    )
138
-                ),
139
-                'first_name'
140
-            );
141
-        }
142
-        return $billing_form;
143
-    }
109
+	/**
110
+	 * apply_billing_form_debug_settings
111
+	 * applies debug data to the form
112
+	 *
113
+	 * @param EE_Billing_Info_Form $billing_form
114
+	 * @return EE_Billing_Info_Form|null
115
+	 * @throws EE_Error
116
+	 * @throws ReflectionException
117
+	 */
118
+	public function apply_billing_form_debug_settings(EE_Billing_Info_Form $billing_form)
119
+	{
120
+		if (
121
+			$this->_pm_instance->debug_mode()
122
+			|| $this->_pm_instance->get_extra_meta('test_transactions', true, false)
123
+		) {
124
+			$billing_form->get_input('credit_card')->set_default('4007000000027');
125
+			$billing_form->get_input('exp_year')->set_default('2020');
126
+			if ($billing_form->get_subsection('cvv') instanceof EE_Form_Input_Base) {
127
+				$billing_form->get_input('cvv')->set_default('123');
128
+			}
129
+			$billing_form->add_subsections(
130
+				array( 'fyi_about_autofill' => $billing_form->payment_fields_autofilled_notice_html() ),
131
+				'credit_card'
132
+			);
133
+			$billing_form->add_subsections(
134
+				array(
135
+					'debug_content' => new EE_Form_Section_HTML_From_Template(
136
+						__DIR__ . '/templates/authorize_net_aim_debug_info.template.php'
137
+					)
138
+				),
139
+				'first_name'
140
+			);
141
+		}
142
+		return $billing_form;
143
+	}
144 144
 
145 145
 
146 146
 
147
-    /**
148
-     * Gets the form for all the settings related to this payment method type
149
-     *
150
-     * @return EE_Payment_Method_Form
151
-     * @throws EE_Error
152
-     * @throws ReflectionException
153
-     */
154
-    public function generate_new_settings_form()
155
-    {
156
-        $billing_input_names = $this->billing_input_names();
157
-        return new EE_Payment_Method_Form(
158
-            array(
159
-                'extra_meta_inputs' => array(
160
-                    'login_id' => new EE_Text_Input(
161
-                        array(
162
-                            'html_label_text' =>  sprintf(esc_html__("Authorize.net API Login ID %s", "event_espresso"), $this->get_help_tab_link()),
163
-                            'required' => true )
164
-                    ),
165
-                    'transaction_key' => new EE_Text_Input(
166
-                        array(
167
-                            'html_label_text' => sprintf(esc_html__("Authorize.net Transaction Key %s", "event_espresso"), $this->get_help_tab_link()),
168
-                            'required' => true )
169
-                    ),
170
-                    'test_transactions' => new EE_Yes_No_Input(
171
-                        array(
172
-                            'html_label_text' =>  sprintf(esc_html__("Send test transactions? %s", 'event_espresso'), $this->get_help_tab_link()),
173
-                            'html_help_text' =>  esc_html__("Send test transactions, even to live server", 'event_espresso'),
174
-                            'default' => false,
175
-                            'required' => true
176
-                        )
177
-                    ),
178
-                    'excluded_billing_inputs' => new EE_Checkbox_Multi_Input(
179
-                        $billing_input_names,
180
-                        array(
181
-                        'html_label_text' => sprintf(esc_html__("Excluded Payment Form Fields %s", 'event_espresso'), $this->get_help_tab_link()),
182
-                        'default' => array(
183
-                            'company',
184
-                            'fax',
185
-                        )
186
-                        )
187
-                    ),
188
-                    'required_billing_inputs' => new EE_Checkbox_Multi_Input(
189
-                        $billing_input_names,
190
-                        array(
191
-                            'html_label_text' => sprintf(esc_html__("Required Payment Form Fields %s", 'event_espresso'), $this->get_help_tab_link()),
192
-                            'default' => array_diff(
193
-                                array_keys($billing_input_names),
194
-                                array( 'address2', 'phone', 'company', 'fax' )
195
-                            ),
196
-                            'html_help_text' => esc_html__('Note: if fields are excluded they cannot be required.', 'event_espresso')
197
-                        )
198
-                    ),
199
-                )
200
-            )
201
-        );
202
-    }
147
+	/**
148
+	 * Gets the form for all the settings related to this payment method type
149
+	 *
150
+	 * @return EE_Payment_Method_Form
151
+	 * @throws EE_Error
152
+	 * @throws ReflectionException
153
+	 */
154
+	public function generate_new_settings_form()
155
+	{
156
+		$billing_input_names = $this->billing_input_names();
157
+		return new EE_Payment_Method_Form(
158
+			array(
159
+				'extra_meta_inputs' => array(
160
+					'login_id' => new EE_Text_Input(
161
+						array(
162
+							'html_label_text' =>  sprintf(esc_html__("Authorize.net API Login ID %s", "event_espresso"), $this->get_help_tab_link()),
163
+							'required' => true )
164
+					),
165
+					'transaction_key' => new EE_Text_Input(
166
+						array(
167
+							'html_label_text' => sprintf(esc_html__("Authorize.net Transaction Key %s", "event_espresso"), $this->get_help_tab_link()),
168
+							'required' => true )
169
+					),
170
+					'test_transactions' => new EE_Yes_No_Input(
171
+						array(
172
+							'html_label_text' =>  sprintf(esc_html__("Send test transactions? %s", 'event_espresso'), $this->get_help_tab_link()),
173
+							'html_help_text' =>  esc_html__("Send test transactions, even to live server", 'event_espresso'),
174
+							'default' => false,
175
+							'required' => true
176
+						)
177
+					),
178
+					'excluded_billing_inputs' => new EE_Checkbox_Multi_Input(
179
+						$billing_input_names,
180
+						array(
181
+						'html_label_text' => sprintf(esc_html__("Excluded Payment Form Fields %s", 'event_espresso'), $this->get_help_tab_link()),
182
+						'default' => array(
183
+							'company',
184
+							'fax',
185
+						)
186
+						)
187
+					),
188
+					'required_billing_inputs' => new EE_Checkbox_Multi_Input(
189
+						$billing_input_names,
190
+						array(
191
+							'html_label_text' => sprintf(esc_html__("Required Payment Form Fields %s", 'event_espresso'), $this->get_help_tab_link()),
192
+							'default' => array_diff(
193
+								array_keys($billing_input_names),
194
+								array( 'address2', 'phone', 'company', 'fax' )
195
+							),
196
+							'html_help_text' => esc_html__('Note: if fields are excluded they cannot be required.', 'event_espresso')
197
+						)
198
+					),
199
+				)
200
+			)
201
+		);
202
+	}
203 203
 
204
-    /**
205
-     * Returns an array where keys are the slugs for billing inputs, and values
206
-     * are their i18n names
207
-     * @return array
208
-     */
209
-    public function billing_input_names()
210
-    {
211
-        return array(
212
-            'first_name' => esc_html__('First Name', 'event_espresso'),
213
-            'last_name' => esc_html__('Last Name', 'event_espresso'),
214
-            'email' => esc_html__('Email', 'event_espresso'),
215
-            'company' => esc_html__('Company', 'event_espresso'),
216
-            'address' => esc_html__('Address', 'event_espresso'),
217
-            'address2' => esc_html__('Address2', 'event_espresso'),
218
-            'city' => esc_html__('City', 'event_espresso'),
219
-            'state' => esc_html__('State', 'event_espresso'),
220
-            'country' => esc_html__('Country', 'event_espresso'),
221
-            'zip' =>  esc_html__('Zip', 'event_espresso'),
222
-            'phone' => esc_html__('Phone', 'event_espresso'),
223
-            'fax' => esc_html__('Fax', 'event_espresso'),
224
-            'cvv' => esc_html__('CVV', 'event_espresso')
225
-        );
226
-    }
204
+	/**
205
+	 * Returns an array where keys are the slugs for billing inputs, and values
206
+	 * are their i18n names
207
+	 * @return array
208
+	 */
209
+	public function billing_input_names()
210
+	{
211
+		return array(
212
+			'first_name' => esc_html__('First Name', 'event_espresso'),
213
+			'last_name' => esc_html__('Last Name', 'event_espresso'),
214
+			'email' => esc_html__('Email', 'event_espresso'),
215
+			'company' => esc_html__('Company', 'event_espresso'),
216
+			'address' => esc_html__('Address', 'event_espresso'),
217
+			'address2' => esc_html__('Address2', 'event_espresso'),
218
+			'city' => esc_html__('City', 'event_espresso'),
219
+			'state' => esc_html__('State', 'event_espresso'),
220
+			'country' => esc_html__('Country', 'event_espresso'),
221
+			'zip' =>  esc_html__('Zip', 'event_espresso'),
222
+			'phone' => esc_html__('Phone', 'event_espresso'),
223
+			'fax' => esc_html__('Fax', 'event_espresso'),
224
+			'cvv' => esc_html__('CVV', 'event_espresso')
225
+		);
226
+	}
227 227
 
228
-    /**
229
-     * Overrides parent so we always have all billing inputs in the returned array,
230
-     * not just the ones included at the time. This helps simplify the gateway code
231
-     *
232
-     * @param EE_Billing_Info_Form|null $billing_form
233
-     * @return array
234
-     */
235
-    protected function _get_billing_values_from_form($billing_form)
236
-    {
237
-        $all_billing_values_empty = array();
238
-        foreach (array_keys($this->billing_input_names()) as $input_name) {
239
-            $all_billing_values_empty[ $input_name ] = '';
240
-        }
241
-        return array_merge(
242
-            $all_billing_values_empty,
243
-            parent::_get_billing_values_from_form($billing_form)
244
-        );
245
-    }
228
+	/**
229
+	 * Overrides parent so we always have all billing inputs in the returned array,
230
+	 * not just the ones included at the time. This helps simplify the gateway code
231
+	 *
232
+	 * @param EE_Billing_Info_Form|null $billing_form
233
+	 * @return array
234
+	 */
235
+	protected function _get_billing_values_from_form($billing_form)
236
+	{
237
+		$all_billing_values_empty = array();
238
+		foreach (array_keys($this->billing_input_names()) as $input_name) {
239
+			$all_billing_values_empty[ $input_name ] = '';
240
+		}
241
+		return array_merge(
242
+			$all_billing_values_empty,
243
+			parent::_get_billing_values_from_form($billing_form)
244
+		);
245
+	}
246 246
 
247 247
 
248 248
 
249
-    /**
250
-     * Adds the help tab
251
-     *
252
-     * @return array
253
-     * @see EE_PMT_Base::help_tabs_config()
254
-     */
255
-    public function help_tabs_config()
256
-    {
257
-        return array(
258
-            $this->get_help_tab_name() => array(
259
-                'title' => esc_html__('Authorize.net AIM Settings', 'event_espresso'),
260
-                'filename' => 'payment_methods_overview_aim'
261
-            ),
262
-        );
263
-    }
249
+	/**
250
+	 * Adds the help tab
251
+	 *
252
+	 * @return array
253
+	 * @see EE_PMT_Base::help_tabs_config()
254
+	 */
255
+	public function help_tabs_config()
256
+	{
257
+		return array(
258
+			$this->get_help_tab_name() => array(
259
+				'title' => esc_html__('Authorize.net AIM Settings', 'event_espresso'),
260
+				'filename' => 'payment_methods_overview_aim'
261
+			),
262
+		);
263
+	}
264 264
 
265 265
 
266 266
 
267
-    /**
268
-     * Gets a list of instructions and/or information regarding how the payment is to be completed
269
-     * @return string
270
-     */
271
-    public function payment_information()
272
-    {
273
-        // TODO: Implement payment_information() method.
274
-    }
267
+	/**
268
+	 * Gets a list of instructions and/or information regarding how the payment is to be completed
269
+	 * @return string
270
+	 */
271
+	public function payment_information()
272
+	{
273
+		// TODO: Implement payment_information() method.
274
+	}
275 275
 }
Please login to merge, or discard this patch.