@@ -7,16 +7,16 @@ |
||
7 | 7 | * @subpackage |
8 | 8 | * @author Mike Nelson |
9 | 9 | */ |
10 | -class EE_Credit_Card_Input extends EE_Form_Input_Base{ |
|
10 | +class EE_Credit_Card_Input extends EE_Form_Input_Base { |
|
11 | 11 | |
12 | 12 | /** |
13 | 13 | * @param array $input_settings |
14 | 14 | */ |
15 | - function __construct($input_settings = array()){ |
|
16 | - $input_settings['required'] = isset( $input_settings['required'] ) ? $input_settings['required'] : TRUE; |
|
15 | + function __construct($input_settings = array()) { |
|
16 | + $input_settings['required'] = isset($input_settings['required']) ? $input_settings['required'] : TRUE; |
|
17 | 17 | $this->_set_display_strategy(new EE_Text_Input_Display_Strategy()); |
18 | 18 | $this->_set_normalization_strategy(new EE_Credit_Card_Normalization()); |
19 | - $this->_add_validation_strategy(new EE_Credit_Card_Validation_Strategy( isset( $input_settings[ 'validation_error_message' ] ) ? $input_settings[ 'validation_error_message' ] : NULL )); |
|
19 | + $this->_add_validation_strategy(new EE_Credit_Card_Validation_Strategy(isset($input_settings['validation_error_message']) ? $input_settings['validation_error_message'] : NULL)); |
|
20 | 20 | $this->set_sensitive_data_removal_strategy(new EE_Credit_Card_Sensitive_Data_Removal()); |
21 | 21 | parent::__construct($input_settings); |
22 | 22 | } |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if (!defined('EVENT_ESPRESSO_VERSION')) |
|
3 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) |
|
4 | 4 | exit('No direct script access allowed'); |
5 | 5 | |
6 | 6 | /** |
@@ -25,12 +25,12 @@ discard block |
||
25 | 25 | * |
26 | 26 | * ------------------------------------------------------------------------ |
27 | 27 | */ |
28 | -class EE_Hidden_Display_Strategy extends EE_Display_Strategy_Base{ |
|
28 | +class EE_Hidden_Display_Strategy extends EE_Display_Strategy_Base { |
|
29 | 29 | /** |
30 | 30 | * |
31 | 31 | * @return string of html to display the HIDDEN field |
32 | 32 | */ |
33 | - function display(){ |
|
33 | + function display() { |
|
34 | 34 | $input = $this->_input; |
35 | 35 | return "<input type='hidden' id='{$input->html_id()}' name='{$input->html_name()}' class='{$input->html_class()}' style='{$input->html_style()}' value='{$input->raw_value_in_form()}' {$input->other_html_attributes()}/>"; |
36 | 36 | } |
@@ -1,7 +1,8 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if (!defined('EVENT_ESPRESSO_VERSION')) |
|
3 | +if (!defined('EVENT_ESPRESSO_VERSION')) { |
|
4 | 4 | exit('No direct script access allowed'); |
5 | +} |
|
5 | 6 | |
6 | 7 | /** |
7 | 8 | * Event Espresso |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | * @subpackage Expression package is undefined on line 19, column 19 in Templates/Scripting/PHPClass.php. |
11 | 11 | * @author Mike Nelson |
12 | 12 | */ |
13 | -class EE_Model_Matching_Query_Validation_Strategy extends EE_Validation_Strategy_Base{ |
|
13 | +class EE_Model_Matching_Query_Validation_Strategy extends EE_Validation_Strategy_Base { |
|
14 | 14 | |
15 | 15 | /** |
16 | 16 | * |
@@ -29,17 +29,17 @@ discard block |
||
29 | 29 | * @param string $input_field_name the input will be treated as this field's value |
30 | 30 | * @throws \EE_Error |
31 | 31 | */ |
32 | - public function __construct( $validation_error_message = NULL, $model_name = '', $query_params = array(), $input_field_name = '' ) { |
|
33 | - if( ! EE_Registry::instance()->is_model_name( $model_name ) ) { |
|
34 | - throw new EE_Error( sprintf( __( 'You must provide a valid model object ', 'event_espresso'), $model_name ) ); |
|
32 | + public function __construct($validation_error_message = NULL, $model_name = '', $query_params = array(), $input_field_name = '') { |
|
33 | + if ( ! EE_Registry::instance()->is_model_name($model_name)) { |
|
34 | + throw new EE_Error(sprintf(__('You must provide a valid model object ', 'event_espresso'), $model_name)); |
|
35 | 35 | } |
36 | - $this->_model = EE_Registry::instance()->load_model( $model_name ); |
|
36 | + $this->_model = EE_Registry::instance()->load_model($model_name); |
|
37 | 37 | $this->_query_params = $query_params; |
38 | - if( empty( $input_field_name ) ) { |
|
38 | + if (empty($input_field_name)) { |
|
39 | 39 | $input_field_name = $this->_model->primary_key_name(); |
40 | 40 | } |
41 | 41 | $this->_input_field_name = $input_field_name; |
42 | - parent::__construct( $validation_error_message ); |
|
42 | + parent::__construct($validation_error_message); |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | |
@@ -51,13 +51,13 @@ discard block |
||
51 | 51 | * @throws \EE_Validation_Error |
52 | 52 | */ |
53 | 53 | public function validate($normalized_value) { |
54 | - if( empty( $normalized_value ) ) { |
|
54 | + if (empty($normalized_value)) { |
|
55 | 55 | return true; |
56 | 56 | } |
57 | 57 | $combined_query_params = $this->get_query_params(); |
58 | - $combined_query_params[0][ $this->treat_input_as_field() ] = $normalized_value; |
|
59 | - if( ! $this->get_model()->exists( $combined_query_params ) ) { |
|
60 | - throw new EE_Validation_Error( $this->get_validation_error_message(), 'no_matching_model_object' ); |
|
58 | + $combined_query_params[0][$this->treat_input_as_field()] = $normalized_value; |
|
59 | + if ( ! $this->get_model()->exists($combined_query_params)) { |
|
60 | + throw new EE_Validation_Error($this->get_validation_error_message(), 'no_matching_model_object'); |
|
61 | 61 | } |
62 | 62 | } |
63 | 63 | |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | * @return array |
75 | 75 | */ |
76 | 76 | public function get_query_params() { |
77 | - return (array)$this->_query_params; |
|
77 | + return (array) $this->_query_params; |
|
78 | 78 | } |
79 | 79 | |
80 | 80 | /** |
@@ -1,5 +1,5 @@ discard block |
||
1 | -<?php if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
2 | - exit( 'No direct script access allowed' ); |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | 3 | } |
4 | 4 | |
5 | 5 | |
@@ -22,9 +22,9 @@ discard block |
||
22 | 22 | /** |
23 | 23 | * @param null $validation_error_message |
24 | 24 | */ |
25 | - public function __construct( $validation_error_message = null ) { |
|
25 | + public function __construct($validation_error_message = null) { |
|
26 | 26 | $this->_validation_error_message = $validation_error_message === null |
27 | - ? __( 'Input invalid', 'event_espresso' ) |
|
27 | + ? __('Input invalid', 'event_espresso') |
|
28 | 28 | : $validation_error_message; |
29 | 29 | parent::__construct(); |
30 | 30 | } |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | * this validation strategy is the 'required' validation strategy, |
42 | 42 | * most should be OK with a null, empty string, etc) |
43 | 43 | */ |
44 | - public function validate( $normalized_value ) { |
|
44 | + public function validate($normalized_value) { |
|
45 | 45 | //by default, the validation strategy does no validation. this should be implemented |
46 | 46 | } |
47 | 47 | |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | * @param array $other_js_data |
93 | 93 | * @return array |
94 | 94 | */ |
95 | - public function get_other_js_data( $other_js_data = array() ) { |
|
95 | + public function get_other_js_data($other_js_data = array()) { |
|
96 | 96 | return $other_js_data; |
97 | 97 | } |
98 | 98 |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | * |
25 | 25 | * ------------------------------------------------------------------------ |
26 | 26 | */ |
27 | -abstract class EE_Offsite_Gateway extends EE_Gateway{ |
|
27 | +abstract class EE_Offsite_Gateway extends EE_Gateway { |
|
28 | 28 | |
29 | 29 | /** |
30 | 30 | * whether or not the gateway uses an IPN |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | * @param string $cancel_url URL to send the user to after a cancelled payment attempt on teh payment provider's website |
62 | 62 | * @return EE_Payment |
63 | 63 | */ |
64 | - public abstract function set_redirection_info( $payment, $billing_info = array(), $return_url = NULL, $notify_url = NULL, $cancel_url = NULL); |
|
64 | + public abstract function set_redirection_info($payment, $billing_info = array(), $return_url = NULL, $notify_url = NULL, $cancel_url = NULL); |
|
65 | 65 | |
66 | 66 | |
67 | 67 | |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | * @param EEI_Transaction $transaction |
75 | 75 | * @return EEI_Payment updated |
76 | 76 | */ |
77 | - public abstract function handle_payment_update($update_info,$transaction); |
|
77 | + public abstract function handle_payment_update($update_info, $transaction); |
|
78 | 78 | |
79 | 79 | |
80 | 80 | |
@@ -101,8 +101,8 @@ discard block |
||
101 | 101 | * @access protected |
102 | 102 | * @param boolean $uses_separate_IPN_request |
103 | 103 | */ |
104 | - protected function set_uses_separate_IPN_request( $uses_separate_IPN_request ) { |
|
105 | - $this->_uses_separate_IPN_request = filter_var( $uses_separate_IPN_request, FILTER_VALIDATE_BOOLEAN ); |
|
104 | + protected function set_uses_separate_IPN_request($uses_separate_IPN_request) { |
|
105 | + $this->_uses_separate_IPN_request = filter_var($uses_separate_IPN_request, FILTER_VALIDATE_BOOLEAN); |
|
106 | 106 | } |
107 | 107 | |
108 | 108 | /** |
@@ -119,8 +119,8 @@ discard block |
||
119 | 119 | * @param boolean $separate_IPN_request |
120 | 120 | * @return boolean |
121 | 121 | */ |
122 | - public function handle_IPN_in_this_request( $request_data, $separate_IPN_request ) { |
|
123 | - if( $separate_IPN_request ) { |
|
122 | + public function handle_IPN_in_this_request($request_data, $separate_IPN_request) { |
|
123 | + if ($separate_IPN_request) { |
|
124 | 124 | // payment data being sent in a request separate from the user |
125 | 125 | // it is this other request that will update the TXN and payment info |
126 | 126 | return $this->_uses_separate_IPN_request; |
@@ -22,9 +22,9 @@ discard block |
||
22 | 22 | * @param null $timezone |
23 | 23 | * @return EE_Extra_Join|mixed |
24 | 24 | */ |
25 | - public static function new_instance( $props_n_values = array(), $timezone = NULL ) { |
|
26 | - $has_object = parent::_check_for_object( $props_n_values, __CLASS__, $timezone ); |
|
27 | - return $has_object ? $has_object : new self( $props_n_values, FALSE, $timezone ); |
|
25 | + public static function new_instance($props_n_values = array(), $timezone = NULL) { |
|
26 | + $has_object = parent::_check_for_object($props_n_values, __CLASS__, $timezone); |
|
27 | + return $has_object ? $has_object : new self($props_n_values, FALSE, $timezone); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | |
@@ -34,8 +34,8 @@ discard block |
||
34 | 34 | * @param null $timezone |
35 | 35 | * @return EE_Extra_Join |
36 | 36 | */ |
37 | - public static function new_instance_from_db ( $props_n_values = array(), $timezone = NULL ) { |
|
38 | - return new self( $props_n_values, TRUE, $timezone ); |
|
37 | + public static function new_instance_from_db($props_n_values = array(), $timezone = NULL) { |
|
38 | + return new self($props_n_values, TRUE, $timezone); |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | } |
@@ -1,4 +1,6 @@ |
||
1 | -<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed'); |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | +} |
|
2 | 4 | /** |
3 | 5 | * Contains definition for EE_Extra_Join model object |
4 | 6 | * @package Event Espresso |
@@ -1,5 +1,5 @@ discard block |
||
1 | -<?php if ( !defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
2 | - exit( 'No direct script access allowed' ); |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | 3 | } |
4 | 4 | /** |
5 | 5 | * Event Espresso |
@@ -30,9 +30,9 @@ discard block |
||
30 | 30 | * @param array $props_n_values |
31 | 31 | * @return EE_Country|mixed |
32 | 32 | */ |
33 | - public static function new_instance( $props_n_values = array() ) { |
|
34 | - $has_object = parent::_check_for_object( $props_n_values, __CLASS__ ); |
|
35 | - return $has_object ? $has_object : new self( $props_n_values ); |
|
33 | + public static function new_instance($props_n_values = array()) { |
|
34 | + $has_object = parent::_check_for_object($props_n_values, __CLASS__); |
|
35 | + return $has_object ? $has_object : new self($props_n_values); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | |
@@ -41,8 +41,8 @@ discard block |
||
41 | 41 | * @param array $props_n_values |
42 | 42 | * @return EE_Country |
43 | 43 | */ |
44 | - public static function new_instance_from_db( $props_n_values = array() ) { |
|
45 | - return new self( $props_n_values, TRUE ); |
|
44 | + public static function new_instance_from_db($props_n_values = array()) { |
|
45 | + return new self($props_n_values, TRUE); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | * @return string |
55 | 55 | */ |
56 | 56 | public function name() { |
57 | - return $this->get( 'CNT_name' ); |
|
57 | + return $this->get('CNT_name'); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | * @return string |
65 | 65 | */ |
66 | 66 | public function currency_code() { |
67 | - return $this->get( 'CNT_cur_code' ); |
|
67 | + return $this->get('CNT_cur_code'); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | * @return string |
75 | 75 | */ |
76 | 76 | public function currency_sign() { |
77 | - $CNT_cur_sign = $this->get( 'CNT_cur_sign' ); |
|
77 | + $CNT_cur_sign = $this->get('CNT_cur_sign'); |
|
78 | 78 | return $CNT_cur_sign ? $CNT_cur_sign : ''; |
79 | 79 | } |
80 | 80 | |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | * @return string |
86 | 86 | */ |
87 | 87 | public function currency_name_single() { |
88 | - return $this->get( 'CNT_cur_single' ); |
|
88 | + return $this->get('CNT_cur_single'); |
|
89 | 89 | } |
90 | 90 | |
91 | 91 | |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | * @return string |
96 | 96 | */ |
97 | 97 | public function currency_name_plural() { |
98 | - return $this->get( 'CNT_cur_plural' ); |
|
98 | + return $this->get('CNT_cur_plural'); |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | * @return boolean |
106 | 106 | */ |
107 | 107 | public function currency_sign_before() { |
108 | - return $this->get( 'CNT_cur_sign_b4' ); |
|
108 | + return $this->get('CNT_cur_sign_b4'); |
|
109 | 109 | } |
110 | 110 | |
111 | 111 | |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | * @return integer |
116 | 116 | */ |
117 | 117 | public function currency_decimal_places() { |
118 | - return $this->get( 'CNT_cur_dec_plc' ); |
|
118 | + return $this->get('CNT_cur_dec_plc'); |
|
119 | 119 | } |
120 | 120 | |
121 | 121 | |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | * @return string |
126 | 126 | */ |
127 | 127 | public function currency_decimal_mark() { |
128 | - return $this->get( 'CNT_cur_dec_mrk' ); |
|
128 | + return $this->get('CNT_cur_dec_mrk'); |
|
129 | 129 | } |
130 | 130 | |
131 | 131 | |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | * @return string |
136 | 136 | */ |
137 | 137 | public function currency_thousands_separator() { |
138 | - return $this->get( 'CNT_cur_thsnds' ); |
|
138 | + return $this->get('CNT_cur_thsnds'); |
|
139 | 139 | } |
140 | 140 | } |
141 | 141 | /* End of file EE_Country.class.php */ |
@@ -1,5 +1,5 @@ discard block |
||
1 | -<?php if (!defined('EVENT_ESPRESSO_VERSION')) {exit('No direct script access allowed');} |
|
2 | -do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {exit('No direct script access allowed'); } |
|
2 | +do_action('AHEE_log', __FILE__, __FUNCTION__, ''); |
|
3 | 3 | /** |
4 | 4 | * EE_Payment_Method class |
5 | 5 | * Should be parent of all payment method classes |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | * @subpackage includes/classes/EE_Checkin.class.php |
9 | 9 | * @author Mike Nelson |
10 | 10 | */ |
11 | -class EE_Payment_Method extends EE_Base_Class{ |
|
11 | +class EE_Payment_Method extends EE_Base_Class { |
|
12 | 12 | |
13 | 13 | /** |
14 | 14 | * Payment Method type object, which has all the info about this type of payment method, |
@@ -24,9 +24,9 @@ discard block |
||
24 | 24 | * @return EE_Payment_Method |
25 | 25 | * @throws \EE_Error |
26 | 26 | */ |
27 | - public static function new_instance( $props_n_values = array()) { |
|
28 | - $has_object = parent::_check_for_object( $props_n_values, __CLASS__ ); |
|
29 | - return $has_object ? $has_object : new self( $props_n_values, FALSE ); |
|
27 | + public static function new_instance($props_n_values = array()) { |
|
28 | + $has_object = parent::_check_for_object($props_n_values, __CLASS__); |
|
29 | + return $has_object ? $has_object : new self($props_n_values, FALSE); |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | |
@@ -36,8 +36,8 @@ discard block |
||
36 | 36 | * @return EE_Payment_Method |
37 | 37 | * @throws \EE_Error |
38 | 38 | */ |
39 | - public static function new_instance_from_db ( $props_n_values = array()) { |
|
40 | - return new self( $props_n_values, TRUE ); |
|
39 | + public static function new_instance_from_db($props_n_values = array()) { |
|
40 | + return new self($props_n_values, TRUE); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | * @return boolean |
67 | 67 | */ |
68 | 68 | public function active() { |
69 | - return array_intersect(array_keys(EEM_Payment_Method::instance()->scopes()),$this->scope()); |
|
69 | + return array_intersect(array_keys(EEM_Payment_Method::instance()->scopes()), $this->scope()); |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | |
@@ -77,10 +77,10 @@ discard block |
||
77 | 77 | * |
78 | 78 | * @throws \EE_Error |
79 | 79 | */ |
80 | - public function set_active(){ |
|
80 | + public function set_active() { |
|
81 | 81 | $default_scopes = array(EEM_Payment_Method::scope_cart); |
82 | - if($this->type_obj() && |
|
83 | - $this->type_obj()->payment_occurs() === EE_PMT_Base::offline){ |
|
82 | + if ($this->type_obj() && |
|
83 | + $this->type_obj()->payment_occurs() === EE_PMT_Base::offline) { |
|
84 | 84 | $default_scopes[] = EEM_Payment_Method::scope_admin; |
85 | 85 | } |
86 | 86 | $this->set_scope($default_scopes); |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | /** |
92 | 92 | * Makes this payment method apply to NO scopes at all. DOES NOT SAVE it. |
93 | 93 | */ |
94 | - public function deactivate(){ |
|
94 | + public function deactivate() { |
|
95 | 95 | $this->set_scope(array()); |
96 | 96 | } |
97 | 97 | |
@@ -282,8 +282,8 @@ discard block |
||
282 | 282 | * @param mixed $field_value |
283 | 283 | * @param boolean $use_default |
284 | 284 | */ |
285 | - public function set( $field_name, $field_value, $use_default = FALSE ){ |
|
286 | - if( $field_name === 'PMD_type' ){ |
|
285 | + public function set($field_name, $field_value, $use_default = FALSE) { |
|
286 | + if ($field_name === 'PMD_type') { |
|
287 | 287 | //the type has probably changed, so forget about its old type object |
288 | 288 | $this->_type_obj = NULL; |
289 | 289 | } |
@@ -357,26 +357,26 @@ discard block |
||
357 | 357 | * @return EE_PMT_Base |
358 | 358 | * @throws EE_Error |
359 | 359 | */ |
360 | - public function type_obj(){ |
|
361 | - if( ! $this->_type_obj ) { |
|
362 | - EE_Registry::instance()->load_lib( 'Payment_Method_Manager' ); |
|
363 | - if ( EE_Payment_Method_Manager::instance()->payment_method_type_exists( $this->type() )) { |
|
364 | - $class_name = EE_Payment_Method_Manager::instance()->payment_method_class_from_type( $this->type() ); |
|
365 | - if ( ! class_exists( $class_name )) { |
|
360 | + public function type_obj() { |
|
361 | + if ( ! $this->_type_obj) { |
|
362 | + EE_Registry::instance()->load_lib('Payment_Method_Manager'); |
|
363 | + if (EE_Payment_Method_Manager::instance()->payment_method_type_exists($this->type())) { |
|
364 | + $class_name = EE_Payment_Method_Manager::instance()->payment_method_class_from_type($this->type()); |
|
365 | + if ( ! class_exists($class_name)) { |
|
366 | 366 | throw new EE_Error( |
367 | 367 | sprintf( |
368 | - __( 'An attempt to use the "%1$s" payment method failed, so it was deactivated.%2$sWas the "%1$s" Plugin recently deactivated? It can be reactivated on the %3$sPlugins Admin Page%4$s', 'event_espresso' ), |
|
368 | + __('An attempt to use the "%1$s" payment method failed, so it was deactivated.%2$sWas the "%1$s" Plugin recently deactivated? It can be reactivated on the %3$sPlugins Admin Page%4$s', 'event_espresso'), |
|
369 | 369 | $class_name, |
370 | 370 | '<br />', |
371 | - '<a href="' . admin_url('plugins.php') . '">', |
|
371 | + '<a href="'.admin_url('plugins.php').'">', |
|
372 | 372 | '</a>' |
373 | 373 | ) |
374 | 374 | ); |
375 | 375 | } |
376 | - $r = new ReflectionClass( $class_name ); |
|
377 | - $this->_type_obj = $r->newInstanceArgs( array( $this )); |
|
376 | + $r = new ReflectionClass($class_name); |
|
377 | + $this->_type_obj = $r->newInstanceArgs(array($this)); |
|
378 | 378 | } else { |
379 | - throw new EE_Error( sprintf( __( 'A payment method of type "%1$s" does not exist. Only ones existing are: %2$s', 'event_espresso' ), $this->type(), implode(',', EE_Payment_Method_Manager::instance()->payment_method_type_names() ) ) ); |
|
379 | + throw new EE_Error(sprintf(__('A payment method of type "%1$s" does not exist. Only ones existing are: %2$s', 'event_espresso'), $this->type(), implode(',', EE_Payment_Method_Manager::instance()->payment_method_type_names()))); |
|
380 | 380 | } |
381 | 381 | } |
382 | 382 | return $this->_type_obj; |
@@ -389,18 +389,18 @@ discard block |
||
389 | 389 | * and the extra meta. Mostly used for passing off ot gateways. * |
390 | 390 | * @return array |
391 | 391 | */ |
392 | - public function settings_array(){ |
|
392 | + public function settings_array() { |
|
393 | 393 | $fields = $this->model_field_array(); |
394 | 394 | $extra_meta = $this->all_extra_meta_array(); |
395 | 395 | //remove the model's prefix from the fields |
396 | 396 | $combined_settings_array = array(); |
397 | - foreach($fields as $key => $value){ |
|
398 | - if(strpos($key, 'PMD_')===0){ |
|
397 | + foreach ($fields as $key => $value) { |
|
398 | + if (strpos($key, 'PMD_') === 0) { |
|
399 | 399 | $key_sans_model_prefix = str_replace('PMD_', '', $key); |
400 | 400 | $combined_settings_array [$key_sans_model_prefix] = $value; |
401 | 401 | } |
402 | 402 | } |
403 | - $combined_settings_array = array_merge( $extra_meta,$combined_settings_array ); |
|
403 | + $combined_settings_array = array_merge($extra_meta, $combined_settings_array); |
|
404 | 404 | return $combined_settings_array; |
405 | 405 | } |
406 | 406 | |
@@ -414,12 +414,12 @@ discard block |
||
414 | 414 | * @return string of HTML for displaying the button |
415 | 415 | * @throws \EE_Error |
416 | 416 | */ |
417 | - public function button_html( $url = '', $css_class = '' ){ |
|
417 | + public function button_html($url = '', $css_class = '') { |
|
418 | 418 | $payment_occurs = $this->type_obj()->payment_occurs(); |
419 | 419 | return ' |
420 | - <div id="' . $this->slug() . '-payment-option-dv" class="'. $payment_occurs .'-payment-gateway reg-page-payment-option-dv' . $css_class . '"> |
|
421 | - <a id="payment-gateway-button-' . $this->slug() . '" class="reg-page-payment-option-lnk" rel="' . $this->slug() . '" href="' . $url . '" > |
|
422 | - <img src="' . $this->button_url() . '" alt="' . sprintf( esc_attr__( 'Pay using %s', 'event_espresso' ), $this->get_pretty('PMD_name','form_input') ) . '" /> |
|
420 | + <div id="' . $this->slug().'-payment-option-dv" class="'.$payment_occurs.'-payment-gateway reg-page-payment-option-dv'.$css_class.'"> |
|
421 | + <a id="payment-gateway-button-' . $this->slug().'" class="reg-page-payment-option-lnk" rel="'.$this->slug().'" href="'.$url.'" > |
|
422 | + <img src="' . $this->button_url().'" alt="'.sprintf(esc_attr__('Pay using %s', 'event_espresso'), $this->get_pretty('PMD_name', 'form_input')).'" /> |
|
423 | 423 | </a> |
424 | 424 | </div> |
425 | 425 | '; |
@@ -434,7 +434,7 @@ discard block |
||
434 | 434 | * @return EE_Currency[] |
435 | 435 | * @throws \EE_Error |
436 | 436 | */ |
437 | - public function get_all_usable_currencies(){ |
|
437 | + public function get_all_usable_currencies() { |
|
438 | 438 | return EEM_Currency::instance()->get_all_currencies_usable_by($this->type_obj()); |
439 | 439 | } |
440 | 440 | |
@@ -447,9 +447,9 @@ discard block |
||
447 | 447 | * @return boolean |
448 | 448 | * @throws \EE_Error |
449 | 449 | */ |
450 | - public function usable_for_currency( $currency_code ) { |
|
451 | - foreach( $this->get_all_usable_currencies() as $currency_obj ) { |
|
452 | - if( $currency_obj->ID() === $currency_code ){ |
|
450 | + public function usable_for_currency($currency_code) { |
|
451 | + foreach ($this->get_all_usable_currencies() as $currency_obj) { |
|
452 | + if ($currency_obj->ID() === $currency_code) { |
|
453 | 453 | return TRUE; |
454 | 454 | } |
455 | 455 | } |
@@ -464,7 +464,7 @@ discard block |
||
464 | 464 | * @return bool |
465 | 465 | * @throws \EE_Error |
466 | 466 | */ |
467 | - public function is_on_site(){ |
|
467 | + public function is_on_site() { |
|
468 | 468 | return $this->type_obj()->payment_occurs() === EE_PMT_Base::onsite; |
469 | 469 | } |
470 | 470 | |
@@ -476,7 +476,7 @@ discard block |
||
476 | 476 | * @return bool |
477 | 477 | * @throws \EE_Error |
478 | 478 | */ |
479 | - public function is_off_site(){ |
|
479 | + public function is_off_site() { |
|
480 | 480 | return $this->type_obj()->payment_occurs() === EE_PMT_Base::offsite; |
481 | 481 | } |
482 | 482 | |
@@ -488,7 +488,7 @@ discard block |
||
488 | 488 | * @return bool |
489 | 489 | * @throws \EE_Error |
490 | 490 | */ |
491 | - public function is_off_line(){ |
|
491 | + public function is_off_line() { |
|
492 | 492 | return $this->type_obj()->payment_occurs() === EE_PMT_Base::offline; |
493 | 493 | } |
494 | 494 | |
@@ -498,10 +498,10 @@ discard block |
||
498 | 498 | * to load the required classes, and don't need them at the time of unserialization |
499 | 499 | * @return array |
500 | 500 | */ |
501 | - public function __sleep(){ |
|
502 | - $properties = get_object_vars( $this ); |
|
503 | - unset( $properties[ '_type_obj' ] ); |
|
504 | - return array_keys( $properties ); |
|
501 | + public function __sleep() { |
|
502 | + $properties = get_object_vars($this); |
|
503 | + unset($properties['_type_obj']); |
|
504 | + return array_keys($properties); |
|
505 | 505 | } |
506 | 506 | |
507 | 507 | |
@@ -513,17 +513,17 @@ discard block |
||
513 | 513 | * @return int @see EE_Base_Class::save() |
514 | 514 | * @throws \EE_Error |
515 | 515 | */ |
516 | - public function save( $set_cols_n_values = array() ) { |
|
517 | - $results = parent::save( $set_cols_n_values ); |
|
518 | - if( $this->get_original( 'PMD_scope' ) !== $this->get( 'PMD_scope' ) ) { |
|
516 | + public function save($set_cols_n_values = array()) { |
|
517 | + $results = parent::save($set_cols_n_values); |
|
518 | + if ($this->get_original('PMD_scope') !== $this->get('PMD_scope')) { |
|
519 | 519 | EE_Log::instance()->log( |
520 | 520 | __FILE__, |
521 | 521 | __FUNCTION__, |
522 | 522 | sprintf( |
523 | - __( 'Set new scope on payment method %1$s to %2$s from %3$s on URL %4$s', 'event_espresso' ), |
|
523 | + __('Set new scope on payment method %1$s to %2$s from %3$s on URL %4$s', 'event_espresso'), |
|
524 | 524 | $this->name(), |
525 | - serialize( $this->get_original( 'PMD_scope' ) ), |
|
526 | - serialize( $this->get( 'PMD_scope' ) ), |
|
525 | + serialize($this->get_original('PMD_scope')), |
|
526 | + serialize($this->get('PMD_scope')), |
|
527 | 527 | EE_Registry::instance()->REQ->get_current_page_permalink() |
528 | 528 | ), |
529 | 529 | 'payment_method_change' |
@@ -32,8 +32,8 @@ |
||
32 | 32 | "price": "<?php echo $ticket['price']; ?>", |
33 | 33 | "priceCurrency": "<?php echo $currency; ?>" |
34 | 34 | }<?php if (is_array($event_tickets) && end($event_tickets) !== $ticket) { echo ','; } |
35 | - } |
|
36 | - ?> |
|
35 | + } |
|
36 | + ?> |
|
37 | 37 | ]<?php if ($venue_name) { ?>, |
38 | 38 | "location": { |
39 | 39 | "@type": "Place", |