Completed
Branch old/BUG-7514-7935-7936-price-o... (518ae6)
by
unknown
11:51 queued 09:31
created
messages/validators/html/EE_Messages_Html_Invoice_Validator.class.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
  * @package Event Espresso
7 7
  * @subpackage messages
8 8
  */
9
-if (!defined('EVENT_ESPRESSO_VERSION') )
9
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
10 10
 	exit('NO direct script access allowed');
11 11
 
12 12
 /**
@@ -24,11 +24,11 @@  discard block
 block discarded – undo
24 24
  */
25 25
 class EE_Messages_Html_Invoice_Validator extends EE_Messages_Validator {
26 26
 
27
-	public function __construct( $fields, $context ) {
27
+	public function __construct($fields, $context) {
28 28
 		$this->_m_name = 'html';
29 29
 		$this->_mt_name = 'invoice';
30 30
 
31
-		parent::__construct( $fields, $context );
31
+		parent::__construct($fields, $context);
32 32
 	}
33 33
 
34 34
 	/**
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,8 +6,9 @@
 block discarded – undo
6 6
  * @package Event Espresso
7 7
  * @subpackage messages
8 8
  */
9
-if (!defined('EVENT_ESPRESSO_VERSION') )
9
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
10 10
 	exit('NO direct script access allowed');
11
+}
11 12
 
12 13
 /**
13 14
  *
Please login to merge, or discard this patch.
messages/validators/html/EE_Messages_Html_Receipt_Validator.class.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
  * @package Event Espresso
7 7
  * @subpackage messages
8 8
  */
9
-if (!defined('EVENT_ESPRESSO_VERSION') )
9
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
10 10
 	exit('NO direct script access allowed');
11 11
 
12 12
 /**
@@ -24,11 +24,11 @@  discard block
 block discarded – undo
24 24
  */
25 25
 class EE_Messages_Html_Receipt_Validator extends EE_Messages_Validator {
26 26
 
27
-	public function __construct( $fields, $context ) {
27
+	public function __construct($fields, $context) {
28 28
 		$this->_m_name = 'html';
29 29
 		$this->_mt_name = 'receipt';
30 30
 
31
-		parent::__construct( $fields, $context );
31
+		parent::__construct($fields, $context);
32 32
 	}
33 33
 
34 34
 	/**
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,8 +6,9 @@
 block discarded – undo
6 6
  * @package Event Espresso
7 7
  * @subpackage messages
8 8
  */
9
-if (!defined('EVENT_ESPRESSO_VERSION') )
9
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
10 10
 	exit('NO direct script access allowed');
11
+}
11 12
 
12 13
 /**
13 14
  *
Please login to merge, or discard this patch.
core/libraries/payment_methods/EEI_Payment_Method_Interfaces.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@  discard block
 block discarded – undo
5 5
  *
6 6
  * allows gateways to be used by different systems other than Event Espresso
7 7
  */
8
-interface EEI_Payment extends EEI_Base{
8
+interface EEI_Payment extends EEI_Base {
9 9
 
10 10
 	/**
11 11
 	 * @return string indicating which the payment is approved, pending, cancelled or failed
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
 /**
153 153
  * Interface EEI_Payment_Method
154 154
  */
155
-interface EEI_Payment_Method{
155
+interface EEI_Payment_Method {
156 156
 
157 157
 }
158 158
 
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
 	 * @param string $model_name
172 172
 	 * @return EE_Log
173 173
 	 */
174
-	function gateway_log($message,$id,$model_name);
174
+	function gateway_log($message, $id, $model_name);
175 175
 }
176 176
 
177 177
 
Please login to merge, or discard this patch.
core/libraries/payment_methods/EE_Gateway.lib.php 2 patches
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -214,7 +214,7 @@
 block discarded – undo
214 214
 		if($payment instanceof EEI_Payment){
215 215
 			$type='Payment';
216 216
 			$id = $payment->ID();
217
-		}else{
217
+		} else{
218 218
 			$type = 'Payment_Method';
219 219
 			$id = $this->_ID;
220 220
 		}
Please login to merge, or discard this patch.
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
  * needed helpers and models (see all the methods starting with "set_", eg seg_line_item_helper which should be passed an object
31 31
  * which implements EEHI_Line_Item_Helper; etc).
32 32
  */
33
-abstract class EE_Gateway{
33
+abstract class EE_Gateway {
34 34
 	/**
35 35
 	 * a constant used as a possible value for $_currencies_supported to indicate
36 36
 	 * that ALL currencies are supported by this gateway
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
 	/**
109 109
 	 * @return EE_Gateway
110 110
 	 */
111
-	public function __construct(){
111
+	public function __construct() {
112 112
 	}
113 113
 
114 114
 	/**
@@ -120,10 +120,10 @@  discard block
 block discarded – undo
120 120
 	 * beginning again)
121 121
 	 * @return array
122 122
 	 */
123
-	public function __sleep(){
123
+	public function __sleep() {
124 124
 		$properties = get_object_vars($this);
125
-		unset( $properties[ '_pay_model' ] );
126
-		unset( $properties[ '_pay_log' ] );
125
+		unset($properties['_pay_model']);
126
+		unset($properties['_pay_log']);
127 127
 		return array_keys($properties);
128 128
 	}
129 129
 	/**
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
 	 * see $_supports_sending_refunds
132 132
 	 * @return boolean
133 133
 	 */
134
-	public function supports_sending_refunds(){
134
+	public function supports_sending_refunds() {
135 135
 		return $this->_supports_sending_refunds;
136 136
 	}
137 137
 	/**
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 	 * see $_supports_receiving_refunds
140 140
 	 * @return boolean
141 141
 	 */
142
-	public function supports_receiving_refunds(){
142
+	public function supports_receiving_refunds() {
143 143
 		return $this->_supports_receiving_refunds;
144 144
 	}
145 145
 
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
 	 * @return EE_Payment for the refund
153 153
 	 * @throws EE_Error
154 154
 	 */
155
-	public function do_direct_refund($payment,$refund_info = null){
155
+	public function do_direct_refund($payment, $refund_info = null) {
156 156
 		return NULL;
157 157
 	}
158 158
 	/**
@@ -160,8 +160,8 @@  discard block
 block discarded – undo
160 160
 	 * etc
161 161
 	 * @param array $settings_array
162 162
 	 */
163
-	public function set_settings($settings_array){
164
-		foreach($settings_array as $name => $value){
163
+	public function set_settings($settings_array) {
164
+		foreach ($settings_array as $name => $value) {
165 165
 			$property_name = "_".$name;
166 166
 			$this->$property_name = $value;
167 167
 		}
@@ -170,14 +170,14 @@  discard block
 block discarded – undo
170 170
 	 * See this class description
171 171
 	 * @param EEMI_Payment $payment_model
172 172
 	 */
173
-	public function set_payment_model($payment_model){
173
+	public function set_payment_model($payment_model) {
174 174
 		$this->_pay_model = $payment_model;
175 175
 	}
176 176
 	/**
177 177
 	 * See this class description
178 178
 	 * @param EEMI_Payment_Log $payment_log_model
179 179
 	 */
180
-	public function set_payment_log($payment_log_model){
180
+	public function set_payment_log($payment_log_model) {
181 181
 		$this->_pay_log = $payment_log_model;
182 182
 	}
183 183
 
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
 	 * See this class description
186 186
 	 * @param EEHI_Template $template_helper
187 187
 	 */
188
-	public function set_template_helper($template_helper){
188
+	public function set_template_helper($template_helper) {
189 189
 		$this->_template = $template_helper;
190 190
 	}
191 191
 
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
 	 * See this class description
194 194
 	 * @param EEHI_Line_Item $line_item_helper
195 195
 	 */
196
-	public function set_line_item_helper( $line_item_helper ){
196
+	public function set_line_item_helper($line_item_helper) {
197 197
 		$this->_line_item = $line_item_helper;
198 198
 	}
199 199
 
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
 	 * See this class description
202 202
 	 * @param EEHI_Money $money_helper
203 203
 	 */
204
-	public function set_money_helper( $money_helper ){
204
+	public function set_money_helper($money_helper) {
205 205
 		$this->_money = $money_helper;
206 206
 	}
207 207
 
@@ -210,23 +210,23 @@  discard block
 block discarded – undo
210 210
 	 * @param $message
211 211
 	 * @param $payment
212 212
 	 */
213
-	public function log($message,$payment){
214
-		if($payment instanceof EEI_Payment){
215
-			$type='Payment';
213
+	public function log($message, $payment) {
214
+		if ($payment instanceof EEI_Payment) {
215
+			$type = 'Payment';
216 216
 			$id = $payment->ID();
217
-		}else{
217
+		} else {
218 218
 			$type = 'Payment_Method';
219 219
 			$id = $this->_ID;
220 220
 		}
221
-		$this->_pay_log->gateway_log($message,$id,$type);
221
+		$this->_pay_log->gateway_log($message, $id, $type);
222 222
 	}
223 223
 	/**
224 224
 	 * Formats the amount so it can generally be sent to gateways
225 225
 	 * @param float $amount
226 226
 	 * @return string
227 227
 	 */
228
-	public function format_currency($amount){
229
-		return number_format( $amount, 2, '.', '' );
228
+	public function format_currency($amount) {
229
+		return number_format($amount, 2, '.', '');
230 230
 //		return $this->_template->format_currency($amount, true);
231 231
 	}
232 232
 
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
 	 * or a string indicating they're all supported (EE_gateway::all_currencies_supported)
236 236
 	 * @return mixed array or string
237 237
 	 */
238
-	public function currencies_supported(){
238
+	public function currencies_supported() {
239 239
 		return $this->_currencies_supported;
240 240
 	}
241 241
 
@@ -247,14 +247,14 @@  discard block
 block discarded – undo
247 247
 	 * @param EE_Transaction  $transaction
248 248
 	 * @return float
249 249
 	 */
250
-	protected function _sum_items_and_taxes( EE_Transaction  $transaction){
250
+	protected function _sum_items_and_taxes(EE_Transaction  $transaction) {
251 251
 		$total_line_item = $transaction->total_line_item();
252 252
 		$total = 0;
253
-		foreach($total_line_item->get_items() as $item_line_item ){
254
-			$total += max( $item_line_item->total(), 0 );
253
+		foreach ($total_line_item->get_items() as $item_line_item) {
254
+			$total += max($item_line_item->total(), 0);
255 255
 		}
256
-		foreach($total_line_item->tax_descendants() as $tax_line_item ){
257
-			$total += max( $tax_line_item->total(), 0 );
256
+		foreach ($total_line_item->tax_descendants() as $tax_line_item) {
257
+			$total += max($tax_line_item->total(), 0);
258 258
 		}
259 259
 		return $total;
260 260
 	}
@@ -265,9 +265,9 @@  discard block
 block discarded – undo
265 265
 	 * @param EEI_Payment $payment
266 266
 	 * @return boolean
267 267
 	 */
268
-	protected function _can_easily_itemize_transaction_for( EEI_Payment $payment ){
268
+	protected function _can_easily_itemize_transaction_for(EEI_Payment $payment) {
269 269
 		return  $this->_money->compare_floats(
270
-					$this->_sum_items_and_taxes( $payment->transaction() ),
270
+					$this->_sum_items_and_taxes($payment->transaction()),
271 271
 					$payment->transaction()->total() ) &&
272 272
 				$this->_money->compare_floats(
273 273
 					$payment->amount(),
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
 	 * @param EE_Payment $payment
286 286
 	 * @return void
287 287
 	 */
288
-	public function update_txn_based_on_payment( $payment ){
288
+	public function update_txn_based_on_payment($payment) {
289 289
 		//maybe update the trasnaction or line items or registrations
290 290
 		//but most gateways don't need to do this, because they only update the payment
291 291
 	}
Please login to merge, or discard this patch.
core/libraries/payment_methods/EE_Offsite_Gateway.lib.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
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
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 	 * @param string     $cancel_url URL to send the user to after a cancelled payment attempt on teh payment provider's website
57 57
 	 * @return EE_Payment
58 58
 	 */
59
-	public abstract function set_redirection_info( $payment, $billing_info = array(), $return_url = NULL, $notify_url = NULL, $cancel_url = NULL);
59
+	public abstract function set_redirection_info($payment, $billing_info = array(), $return_url = NULL, $notify_url = NULL, $cancel_url = NULL);
60 60
 
61 61
 
62 62
 
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 	 * @param EEI_Transaction $transaction
69 69
 	 * @return EEI_Payment updated
70 70
 	 */
71
-	public abstract function handle_payment_update($update_info,$transaction);
71
+	public abstract function handle_payment_update($update_info, $transaction);
72 72
 
73 73
 
74 74
 
@@ -94,8 +94,8 @@  discard block
 block discarded – undo
94 94
 	 * @access protected
95 95
 	 * @param boolean $uses_separate_IPN_request
96 96
 	 */
97
-	protected function set_uses_separate_IPN_request( $uses_separate_IPN_request ) {
98
-		$this->_uses_separate_IPN_request = filter_var( $uses_separate_IPN_request, FILTER_VALIDATE_BOOLEAN );
97
+	protected function set_uses_separate_IPN_request($uses_separate_IPN_request) {
98
+		$this->_uses_separate_IPN_request = filter_var($uses_separate_IPN_request, FILTER_VALIDATE_BOOLEAN);
99 99
 	}
100 100
 
101 101
 
Please login to merge, or discard this patch.
core/libraries/payment_methods/EE_Onsite_Gateway.lib.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
  *
25 25
  * ------------------------------------------------------------------------
26 26
  */
27
-abstract class EE_Onsite_Gateway extends EE_Gateway{
27
+abstract class EE_Onsite_Gateway extends EE_Gateway {
28 28
 
29 29
 	/**
30 30
 	 * @return EE_Onsite_Gateway
@@ -53,5 +53,5 @@  discard block
 block discarded – undo
53 53
 	 * } unless a child class specifies these array keys are NOT present
54 54
 	 * @return EE_Payment updated
55 55
 	 */
56
-	public abstract function do_direct_payment($payment,$billing_info = null);
56
+	public abstract function do_direct_payment($payment, $billing_info = null);
57 57
 }
Please login to merge, or discard this patch.
core/libraries/payment_methods/EE_Payment_Method_Manager.lib.php 2 patches
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@  discard block
 block discarded – undo
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
  *
4 6
  * Class EE_Payment_Method_Manager
@@ -139,7 +141,7 @@  discard block
 block discarded – undo
139 141
 		if(isset($this->_payment_method_types[$payment_method_name])){
140 142
 			require_once($this->_payment_method_types[$payment_method_name]);
141 143
 			return true;
142
-		}else{
144
+		} else{
143 145
 			return false;
144 146
 		}
145 147
 	}
@@ -159,7 +161,7 @@  discard block
 block discarded – undo
159 161
 				$payment_methods[] = $this->payment_method_class_from_type($classname);
160 162
 			}
161 163
 			return $payment_methods;
162
-		}else{
164
+		} else{
163 165
 			return array_keys($this->_payment_method_types);
164 166
 		}
165 167
 	}
@@ -242,7 +244,7 @@  discard block
 block discarded – undo
242 244
 				}
243 245
 			}
244 246
 
245
-		}else{
247
+		} else{
246 248
 			$payment_method->set_active();
247 249
 			$payment_method->save();
248 250
 		}
Please login to merge, or discard this patch.
Spacing   +64 added lines, -64 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 	 */
31 31
 	public static function instance() {
32 32
 		// check if class object is instantiated, and instantiated properly
33
-		if ( self::$_instance === NULL  or ! is_object( self::$_instance ) or ! ( self::$_instance instanceof EE_Payment_Method_Manager )) {
33
+		if (self::$_instance === NULL or ! is_object(self::$_instance) or ! (self::$_instance instanceof EE_Payment_Method_Manager)) {
34 34
 			self::$_instance = new self();
35 35
 		}
36 36
 		EE_Registry::instance()->load_lib('PMT_Base');
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 	 * Resets the instance and returns a new one
42 42
 	 * @return EE_Payment_Method_Manager
43 43
 	 */
44
-	public static function reset(){
44
+	public static function reset() {
45 45
 		self::$_instance = NULL;
46 46
 		return self::instance();
47 47
 	}
@@ -52,12 +52,12 @@  discard block
 block discarded – undo
52 52
 	 * or just re-use the PMTs we found last time we checked during this request (if
53 53
 	 * we have not yet checked during this request, then we need to check anyways)
54 54
 	 */
55
-	public function maybe_register_payment_methods( $force_recheck = FALSE ){
56
-		if( ! $this->_payment_method_types || $force_recheck ){
55
+	public function maybe_register_payment_methods($force_recheck = FALSE) {
56
+		if ( ! $this->_payment_method_types || $force_recheck) {
57 57
 			$this->_register_payment_methods();
58 58
 			//if in admin lets ensure caps are set.
59
-			if ( is_admin() ) {
60
-				add_filter( 'FHEE__EE_Capabilities__init_caps_map__caps', array( $this, 'add_payment_method_caps' ) );
59
+			if (is_admin()) {
60
+				add_filter('FHEE__EE_Capabilities__init_caps_map__caps', array($this, 'add_payment_method_caps'));
61 61
 				EE_Registry::instance()->CAP->init_caps();
62 62
 			}
63 63
 		}
@@ -70,19 +70,19 @@  discard block
 block discarded – undo
70 70
 	 */
71 71
 	protected function _register_payment_methods() {
72 72
 		// grab list of installed modules
73
-		$pm_to_register = glob( EE_PAYMENT_METHODS . '*', GLOB_ONLYDIR );
73
+		$pm_to_register = glob(EE_PAYMENT_METHODS.'*', GLOB_ONLYDIR);
74 74
 		// filter list of modules to register
75
-		$pm_to_register = apply_filters( 'FHEE__EE_Payment_Method_Manager__register_payment_methods__payment_methods_to_register', $pm_to_register );
75
+		$pm_to_register = apply_filters('FHEE__EE_Payment_Method_Manager__register_payment_methods__payment_methods_to_register', $pm_to_register);
76 76
 
77 77
 		// loop through folders
78
-		foreach ( $pm_to_register as $pm_path ) {
79
-				$this->register_payment_method( $pm_path );
78
+		foreach ($pm_to_register as $pm_path) {
79
+				$this->register_payment_method($pm_path);
80 80
 		}
81
-		do_action( 'FHEE__EE_Payment_Method_Manager__register_payment_methods__registered_payment_methods' );
81
+		do_action('FHEE__EE_Payment_Method_Manager__register_payment_methods__registered_payment_methods');
82 82
 		// filter list of installed modules
83 83
 		//keep them organized alphabetically by the payment method type's name
84
-		ksort( $this->_payment_method_types );
85
-		return apply_filters( 'FHEE__EE_Payment_Method_Manager__register_payment_methods__installed_payment_methods', $this->_payment_method_types );
84
+		ksort($this->_payment_method_types);
85
+		return apply_filters('FHEE__EE_Payment_Method_Manager__register_payment_methods__installed_payment_methods', $this->_payment_method_types);
86 86
 	}
87 87
 
88 88
 
@@ -94,35 +94,35 @@  discard block
 block discarded – undo
94 94
 	 * @param string $payment_method_path - full path up to and including payment method folder
95 95
 	 * @return boolean
96 96
 	 */
97
-	public function register_payment_method( $payment_method_path = '' ) {
98
-		do_action( 'AHEE__EE_Payment_Method_Manager__register_payment_method__begin',$payment_method_path );
97
+	public function register_payment_method($payment_method_path = '') {
98
+		do_action('AHEE__EE_Payment_Method_Manager__register_payment_method__begin', $payment_method_path);
99 99
 		$module_ext = '.pm.php';
100 100
 		// make all separators match
101
-		$payment_method_path = rtrim( str_replace( '/\\', DS, $payment_method_path ), DS );
101
+		$payment_method_path = rtrim(str_replace('/\\', DS, $payment_method_path), DS);
102 102
 		// grab and sanitize module name
103
-		$module_dir = basename( $payment_method_path );
103
+		$module_dir = basename($payment_method_path);
104 104
 		// create classname from module directory name
105
-		$module = str_replace( ' ', '_', str_replace( '_', ' ', $module_dir ));
105
+		$module = str_replace(' ', '_', str_replace('_', ' ', $module_dir));
106 106
 		// add class prefix
107
-		$module_class = 'EE_PMT_' . $module;
107
+		$module_class = 'EE_PMT_'.$module;
108 108
 		// does the module exist ?
109
-		if ( ! is_readable( $payment_method_path . DS . $module_class . $module_ext )) {
110
-			$msg = sprintf( __( 'The requested %s payment method file could not be found or is not readable due to file permissions.', 'event_espresso' ), $module );
111
-			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
109
+		if ( ! is_readable($payment_method_path.DS.$module_class.$module_ext)) {
110
+			$msg = sprintf(__('The requested %s payment method file could not be found or is not readable due to file permissions.', 'event_espresso'), $module);
111
+			EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
112 112
 			return FALSE;
113 113
 		}
114
-		if ( WP_DEBUG === TRUE ) { EEH_Debug_Tools::instance()->start_timer(); }
114
+		if (WP_DEBUG === TRUE) { EEH_Debug_Tools::instance()->start_timer(); }
115 115
 		// load the module class file
116
-		require_once( $payment_method_path . DS . $module_class . $module_ext );
117
-		if ( WP_DEBUG === TRUE ) { EEH_Debug_Tools::instance()->stop_timer("Requiring payment method $module_class"); }
116
+		require_once($payment_method_path.DS.$module_class.$module_ext);
117
+		if (WP_DEBUG === TRUE) { EEH_Debug_Tools::instance()->stop_timer("Requiring payment method $module_class"); }
118 118
 		// verify that class exists
119
-		if ( ! class_exists( $module_class )) {
120
-			$msg = sprintf( __( 'The requested %s module class does not exist.', 'event_espresso' ), $module_class );
121
-			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
119
+		if ( ! class_exists($module_class)) {
120
+			$msg = sprintf(__('The requested %s module class does not exist.', 'event_espresso'), $module_class);
121
+			EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
122 122
 			return FALSE;
123 123
 		}
124 124
 		// add to array of registered modules
125
-		$this->_payment_method_types[ $module ] = $payment_method_path . DS . $module_class . $module_ext;
125
+		$this->_payment_method_types[$module] = $payment_method_path.DS.$module_class.$module_ext;
126 126
 		return TRUE;
127 127
 	}
128 128
 	/**
@@ -131,15 +131,15 @@  discard block
 block discarded – undo
131 131
 	 * @param boolean $force_recheck whether to force re-checking for new payment method types
132 132
 	 * @return boolean
133 133
 	 */
134
-	public function payment_method_type_exists($payment_method_name, $force_recheck = FALSE){
135
-		if ( ! is_array( $this->_payment_method_types ) || ! isset( $this->_payment_method_types[$payment_method_name] )
136
-				|| $force_recheck ) {
134
+	public function payment_method_type_exists($payment_method_name, $force_recheck = FALSE) {
135
+		if ( ! is_array($this->_payment_method_types) || ! isset($this->_payment_method_types[$payment_method_name])
136
+				|| $force_recheck) {
137 137
 			$this->maybe_register_payment_methods($force_recheck);
138 138
 		}
139
-		if(isset($this->_payment_method_types[$payment_method_name])){
139
+		if (isset($this->_payment_method_types[$payment_method_name])) {
140 140
 			require_once($this->_payment_method_types[$payment_method_name]);
141 141
 			return true;
142
-		}else{
142
+		} else {
143 143
 			return false;
144 144
 		}
145 145
 	}
@@ -150,16 +150,16 @@  discard block
 block discarded – undo
150 150
 	 * @param boolean $force_recheck whether to force re-checking for new payment method types
151 151
 	 * @return array
152 152
 	 */
153
-	public function payment_method_type_names($with_prefixes = FALSE, $force_recheck = FALSE ){
153
+	public function payment_method_type_names($with_prefixes = FALSE, $force_recheck = FALSE) {
154 154
 		$this->maybe_register_payment_methods($force_recheck);
155
-		if($with_prefixes){
155
+		if ($with_prefixes) {
156 156
 			$classnames = array_keys($this->_payment_method_types);
157 157
 			$payment_methods = array();
158
-			foreach($classnames as $classname){
158
+			foreach ($classnames as $classname) {
159 159
 				$payment_methods[] = $this->payment_method_class_from_type($classname);
160 160
 			}
161 161
 			return $payment_methods;
162
-		}else{
162
+		} else {
163 163
 			return array_keys($this->_payment_method_types);
164 164
 		}
165 165
 	}
@@ -169,10 +169,10 @@  discard block
 block discarded – undo
169 169
 	 * @param boolean $force_recheck whether to force re-checking for new payment method types
170 170
 	 * @return EE_PMT_Base[]
171 171
 	 */
172
-	public function payment_method_types( $force_recheck = FALSE ){
172
+	public function payment_method_types($force_recheck = FALSE) {
173 173
 		$this->maybe_register_payment_methods($force_recheck);
174 174
 		$pmt_objs = array();
175
-		foreach($this->payment_method_type_names(true) as $classname){
175
+		foreach ($this->payment_method_type_names(true) as $classname) {
176 176
 			$pmt_objs[] = new $classname;
177 177
 		}
178 178
 		return $pmt_objs;
@@ -184,8 +184,8 @@  discard block
 block discarded – undo
184 184
 	 * @param string $classname
185 185
 	 * @return string
186 186
 	 */
187
-	public function payment_method_type_sans_class_prefix($classname){
188
-		$pmt_name = str_replace("EE_PMT_","",$classname);
187
+	public function payment_method_type_sans_class_prefix($classname) {
188
+		$pmt_name = str_replace("EE_PMT_", "", $classname);
189 189
 		return $pmt_name;
190 190
 	}
191 191
 
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
 	 * @param string $type
195 195
 	 * @return string
196 196
 	 */
197
-	public function payment_method_class_from_type($type){
197
+	public function payment_method_class_from_type($type) {
198 198
 		$this->maybe_register_payment_methods();
199 199
 		return "EE_PMT_".$type;
200 200
 	}
@@ -205,51 +205,51 @@  discard block
 block discarded – undo
205 205
 	 * @param string $payment_method_type the PMT_type; for EE_PMT_Invoice this would be 'Invoice'
206 206
 	 * @return EE_Payment_Method
207 207
 	 */
208
-	public function activate_a_payment_method_of_type( $payment_method_type ){
208
+	public function activate_a_payment_method_of_type($payment_method_type) {
209 209
 		$payment_method = EEM_Payment_Method::instance()->get_one_of_type($payment_method_type);
210
-		if( ! $payment_method){
210
+		if ( ! $payment_method) {
211 211
 			global $current_user;
212 212
 			$pm_type_class = $this->payment_method_class_from_type($payment_method_type);
213
-			if(class_exists($pm_type_class)){
213
+			if (class_exists($pm_type_class)) {
214 214
 				/** @var $pm_type_obj EE_PMT_Base */
215 215
 				$pm_type_obj = new $pm_type_class;
216 216
 				$payment_method = EEM_Payment_Method::instance()->get_one_by_slug($pm_type_obj->system_name());
217
-				if( ! $payment_method){
217
+				if ( ! $payment_method) {
218 218
 					$payment_method = EE_Payment_Method::new_instance(array(
219 219
 						'PMD_type'=>$pm_type_obj->system_name(),
220 220
 						'PMD_name'=>$pm_type_obj->pretty_name(),
221 221
 						'PMD_admin_name'=>$pm_type_obj->pretty_name(),
222
-						'PMD_slug'=>$pm_type_obj->system_name(),//automatically converted to slug
222
+						'PMD_slug'=>$pm_type_obj->system_name(), //automatically converted to slug
223 223
 						'PMD_wp_user'=>$current_user->ID,
224 224
 					));
225 225
 				}
226 226
 				$payment_method->set_active();
227
-				$payment_method->set_description( $pm_type_obj->default_description() );
227
+				$payment_method->set_description($pm_type_obj->default_description());
228 228
 				//handles the goofy case where someone activates the invoice gateway which is also
229 229
 				$payment_method->set_type($pm_type_obj->system_name());
230
-				if( ! $payment_method->button_url() ){
231
-					$payment_method->set_button_url( $pm_type_obj->default_button_url() );
230
+				if ( ! $payment_method->button_url()) {
231
+					$payment_method->set_button_url($pm_type_obj->default_button_url());
232 232
 				}
233 233
 				$payment_method->save();
234
-				foreach($payment_method->get_all_usable_currencies() as $currency_obj){
234
+				foreach ($payment_method->get_all_usable_currencies() as $currency_obj) {
235 235
 					$payment_method->_add_relation_to($currency_obj, 'Currency');
236 236
 				}
237 237
 				//now add setup its default extra meta properties
238 238
 				$extra_metas = $payment_method->type_obj()->settings_form()->extra_meta_inputs();
239
-				foreach( $extra_metas as $meta_name => $input ){
240
-					$payment_method->update_extra_meta($meta_name, $input->raw_value() );
239
+				foreach ($extra_metas as $meta_name => $input) {
240
+					$payment_method->update_extra_meta($meta_name, $input->raw_value());
241 241
 				}
242 242
 			}
243 243
 
244
-		}else{
244
+		} else {
245 245
 			$payment_method->set_active();
246 246
 			$payment_method->save();
247 247
 		}
248
-		if( $payment_method->type() == 'Invoice' ){
249
-			$messages = EE_Registry::instance()->load_lib( 'messages' );
250
-			$messages->ensure_message_type_is_active( 'invoice', 'html' );
251
-			$messages->ensure_messenger_is_active( 'pdf' );
252
-			EE_Error::add_attention( sprintf( __( 'Note, when the invoice payment method is activated, the invoice message type, html messenger, and pdf messenger are activated as well for the %1$smessages system%2$s.', 'event_espresso' ), '<a href="' . admin_url( 'admin.php?page=espresso_messages') . '">', '</a>' ) );
248
+		if ($payment_method->type() == 'Invoice') {
249
+			$messages = EE_Registry::instance()->load_lib('messages');
250
+			$messages->ensure_message_type_is_active('invoice', 'html');
251
+			$messages->ensure_messenger_is_active('pdf');
252
+			EE_Error::add_attention(sprintf(__('Note, when the invoice payment method is activated, the invoice message type, html messenger, and pdf messenger are activated as well for the %1$smessages system%2$s.', 'event_espresso'), '<a href="'.admin_url('admin.php?page=espresso_messages').'">', '</a>'));
253 253
 		}
254 254
 		return $payment_method;
255 255
 	}
@@ -264,8 +264,8 @@  discard block
 block discarded – undo
264 264
 	 *
265 265
 	 * @return int count of rows updated.
266 266
 	 */
267
-	public function deactivate_payment_method( $payment_method_slug ) {
268
-		$count_updated = EEM_Payment_Method::instance()->update(array('PMD_scope'=>array()),array(array('PMD_slug'=>$payment_method_slug)));
267
+	public function deactivate_payment_method($payment_method_slug) {
268
+		$count_updated = EEM_Payment_Method::instance()->update(array('PMD_scope'=>array()), array(array('PMD_slug'=>$payment_method_slug)));
269 269
 		return $count_updated;
270 270
 	}
271 271
 
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
 	 *
279 279
 	 * @param array $caps capabilities being filtered
280 280
 	 */
281
-	public function add_payment_method_caps( $caps ) {
281
+	public function add_payment_method_caps($caps) {
282 282
 		/* add dynamic caps from payment methods
283 283
 		 * at the time of writing, october 20 2014, these are the caps added:
284 284
 		 * ee_payment_method_admin_only
@@ -293,7 +293,7 @@  discard block
 block discarded – undo
293 293
 		 * their related capability automatically added too, so long as they are
294 294
 		 * registered properly using EE_Register_Payment_Method::register()
295 295
 		 */
296
-		foreach( $this->payment_method_types() as $payment_method_type_obj ){
296
+		foreach ($this->payment_method_types() as $payment_method_type_obj) {
297 297
 			$caps['administrator'][] = $payment_method_type_obj->cap_name();
298 298
 		}
299 299
 		return $caps;
Please login to merge, or discard this patch.
libraries/payment_methods/templates/payment_details_content.template.php 3 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -2,10 +2,10 @@
 block discarded – undo
2 2
 if (!defined('EVENT_ESPRESSO_VERSION'))
3 3
 	exit('No direct script access allowed');
4 4
 /**
5
- * payment_details_content
6
- * @var EE_Payment $payment
7
- * @var EE_Payment_Method $payment_method
8
- */
5
+	 * payment_details_content
6
+	 * @var EE_Payment $payment
7
+	 * @var EE_Payment_Method $payment_method
8
+	 */
9 9
 $gateway_response = $payment->gateway_response();
10 10
 if ( ! empty( $gateway_response )) {
11 11
 	echo '<span class="error payment-problem">' . $gateway_response . '</span>';
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION'))
2
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
3 3
 	exit('No direct script access allowed');
4 4
 /**
5 5
  * payment_details_content
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
  * @var EE_Payment_Method $payment_method
8 8
  */
9 9
 $gateway_response = $payment->gateway_response();
10
-if ( ! empty( $gateway_response )) {
11
-	echo '<span class="error payment-problem">' . $gateway_response . '</span>';
10
+if ( ! empty($gateway_response)) {
11
+	echo '<span class="error payment-problem">'.$gateway_response.'</span>';
12 12
 }
13 13
 // End of file payment_details_content.template.php
14 14
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,7 @@
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION'))
2
+if (!defined('EVENT_ESPRESSO_VERSION')) {
3 3
 	exit('No direct script access allowed');
4
+}
4 5
 /**
5 6
  * payment_details_content
6 7
  * @var EE_Payment $payment
Please login to merge, or discard this patch.
core/libraries/plugin_api/EEI_Plugin_API.lib.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 	 * @param array  $setup_args  an array of key value pairs of info for registering the component
35 35
 	 * @return void
36 36
 	 */
37
-	public static function register( $ID = NULL, $setup_args = array() );
37
+	public static function register($ID = NULL, $setup_args = array());
38 38
 
39 39
 
40 40
 
@@ -45,5 +45,5 @@  discard block
 block discarded – undo
45 45
 	 * @param string $ID a unique name or ID for the component being registered
46 46
 	 * @return void
47 47
 	 */
48
-	public static function deregister( $ID = NULL );
48
+	public static function deregister($ID = NULL);
49 49
 }
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,9 @@
 block discarded – undo
5 5
  * @subpackage helpers
6 6
  * @since           4.3.0
7 7
  */
8
-if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
8
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
9
+	exit('No direct script access allowed');
10
+}
9 11
 
10 12
 /**
11 13
  * This interface is used to define the common methods shared by all "plugin api" classes.
Please login to merge, or discard this patch.