@@ -17,27 +17,27 @@ |
||
17 | 17 | class TicketSelectorIframeEmbedButton extends IframeEmbedButton |
18 | 18 | { |
19 | 19 | |
20 | - /** |
|
21 | - * TicketSelectorIframeEmbedButton constructor. |
|
22 | - */ |
|
23 | - public function __construct() |
|
24 | - { |
|
25 | - parent::__construct( |
|
26 | - esc_html__( 'Ticket Selector', 'event_espresso' ), |
|
27 | - 'ticket_selector' |
|
28 | - ); |
|
29 | - } |
|
30 | - |
|
31 | - |
|
32 | - |
|
33 | - /** |
|
34 | - * Adds an iframe embed code button to the Event editor. |
|
35 | - */ |
|
36 | - public function addEventEditorIframeEmbedButton() |
|
37 | - { |
|
38 | - // add button for iframe code to event editor. |
|
39 | - $this->addEventEditorIframeEmbedButtonFilter(); |
|
40 | - } |
|
20 | + /** |
|
21 | + * TicketSelectorIframeEmbedButton constructor. |
|
22 | + */ |
|
23 | + public function __construct() |
|
24 | + { |
|
25 | + parent::__construct( |
|
26 | + esc_html__( 'Ticket Selector', 'event_espresso' ), |
|
27 | + 'ticket_selector' |
|
28 | + ); |
|
29 | + } |
|
30 | + |
|
31 | + |
|
32 | + |
|
33 | + /** |
|
34 | + * Adds an iframe embed code button to the Event editor. |
|
35 | + */ |
|
36 | + public function addEventEditorIframeEmbedButton() |
|
37 | + { |
|
38 | + // add button for iframe code to event editor. |
|
39 | + $this->addEventEditorIframeEmbedButtonFilter(); |
|
40 | + } |
|
41 | 41 | |
42 | 42 | |
43 | 43 |
@@ -3,7 +3,7 @@ discard block |
||
3 | 3 | |
4 | 4 | use EventEspresso\core\libraries\iframe_display\IframeEmbedButton; |
5 | 5 | |
6 | -defined( 'ABSPATH' ) || exit; |
|
6 | +defined('ABSPATH') || exit; |
|
7 | 7 | |
8 | 8 | |
9 | 9 | |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | public function __construct() |
24 | 24 | { |
25 | 25 | parent::__construct( |
26 | - esc_html__( 'Ticket Selector', 'event_espresso' ), |
|
26 | + esc_html__('Ticket Selector', 'event_espresso'), |
|
27 | 27 | 'ticket_selector' |
28 | 28 | ); |
29 | 29 | } |
@@ -3,8 +3,8 @@ discard block |
||
3 | 3 | |
4 | 4 | use EventEspresso\core\libraries\iframe_display\Iframe; |
5 | 5 | |
6 | -if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
7 | - exit( 'No direct script access allowed' ); |
|
6 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
7 | + exit('No direct script access allowed'); |
|
8 | 8 | } |
9 | 9 | |
10 | 10 | |
@@ -26,10 +26,10 @@ discard block |
||
26 | 26 | * @return mixed|null |
27 | 27 | * @throws \EE_Error |
28 | 28 | */ |
29 | - public static function create( $class_name, $arguments = array() ) { |
|
30 | - if ( empty( $class_name ) ) { |
|
29 | + public static function create($class_name, $arguments = array()) { |
|
30 | + if (empty($class_name)) { |
|
31 | 31 | throw new \EE_Error( |
32 | - __( 'You must provide a class name in order to instantiate it.', 'event_espresso' ) |
|
32 | + __('You must provide a class name in order to instantiate it.', 'event_espresso') |
|
33 | 33 | ); |
34 | 34 | } |
35 | 35 | // if ( ! class_exists( $class_name ) ) { |
@@ -41,20 +41,20 @@ discard block |
||
41 | 41 | // ); |
42 | 42 | // } |
43 | 43 | $object = null; |
44 | - switch ( $class_name ) { |
|
44 | + switch ($class_name) { |
|
45 | 45 | |
46 | 46 | case 'EE_Request' : |
47 | - $object = new \EE_Request( $_GET, $_POST, $_COOKIE ); |
|
47 | + $object = new \EE_Request($_GET, $_POST, $_COOKIE); |
|
48 | 48 | break; |
49 | 49 | |
50 | 50 | case 'Iframe' : |
51 | - $title = isset( $arguments['title'] ) ? $arguments['title'] : null; |
|
52 | - $content = isset( $arguments['content'] ) ? $arguments['content'] : null; |
|
53 | - $object = new Iframe( $title, $content ); |
|
51 | + $title = isset($arguments['title']) ? $arguments['title'] : null; |
|
52 | + $content = isset($arguments['content']) ? $arguments['content'] : null; |
|
53 | + $object = new Iframe($title, $content); |
|
54 | 54 | break; |
55 | 55 | |
56 | 56 | default : |
57 | - $object = new $class_name( $arguments ); |
|
57 | + $object = new $class_name($arguments); |
|
58 | 58 | |
59 | 59 | } |
60 | 60 |
@@ -274,26 +274,26 @@ discard block |
||
274 | 274 | if ( ! $this->validate_ipn( $update_info, $payment ) ) { |
275 | 275 | return $payment; |
276 | 276 | } |
277 | - // kill request here if this is a refund, we don't support them yet (we'd need to adjust the transaction, |
|
278 | - // registrations, ticket counts, etc) |
|
279 | - if ( |
|
280 | - ( |
|
281 | - $update_info[ 'payment_status' ] === 'Refunded' |
|
282 | - || $update_info[ 'payment_status' ] === 'Partially_Refunded' |
|
283 | - ) |
|
284 | - && apply_filters( 'FHEE__EEG_Paypal_Standard__handle_payment_update__kill_refund_request', true ) |
|
285 | - ) { |
|
286 | - throw new EventEspresso\core\exceptions\IpnException( |
|
287 | - sprintf( |
|
288 | - esc_html__( 'Event Espresso does not yet support %1$s IPNs from PayPal', 'event_espresso'), |
|
289 | - $update_info['payment_status'] |
|
290 | - ), |
|
291 | - EventEspresso\core\exceptions\IpnException::UNSUPPORTED, |
|
292 | - null, |
|
293 | - $payment, |
|
294 | - $update_info |
|
295 | - ); |
|
296 | - } |
|
277 | + // kill request here if this is a refund, we don't support them yet (we'd need to adjust the transaction, |
|
278 | + // registrations, ticket counts, etc) |
|
279 | + if ( |
|
280 | + ( |
|
281 | + $update_info[ 'payment_status' ] === 'Refunded' |
|
282 | + || $update_info[ 'payment_status' ] === 'Partially_Refunded' |
|
283 | + ) |
|
284 | + && apply_filters( 'FHEE__EEG_Paypal_Standard__handle_payment_update__kill_refund_request', true ) |
|
285 | + ) { |
|
286 | + throw new EventEspresso\core\exceptions\IpnException( |
|
287 | + sprintf( |
|
288 | + esc_html__( 'Event Espresso does not yet support %1$s IPNs from PayPal', 'event_espresso'), |
|
289 | + $update_info['payment_status'] |
|
290 | + ), |
|
291 | + EventEspresso\core\exceptions\IpnException::UNSUPPORTED, |
|
292 | + null, |
|
293 | + $payment, |
|
294 | + $update_info |
|
295 | + ); |
|
296 | + } |
|
297 | 297 | //ok, well let's process this payment then! |
298 | 298 | switch ( $update_info[ 'payment_status' ] ) { |
299 | 299 | |
@@ -541,17 +541,17 @@ discard block |
||
541 | 541 | |
542 | 542 | //might paypal have changed the taxes? |
543 | 543 | if( $this->_paypal_taxes && $payment_was_itemized ) { |
544 | - // note that we're doing this BEFORE adding shipping; |
|
544 | + // note that we're doing this BEFORE adding shipping; |
|
545 | 545 | // we actually want PayPal's shipping to remain non-taxable |
546 | - $this->_line_item->set_line_items_taxable( $transaction_total_line_item, true, 'paypal_shipping' ); |
|
547 | - $this->_line_item->set_total_tax_to( |
|
548 | - $transaction_total_line_item, |
|
549 | - (float)$update_info['tax'], |
|
550 | - esc_html__( 'Taxes', 'event_espresso' ), |
|
551 | - esc_html__( 'Calculated by Paypal', 'event_espresso' ), |
|
552 | - 'paypal_tax' |
|
553 | - ); |
|
554 | - $grand_total_needs_resaving = TRUE; |
|
546 | + $this->_line_item->set_line_items_taxable( $transaction_total_line_item, true, 'paypal_shipping' ); |
|
547 | + $this->_line_item->set_total_tax_to( |
|
548 | + $transaction_total_line_item, |
|
549 | + (float)$update_info['tax'], |
|
550 | + esc_html__( 'Taxes', 'event_espresso' ), |
|
551 | + esc_html__( 'Calculated by Paypal', 'event_espresso' ), |
|
552 | + 'paypal_tax' |
|
553 | + ); |
|
554 | + $grand_total_needs_resaving = TRUE; |
|
555 | 555 | } |
556 | 556 | |
557 | 557 | $shipping_amount = (float)$update_info[ 'mc_shipping' ]; |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | * @return EEG_Paypal_Standard |
71 | 71 | */ |
72 | 72 | public function __construct() { |
73 | - $this->set_uses_separate_IPN_request( true ) ; |
|
73 | + $this->set_uses_separate_IPN_request(true); |
|
74 | 74 | parent::__construct(); |
75 | 75 | } |
76 | 76 | |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | * Also sets the gateway url class variable based on whether debug mode is enabled or not |
81 | 81 | * @param array $settings_array |
82 | 82 | */ |
83 | - public function set_settings($settings_array){ |
|
83 | + public function set_settings($settings_array) { |
|
84 | 84 | parent::set_settings($settings_array); |
85 | 85 | $this->_gateway_url = $this->_debug_mode |
86 | 86 | ? 'https://www.sandbox.paypal.com/cgi-bin/webscr' |
@@ -114,42 +114,42 @@ discard block |
||
114 | 114 | |
115 | 115 | $total_discounts_to_cart_total = $transaction->paid(); |
116 | 116 | //only itemize the order if we're paying for the rest of the order's amount |
117 | - if( EEH_Money::compare_floats( $payment->amount(), $transaction->total(), '==' ) ) { |
|
118 | - $payment->update_extra_meta( EEG_Paypal_Standard::itemized_payment_option_name, true ); |
|
117 | + if (EEH_Money::compare_floats($payment->amount(), $transaction->total(), '==')) { |
|
118 | + $payment->update_extra_meta(EEG_Paypal_Standard::itemized_payment_option_name, true); |
|
119 | 119 | //this payment is for the remaining transaction amount, |
120 | 120 | //keep track of exactly how much the itemized order amount equals |
121 | 121 | $itemized_sum = 0; |
122 | 122 | $shipping_previously_added = 0; |
123 | 123 | //so let's show all the line items |
124 | - foreach($total_line_item->get_items() as $line_item){ |
|
125 | - if ( $line_item instanceof EE_Line_Item ) { |
|
124 | + foreach ($total_line_item->get_items() as $line_item) { |
|
125 | + if ($line_item instanceof EE_Line_Item) { |
|
126 | 126 | //it's some kind of discount |
127 | - if( $line_item->total() < 0 ) { |
|
128 | - $total_discounts_to_cart_total += abs( $line_item->total() ); |
|
127 | + if ($line_item->total() < 0) { |
|
128 | + $total_discounts_to_cart_total += abs($line_item->total()); |
|
129 | 129 | $itemized_sum += $line_item->total(); |
130 | 130 | continue; |
131 | 131 | } |
132 | 132 | //dont include shipping again. |
133 | - if( strpos( $line_item->code(), 'paypal_shipping_') === 0 ) { |
|
133 | + if (strpos($line_item->code(), 'paypal_shipping_') === 0) { |
|
134 | 134 | $shipping_previously_added = $line_item->total(); |
135 | 135 | continue; |
136 | 136 | } |
137 | - $redirect_args[ 'item_name_' . $item_num ] = substr( |
|
138 | - $this->_format_line_item_name( $line_item, $payment ), |
|
137 | + $redirect_args['item_name_'.$item_num] = substr( |
|
138 | + $this->_format_line_item_name($line_item, $payment), |
|
139 | 139 | 0, 127 |
140 | 140 | ); |
141 | - $redirect_args[ 'amount_' . $item_num ] = $line_item->unit_price(); |
|
142 | - $redirect_args[ 'quantity_' . $item_num ] = $line_item->quantity(); |
|
141 | + $redirect_args['amount_'.$item_num] = $line_item->unit_price(); |
|
142 | + $redirect_args['quantity_'.$item_num] = $line_item->quantity(); |
|
143 | 143 | //if we're not letting PayPal calculate shipping, tell them its 0 |
144 | - if ( ! $this->_paypal_shipping ) { |
|
145 | - $redirect_args[ 'shipping_' . $item_num ] = '0'; |
|
146 | - $redirect_args[ 'shipping2_' . $item_num ] = '0'; |
|
144 | + if ( ! $this->_paypal_shipping) { |
|
145 | + $redirect_args['shipping_'.$item_num] = '0'; |
|
146 | + $redirect_args['shipping2_'.$item_num] = '0'; |
|
147 | 147 | } |
148 | 148 | $item_num++; |
149 | 149 | $itemized_sum += $line_item->total(); |
150 | 150 | } |
151 | 151 | } |
152 | - $taxes_li = $this->_line_item->get_taxes_subtotal( $total_line_item ); |
|
152 | + $taxes_li = $this->_line_item->get_taxes_subtotal($total_line_item); |
|
153 | 153 | //ideally itemized sum equals the transaction total. but if not (which is weird) |
154 | 154 | //and the itemized sum is LESS than the transaction total |
155 | 155 | //add another line item |
@@ -159,47 +159,47 @@ discard block |
||
159 | 159 | $transaction->total() - $itemized_sum - $taxes_li->total() - $shipping_previously_added, |
160 | 160 | 2 |
161 | 161 | ); |
162 | - if( $itemized_sum_diff_from_txn_total < 0 ) { |
|
162 | + if ($itemized_sum_diff_from_txn_total < 0) { |
|
163 | 163 | //itemized sum is too big |
164 | - $total_discounts_to_cart_total += abs( $itemized_sum_diff_from_txn_total ); |
|
165 | - } elseif( $itemized_sum_diff_from_txn_total > 0 ) { |
|
166 | - $redirect_args[ 'item_name_' . $item_num ] = substr( |
|
167 | - __( 'Other charges', 'event_espresso' ), 0, 127 ); |
|
168 | - $redirect_args[ 'amount_' . $item_num ] = $this->format_currency( $itemized_sum_diff_from_txn_total ); |
|
169 | - $redirect_args[ 'quantity_' . $item_num ] = 1; |
|
164 | + $total_discounts_to_cart_total += abs($itemized_sum_diff_from_txn_total); |
|
165 | + } elseif ($itemized_sum_diff_from_txn_total > 0) { |
|
166 | + $redirect_args['item_name_'.$item_num] = substr( |
|
167 | + __('Other charges', 'event_espresso'), 0, 127 ); |
|
168 | + $redirect_args['amount_'.$item_num] = $this->format_currency($itemized_sum_diff_from_txn_total); |
|
169 | + $redirect_args['quantity_'.$item_num] = 1; |
|
170 | 170 | $item_num++; |
171 | 171 | } |
172 | - if( $total_discounts_to_cart_total > 0 ) { |
|
173 | - $redirect_args[ 'discount_amount_cart' ] = $this->format_currency( $total_discounts_to_cart_total ); |
|
172 | + if ($total_discounts_to_cart_total > 0) { |
|
173 | + $redirect_args['discount_amount_cart'] = $this->format_currency($total_discounts_to_cart_total); |
|
174 | 174 | } |
175 | 175 | //add our taxes to the order if we're NOT using PayPal's |
176 | - if( ! $this->_paypal_taxes ){ |
|
176 | + if ( ! $this->_paypal_taxes) { |
|
177 | 177 | $redirect_args['tax_cart'] = $total_line_item->get_total_tax(); |
178 | 178 | } |
179 | 179 | } else { |
180 | - $payment->update_extra_meta( EEG_Paypal_Standard::itemized_payment_option_name, false ); |
|
180 | + $payment->update_extra_meta(EEG_Paypal_Standard::itemized_payment_option_name, false); |
|
181 | 181 | //partial payment that's not for the remaining amount, so we can't send an itemized list |
182 | - $redirect_args['item_name_' . $item_num] = substr( |
|
183 | - $this->_format_partial_payment_line_item_name( $payment ), |
|
182 | + $redirect_args['item_name_'.$item_num] = substr( |
|
183 | + $this->_format_partial_payment_line_item_name($payment), |
|
184 | 184 | 0, 127 |
185 | 185 | ); |
186 | - $redirect_args['amount_' . $item_num] = $payment->amount(); |
|
187 | - $redirect_args['shipping_' . $item_num ] = '0'; |
|
188 | - $redirect_args['shipping2_' . $item_num ] = '0'; |
|
186 | + $redirect_args['amount_'.$item_num] = $payment->amount(); |
|
187 | + $redirect_args['shipping_'.$item_num] = '0'; |
|
188 | + $redirect_args['shipping2_'.$item_num] = '0'; |
|
189 | 189 | $redirect_args['tax_cart'] = '0'; |
190 | 190 | $item_num++; |
191 | 191 | } |
192 | 192 | |
193 | - if($this->_debug_mode){ |
|
194 | - $redirect_args['item_name_' . $item_num] = 'DEBUG INFO (this item only added in sandbox mode'; |
|
195 | - $redirect_args['amount_' . $item_num] = 0; |
|
193 | + if ($this->_debug_mode) { |
|
194 | + $redirect_args['item_name_'.$item_num] = 'DEBUG INFO (this item only added in sandbox mode'; |
|
195 | + $redirect_args['amount_'.$item_num] = 0; |
|
196 | 196 | $redirect_args['on0_'.$item_num] = 'NOTIFY URL'; |
197 | - $redirect_args['os0_' . $item_num] = $notify_url; |
|
197 | + $redirect_args['os0_'.$item_num] = $notify_url; |
|
198 | 198 | $redirect_args['on1_'.$item_num] = 'RETURN URL'; |
199 | - $redirect_args['os1_' . $item_num] = $return_url; |
|
199 | + $redirect_args['os1_'.$item_num] = $return_url; |
|
200 | 200 | // $redirect_args['option_index_' . $item_num] = 1; // <-- dunno if this is needed ? |
201 | - $redirect_args['shipping_' . $item_num ] = '0'; |
|
202 | - $redirect_args['shipping2_' . $item_num ] = '0'; |
|
201 | + $redirect_args['shipping_'.$item_num] = '0'; |
|
202 | + $redirect_args['shipping2_'.$item_num] = '0'; |
|
203 | 203 | } |
204 | 204 | |
205 | 205 | $redirect_args['business'] = $this->_paypal_id; |
@@ -209,14 +209,14 @@ discard block |
||
209 | 209 | $redirect_args['cmd'] = '_cart'; |
210 | 210 | $redirect_args['upload'] = 1; |
211 | 211 | $redirect_args['currency_code'] = $payment->currency_code(); |
212 | - $redirect_args['rm'] = 2;//makes the user return with method=POST |
|
213 | - if($this->_image_url){ |
|
212 | + $redirect_args['rm'] = 2; //makes the user return with method=POST |
|
213 | + if ($this->_image_url) { |
|
214 | 214 | $redirect_args['image_url'] = $this->_image_url; |
215 | 215 | } |
216 | 216 | $redirect_args['no_shipping'] = $this->_shipping_details; |
217 | - $redirect_args['bn'] = 'EventEspresso_SP';//EE will blow up if you change this |
|
217 | + $redirect_args['bn'] = 'EventEspresso_SP'; //EE will blow up if you change this |
|
218 | 218 | |
219 | - $redirect_args = apply_filters( "FHEE__EEG_Paypal_Standard__set_redirection_info__arguments", $redirect_args, $this ); |
|
219 | + $redirect_args = apply_filters("FHEE__EEG_Paypal_Standard__set_redirection_info__arguments", $redirect_args, $this); |
|
220 | 220 | |
221 | 221 | $payment->set_redirect_url($this->_gateway_url); |
222 | 222 | $payment->set_redirect_args($redirect_args); |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | $this->log( |
225 | 225 | array( |
226 | 226 | 'message' => sprintf( |
227 | - __( 'PayPal payment request initiated.', 'event_espresso' ) |
|
227 | + __('PayPal payment request initiated.', 'event_espresso') |
|
228 | 228 | ), |
229 | 229 | 'transaction' => $transaction->model_field_array(), |
230 | 230 | ), |
@@ -244,14 +244,14 @@ discard block |
||
244 | 244 | * @return \EEI_Payment updated |
245 | 245 | * @throws \EE_Error, IpnException |
246 | 246 | */ |
247 | - public function handle_payment_update( $update_info, $transaction ){ |
|
247 | + public function handle_payment_update($update_info, $transaction) { |
|
248 | 248 | // verify there's payment data that's been sent |
249 | - if ( empty( $update_info[ 'payment_status' ] ) || empty( $update_info[ 'txn_id' ] ) ) { |
|
249 | + if (empty($update_info['payment_status']) || empty($update_info['txn_id'])) { |
|
250 | 250 | // log the results |
251 | 251 | $this->log( |
252 | 252 | array( |
253 | 253 | 'message' => sprintf( |
254 | - __( 'PayPal IPN response is missing critical payment data. This may indicate a PDT request and require your PayPal account settings to be corrected.', 'event_espresso' ) |
|
254 | + __('PayPal IPN response is missing critical payment data. This may indicate a PDT request and require your PayPal account settings to be corrected.', 'event_espresso') |
|
255 | 255 | ), |
256 | 256 | 'update_info' => $update_info, |
257 | 257 | ), |
@@ -259,33 +259,33 @@ discard block |
||
259 | 259 | ); |
260 | 260 | // waaaait... is this a PDT request? (see https://developer.paypal.com/docs/classic/products/payment-data-transfer/) |
261 | 261 | // indicated by the "tx" argument? If so, we don't need it. We'll just use the IPN data when it comes |
262 | - if ( isset( $update_info[ 'tx' ] ) ) { |
|
262 | + if (isset($update_info['tx'])) { |
|
263 | 263 | return $transaction->last_payment(); |
264 | 264 | } else { |
265 | 265 | return null; |
266 | 266 | } |
267 | 267 | } |
268 | - $payment = $this->_pay_model->get_payment_by_txn_id_chq_nmbr( $update_info[ 'txn_id' ] ); |
|
269 | - if ( ! $payment instanceof EEI_Payment ) { |
|
268 | + $payment = $this->_pay_model->get_payment_by_txn_id_chq_nmbr($update_info['txn_id']); |
|
269 | + if ( ! $payment instanceof EEI_Payment) { |
|
270 | 270 | $payment = $transaction->last_payment(); |
271 | 271 | } |
272 | 272 | // ok, then validate the IPN. Even if we've already processed this payment, |
273 | 273 | // let PayPal know we don't want to hear from them anymore! |
274 | - if ( ! $this->validate_ipn( $update_info, $payment ) ) { |
|
274 | + if ( ! $this->validate_ipn($update_info, $payment)) { |
|
275 | 275 | return $payment; |
276 | 276 | } |
277 | 277 | // kill request here if this is a refund, we don't support them yet (we'd need to adjust the transaction, |
278 | 278 | // registrations, ticket counts, etc) |
279 | 279 | if ( |
280 | 280 | ( |
281 | - $update_info[ 'payment_status' ] === 'Refunded' |
|
282 | - || $update_info[ 'payment_status' ] === 'Partially_Refunded' |
|
281 | + $update_info['payment_status'] === 'Refunded' |
|
282 | + || $update_info['payment_status'] === 'Partially_Refunded' |
|
283 | 283 | ) |
284 | - && apply_filters( 'FHEE__EEG_Paypal_Standard__handle_payment_update__kill_refund_request', true ) |
|
284 | + && apply_filters('FHEE__EEG_Paypal_Standard__handle_payment_update__kill_refund_request', true) |
|
285 | 285 | ) { |
286 | 286 | throw new EventEspresso\core\exceptions\IpnException( |
287 | 287 | sprintf( |
288 | - esc_html__( 'Event Espresso does not yet support %1$s IPNs from PayPal', 'event_espresso'), |
|
288 | + esc_html__('Event Espresso does not yet support %1$s IPNs from PayPal', 'event_espresso'), |
|
289 | 289 | $update_info['payment_status'] |
290 | 290 | ), |
291 | 291 | EventEspresso\core\exceptions\IpnException::UNSUPPORTED, |
@@ -295,34 +295,34 @@ discard block |
||
295 | 295 | ); |
296 | 296 | } |
297 | 297 | //ok, well let's process this payment then! |
298 | - switch ( $update_info[ 'payment_status' ] ) { |
|
298 | + switch ($update_info['payment_status']) { |
|
299 | 299 | |
300 | 300 | case 'Completed' : |
301 | 301 | $status = $this->_pay_model->approved_status(); |
302 | - $gateway_response = esc_html__( 'The payment is approved.', 'event_espresso' ); |
|
302 | + $gateway_response = esc_html__('The payment is approved.', 'event_espresso'); |
|
303 | 303 | break; |
304 | 304 | |
305 | 305 | case 'Pending' : |
306 | 306 | $status = $this->_pay_model->pending_status(); |
307 | - $gateway_response = esc_html__( 'The payment is in progress. Another message will be sent when payment is approved.', 'event_espresso' ); |
|
307 | + $gateway_response = esc_html__('The payment is in progress. Another message will be sent when payment is approved.', 'event_espresso'); |
|
308 | 308 | break; |
309 | 309 | |
310 | 310 | case 'Denied' : |
311 | 311 | $status = $this->_pay_model->declined_status(); |
312 | - $gateway_response = esc_html__( 'The payment has been declined.', 'event_espresso' ); |
|
312 | + $gateway_response = esc_html__('The payment has been declined.', 'event_espresso'); |
|
313 | 313 | break; |
314 | 314 | |
315 | 315 | case 'Expired' : |
316 | 316 | case 'Failed' : |
317 | 317 | $status = $this->_pay_model->failed_status(); |
318 | - $gateway_response = esc_html__( 'The payment failed for technical reasons or expired.', 'event_espresso' ); |
|
318 | + $gateway_response = esc_html__('The payment failed for technical reasons or expired.', 'event_espresso'); |
|
319 | 319 | break; |
320 | 320 | |
321 | 321 | case 'Refunded' : |
322 | 322 | case 'Partially_Refunded' : |
323 | 323 | // even though it's a refund, we consider the payment as approved, it just has a negative value |
324 | 324 | $status = $this->_pay_model->approved_status(); |
325 | - $gateway_response = esc_html__( 'The payment has been refunded. Please update registrations accordingly.', 'event_espresso' ); |
|
325 | + $gateway_response = esc_html__('The payment has been refunded. Please update registrations accordingly.', 'event_espresso'); |
|
326 | 326 | break; |
327 | 327 | |
328 | 328 | case 'Voided' : |
@@ -330,19 +330,19 @@ discard block |
||
330 | 330 | case 'Canceled_Reversal' : |
331 | 331 | default : |
332 | 332 | $status = $this->_pay_model->cancelled_status(); |
333 | - $gateway_response = esc_html__( 'The payment was cancelled, reversed, or voided. Please update registrations accordingly.', 'event_espresso' ); |
|
333 | + $gateway_response = esc_html__('The payment was cancelled, reversed, or voided. Please update registrations accordingly.', 'event_espresso'); |
|
334 | 334 | break; |
335 | 335 | |
336 | 336 | } |
337 | 337 | |
338 | 338 | //check if we've already processed this payment |
339 | - if ( $payment instanceof EEI_Payment ) { |
|
339 | + if ($payment instanceof EEI_Payment) { |
|
340 | 340 | //payment exists. if this has the exact same status and amount, don't bother updating. just return |
341 | - if ( $payment->status() === $status && (float)$payment->amount() === (float)$update_info[ 'mc_gross' ] ) { |
|
341 | + if ($payment->status() === $status && (float) $payment->amount() === (float) $update_info['mc_gross']) { |
|
342 | 342 | // DUPLICATED IPN! don't bother updating transaction |
343 | 343 | throw new IpnException( |
344 | 344 | sprintf( |
345 | - esc_html__( 'It appears we have received a duplicate IPN from PayPal for payment %d', 'event_espresso' ), |
|
345 | + esc_html__('It appears we have received a duplicate IPN from PayPal for payment %d', 'event_espresso'), |
|
346 | 346 | $payment->ID() |
347 | 347 | ), |
348 | 348 | IpnException::DUPLICATE, |
@@ -352,14 +352,14 @@ discard block |
||
352 | 352 | ); |
353 | 353 | } else { |
354 | 354 | // new payment yippee !!! |
355 | - $payment->set_status( $status ); |
|
356 | - $payment->set_amount( (float)$update_info[ 'mc_gross' ] ); |
|
357 | - $payment->set_gateway_response( $gateway_response ); |
|
358 | - $payment->set_details( $update_info ); |
|
359 | - $payment->set_txn_id_chq_nmbr( $update_info[ 'txn_id' ] ); |
|
355 | + $payment->set_status($status); |
|
356 | + $payment->set_amount((float) $update_info['mc_gross']); |
|
357 | + $payment->set_gateway_response($gateway_response); |
|
358 | + $payment->set_details($update_info); |
|
359 | + $payment->set_txn_id_chq_nmbr($update_info['txn_id']); |
|
360 | 360 | $this->log( |
361 | 361 | array( |
362 | - 'message' => esc_html__( 'Updated payment either from IPN or as part of POST from PayPal', 'event_espresso' ), |
|
362 | + 'message' => esc_html__('Updated payment either from IPN or as part of POST from PayPal', 'event_espresso'), |
|
363 | 363 | 'url' => $this->_process_response_url(), |
364 | 364 | 'payment' => $payment->model_field_array(), |
365 | 365 | 'IPN_data' => $update_info |
@@ -369,7 +369,7 @@ discard block |
||
369 | 369 | } |
370 | 370 | |
371 | 371 | } |
372 | - do_action( 'FHEE__EEG_Paypal_Standard__handle_payment_update__payment_processed', $payment, $this ); |
|
372 | + do_action('FHEE__EEG_Paypal_Standard__handle_payment_update__payment_processed', $payment, $this); |
|
373 | 373 | return $payment; |
374 | 374 | } |
375 | 375 | |
@@ -384,9 +384,9 @@ discard block |
||
384 | 384 | * @return boolean |
385 | 385 | * @throws \EE_Error |
386 | 386 | */ |
387 | - public function validate_ipn( $update_info, $payment ) { |
|
387 | + public function validate_ipn($update_info, $payment) { |
|
388 | 388 | //allow us to skip validating IPNs with PayPal (useful for testing) |
389 | - if ( apply_filters( 'FHEE__EEG_Paypal_Standard__validate_ipn__skip', false ) ) { |
|
389 | + if (apply_filters('FHEE__EEG_Paypal_Standard__validate_ipn__skip', false)) { |
|
390 | 390 | return true; |
391 | 391 | } |
392 | 392 | //...otherwise, we actually don't care what the $update_info is, we need to look |
@@ -394,22 +394,22 @@ discard block |
||
394 | 394 | // Reading POSTed data directly from $_POST causes serialization issues with array data in the POST. |
395 | 395 | // Instead, read raw POST data from the input stream. |
396 | 396 | // @see https://gist.github.com/xcommerce-gists/3440401 |
397 | - $raw_post_data = file_get_contents( 'php://input' ); |
|
398 | - $raw_post_array = explode( '&', $raw_post_data ); |
|
397 | + $raw_post_data = file_get_contents('php://input'); |
|
398 | + $raw_post_array = explode('&', $raw_post_data); |
|
399 | 399 | $update_info = array(); |
400 | - foreach ( $raw_post_array as $keyval ) { |
|
401 | - $keyval = explode( '=', $keyval ); |
|
402 | - if ( count( $keyval ) === 2 ) { |
|
403 | - $update_info[ $keyval[ 0 ] ] = urldecode( $keyval[ 1 ] ); |
|
400 | + foreach ($raw_post_array as $keyval) { |
|
401 | + $keyval = explode('=', $keyval); |
|
402 | + if (count($keyval) === 2) { |
|
403 | + $update_info[$keyval[0]] = urldecode($keyval[1]); |
|
404 | 404 | } |
405 | 405 | } |
406 | 406 | // read the IPN message sent from PayPal and prepend 'cmd=_notify-validate' |
407 | 407 | $req = 'cmd=_notify-validate'; |
408 | - $uses_get_magic_quotes = function_exists( 'get_magic_quotes_gpc' ) && get_magic_quotes_gpc() === 1 |
|
408 | + $uses_get_magic_quotes = function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc() === 1 |
|
409 | 409 | ? true |
410 | 410 | : false; |
411 | - foreach ( $update_info as $key => $value ) { |
|
412 | - $value = $uses_get_magic_quotes ? urlencode( stripslashes( $value ) ) : urlencode( $value ); |
|
411 | + foreach ($update_info as $key => $value) { |
|
412 | + $value = $uses_get_magic_quotes ? urlencode(stripslashes($value)) : urlencode($value); |
|
413 | 413 | $req .= "&$key=$value"; |
414 | 414 | } |
415 | 415 | // HTTP POST the complete, unaltered IPN back to PayPal |
@@ -418,38 +418,38 @@ discard block |
||
418 | 418 | array( |
419 | 419 | 'body' => $req, |
420 | 420 | 'sslverify' => false, |
421 | - 'timeout' => 60 , |
|
421 | + 'timeout' => 60, |
|
422 | 422 | // make sure to set a site specific unique "user-agent" string since the WordPres default gets declined by PayPal |
423 | 423 | // plz see: https://github.com/websharks/s2member/issues/610 |
424 | - 'user-agent' => 'Event Espresso v' . EVENT_ESPRESSO_VERSION . '; ' . home_url(), |
|
424 | + 'user-agent' => 'Event Espresso v'.EVENT_ESPRESSO_VERSION.'; '.home_url(), |
|
425 | 425 | 'httpversion' => '1.1' |
426 | 426 | ) |
427 | 427 | ); |
428 | 428 | // then check the response |
429 | 429 | if ( |
430 | - array_key_exists( 'body', $response ) |
|
431 | - && ! is_wp_error( $response ) |
|
432 | - && strcmp( $response[ 'body' ], "VERIFIED" ) === 0 |
|
430 | + array_key_exists('body', $response) |
|
431 | + && ! is_wp_error($response) |
|
432 | + && strcmp($response['body'], "VERIFIED") === 0 |
|
433 | 433 | ) { |
434 | 434 | return true; |
435 | 435 | } |
436 | 436 | // huh, something's wack... the IPN didn't validate. We must have replied to the IPN incorrectly, |
437 | 437 | // or their API must have changed: http://www.paypalobjects.com/en_US/ebook/PP_OrderManagement_IntegrationGuide/ipn.html |
438 | - if( $response instanceof WP_Error ) { |
|
438 | + if ($response instanceof WP_Error) { |
|
439 | 439 | $error_msg = sprintf( |
440 | - esc_html__( 'WP Error. Code: "%1$s", Message: "%2$s", Data: "%3$s"', 'event_espresso' ), |
|
440 | + esc_html__('WP Error. Code: "%1$s", Message: "%2$s", Data: "%3$s"', 'event_espresso'), |
|
441 | 441 | $response->get_error_code(), |
442 | 442 | $response->get_error_message(), |
443 | - print_r( $response->get_error_data(), true ) |
|
443 | + print_r($response->get_error_data(), true) |
|
444 | 444 | ); |
445 | - } elseif( is_array( $response ) && isset( $response[ 'body' ] ) ) { |
|
446 | - $error_msg = $response[ 'body' ]; |
|
445 | + } elseif (is_array($response) && isset($response['body'])) { |
|
446 | + $error_msg = $response['body']; |
|
447 | 447 | } else { |
448 | - $error_msg = print_r( $response, true ); |
|
448 | + $error_msg = print_r($response, true); |
|
449 | 449 | } |
450 | - $payment->set_gateway_response( sprintf( esc_html__( "IPN Validation failed! Paypal responded with '%s'", "event_espresso" ), $error_msg ) ); |
|
451 | - $payment->set_details( array( 'REQUEST' => $update_info, 'VALIDATION_RESPONSE' => $response ) ); |
|
452 | - $payment->set_status( EEM_Payment::status_id_failed ); |
|
450 | + $payment->set_gateway_response(sprintf(esc_html__("IPN Validation failed! Paypal responded with '%s'", "event_espresso"), $error_msg)); |
|
451 | + $payment->set_details(array('REQUEST' => $update_info, 'VALIDATION_RESPONSE' => $response)); |
|
452 | + $payment->set_status(EEM_Payment::status_id_failed); |
|
453 | 453 | // log the results |
454 | 454 | $this->log( |
455 | 455 | array( |
@@ -469,9 +469,9 @@ discard block |
||
469 | 469 | * @return string |
470 | 470 | */ |
471 | 471 | protected function _process_response_url() { |
472 | - if ( isset( $_SERVER[ 'HTTP_HOST' ], $_SERVER[ 'REQUEST_URI' ] ) ) { |
|
472 | + if (isset($_SERVER['HTTP_HOST'], $_SERVER['REQUEST_URI'])) { |
|
473 | 473 | $url = is_ssl() ? 'https://' : 'http://'; |
474 | - $url .= EEH_URL::filter_input_server_url( 'HTTP_HOST' ); |
|
474 | + $url .= EEH_URL::filter_input_server_url('HTTP_HOST'); |
|
475 | 475 | $url .= EEH_URL::filter_input_server_url(); |
476 | 476 | } else { |
477 | 477 | $url = 'unknown'; |
@@ -488,12 +488,12 @@ discard block |
||
488 | 488 | * @param EEI_Payment $payment |
489 | 489 | * @throws \EE_Error |
490 | 490 | */ |
491 | - public function update_txn_based_on_payment( $payment ) { |
|
491 | + public function update_txn_based_on_payment($payment) { |
|
492 | 492 | $update_info = $payment->details(); |
493 | 493 | /** @var EE_Transaction $transaction */ |
494 | 494 | $transaction = $payment->transaction(); |
495 | - $payment_was_itemized = $payment->get_extra_meta( EEG_Paypal_Standard::itemized_payment_option_name, true, false ); |
|
496 | - if( ! $transaction ){ |
|
495 | + $payment_was_itemized = $payment->get_extra_meta(EEG_Paypal_Standard::itemized_payment_option_name, true, false); |
|
496 | + if ( ! $transaction) { |
|
497 | 497 | $this->log( |
498 | 498 | esc_html__( |
499 | 499 | 'Payment with ID %d has no related transaction, and so update_txn_based_on_payment couldn\'t be executed properly', |
@@ -503,10 +503,10 @@ discard block |
||
503 | 503 | ); |
504 | 504 | return; |
505 | 505 | } |
506 | - if( |
|
507 | - ! is_array( $update_info ) |
|
508 | - || ! isset( $update_info[ 'mc_shipping' ] ) |
|
509 | - || ! isset( $update_info[ 'tax' ] ) |
|
506 | + if ( |
|
507 | + ! is_array($update_info) |
|
508 | + || ! isset($update_info['mc_shipping']) |
|
509 | + || ! isset($update_info['tax']) |
|
510 | 510 | ) { |
511 | 511 | $this->log( |
512 | 512 | array( |
@@ -521,7 +521,7 @@ discard block |
||
521 | 521 | ); |
522 | 522 | return; |
523 | 523 | } |
524 | - if( $payment->status() !== $this->_pay_model->approved_status() ) { |
|
524 | + if ($payment->status() !== $this->_pay_model->approved_status()) { |
|
525 | 525 | $this->log( |
526 | 526 | array( |
527 | 527 | 'message' => esc_html__( |
@@ -540,44 +540,44 @@ discard block |
||
540 | 540 | $transaction_total_line_item = $transaction->total_line_item(); |
541 | 541 | |
542 | 542 | //might paypal have changed the taxes? |
543 | - if( $this->_paypal_taxes && $payment_was_itemized ) { |
|
543 | + if ($this->_paypal_taxes && $payment_was_itemized) { |
|
544 | 544 | // note that we're doing this BEFORE adding shipping; |
545 | 545 | // we actually want PayPal's shipping to remain non-taxable |
546 | - $this->_line_item->set_line_items_taxable( $transaction_total_line_item, true, 'paypal_shipping' ); |
|
546 | + $this->_line_item->set_line_items_taxable($transaction_total_line_item, true, 'paypal_shipping'); |
|
547 | 547 | $this->_line_item->set_total_tax_to( |
548 | 548 | $transaction_total_line_item, |
549 | - (float)$update_info['tax'], |
|
550 | - esc_html__( 'Taxes', 'event_espresso' ), |
|
551 | - esc_html__( 'Calculated by Paypal', 'event_espresso' ), |
|
549 | + (float) $update_info['tax'], |
|
550 | + esc_html__('Taxes', 'event_espresso'), |
|
551 | + esc_html__('Calculated by Paypal', 'event_espresso'), |
|
552 | 552 | 'paypal_tax' |
553 | 553 | ); |
554 | 554 | $grand_total_needs_resaving = TRUE; |
555 | 555 | } |
556 | 556 | |
557 | - $shipping_amount = (float)$update_info[ 'mc_shipping' ]; |
|
557 | + $shipping_amount = (float) $update_info['mc_shipping']; |
|
558 | 558 | //might paypal have added shipping? |
559 | - if( $this->_paypal_shipping && $shipping_amount && $payment_was_itemized ){ |
|
559 | + if ($this->_paypal_shipping && $shipping_amount && $payment_was_itemized) { |
|
560 | 560 | $this->_line_item->add_unrelated_item( |
561 | 561 | $transaction_total_line_item, |
562 | - sprintf( esc_html__('Shipping for transaction %1$s', 'event_espresso'), $transaction->ID() ), |
|
562 | + sprintf(esc_html__('Shipping for transaction %1$s', 'event_espresso'), $transaction->ID()), |
|
563 | 563 | $shipping_amount, |
564 | 564 | esc_html__('Shipping charges calculated by Paypal', 'event_espresso'), |
565 | 565 | 1, |
566 | 566 | false, |
567 | - 'paypal_shipping_' . $transaction->ID() |
|
567 | + 'paypal_shipping_'.$transaction->ID() |
|
568 | 568 | ); |
569 | 569 | $grand_total_needs_resaving = true; |
570 | 570 | } |
571 | 571 | |
572 | - if( $grand_total_needs_resaving ){ |
|
573 | - $transaction_total_line_item->save_this_and_descendants_to_txn( $transaction->ID() ); |
|
572 | + if ($grand_total_needs_resaving) { |
|
573 | + $transaction_total_line_item->save_this_and_descendants_to_txn($transaction->ID()); |
|
574 | 574 | /** @var EE_Registration_Processor $registration_processor */ |
575 | - $registration_processor = EE_Registry::instance()->load_class( 'Registration_Processor' ); |
|
576 | - $registration_processor->update_registration_final_prices( $transaction ); |
|
575 | + $registration_processor = EE_Registry::instance()->load_class('Registration_Processor'); |
|
576 | + $registration_processor->update_registration_final_prices($transaction); |
|
577 | 577 | } |
578 | 578 | $this->log( |
579 | 579 | array( |
580 | - 'message' => esc_html__( 'Updated transaction related to payment', 'event_espresso' ), |
|
580 | + 'message' => esc_html__('Updated transaction related to payment', 'event_espresso'), |
|
581 | 581 | 'url' => $this->_process_response_url(), |
582 | 582 | 'transaction (updated)' => $transaction->model_field_array(), |
583 | 583 | 'payment (updated)' => $payment->model_field_array(), |
@@ -2,7 +2,7 @@ discard block |
||
2 | 2 | namespace EventEspresso\core\exceptions; |
3 | 3 | |
4 | 4 | if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
5 | - exit('No direct script access allowed'); |
|
5 | + exit('No direct script access allowed'); |
|
6 | 6 | } |
7 | 7 | |
8 | 8 | |
@@ -21,71 +21,71 @@ discard block |
||
21 | 21 | class IpnException extends \LogicException |
22 | 22 | { |
23 | 23 | |
24 | - const DUPLICATE = 1; |
|
24 | + const DUPLICATE = 1; |
|
25 | 25 | |
26 | - const UNABLE_TO_VALIDATE = 2; |
|
26 | + const UNABLE_TO_VALIDATE = 2; |
|
27 | 27 | |
28 | - const UNSUPPORTED = 3; |
|
28 | + const UNSUPPORTED = 3; |
|
29 | 29 | |
30 | - /** |
|
31 | - * @var \EE_Payment |
|
32 | - */ |
|
33 | - protected $payment; |
|
30 | + /** |
|
31 | + * @var \EE_Payment |
|
32 | + */ |
|
33 | + protected $payment; |
|
34 | 34 | |
35 | - /** |
|
36 | - * @var mixed IPN data, usually an array or object |
|
37 | - */ |
|
38 | - protected $ipn_data; |
|
35 | + /** |
|
36 | + * @var mixed IPN data, usually an array or object |
|
37 | + */ |
|
38 | + protected $ipn_data; |
|
39 | 39 | |
40 | 40 | |
41 | 41 | |
42 | - public function __construct( |
|
43 | - $message, |
|
44 | - $code = 0, |
|
45 | - \Exception $previous = null, |
|
46 | - \EE_Payment $payment = null, |
|
47 | - $ipn_data = array() |
|
48 | - ) { |
|
49 | - parent::__construct($message, $code, $previous); |
|
50 | - $this->payment = $payment; |
|
51 | - $this->ipn_data = $ipn_data; |
|
52 | - } |
|
42 | + public function __construct( |
|
43 | + $message, |
|
44 | + $code = 0, |
|
45 | + \Exception $previous = null, |
|
46 | + \EE_Payment $payment = null, |
|
47 | + $ipn_data = array() |
|
48 | + ) { |
|
49 | + parent::__construct($message, $code, $previous); |
|
50 | + $this->payment = $payment; |
|
51 | + $this->ipn_data = $ipn_data; |
|
52 | + } |
|
53 | 53 | |
54 | 54 | |
55 | 55 | |
56 | - /** |
|
57 | - * Gets the payment associated with this IPN, if known |
|
58 | - * |
|
59 | - * @return \EE_Payment |
|
60 | - */ |
|
61 | - public function getPayment() |
|
62 | - { |
|
63 | - return $this->payment; |
|
64 | - } |
|
56 | + /** |
|
57 | + * Gets the payment associated with this IPN, if known |
|
58 | + * |
|
59 | + * @return \EE_Payment |
|
60 | + */ |
|
61 | + public function getPayment() |
|
62 | + { |
|
63 | + return $this->payment; |
|
64 | + } |
|
65 | 65 | |
66 | 66 | |
67 | 67 | |
68 | - /** |
|
69 | - * Returns the payment's properties as an array (even if there is no payment, in which case it's an empty array) |
|
70 | - * |
|
71 | - * @return array |
|
72 | - * @throws \EE_Error |
|
73 | - */ |
|
74 | - public function getPaymentProperties() |
|
75 | - { |
|
76 | - return $this->getPayment() instanceof \EE_Payment ? $this->getPayment()->model_field_array() : array(); |
|
77 | - } |
|
68 | + /** |
|
69 | + * Returns the payment's properties as an array (even if there is no payment, in which case it's an empty array) |
|
70 | + * |
|
71 | + * @return array |
|
72 | + * @throws \EE_Error |
|
73 | + */ |
|
74 | + public function getPaymentProperties() |
|
75 | + { |
|
76 | + return $this->getPayment() instanceof \EE_Payment ? $this->getPayment()->model_field_array() : array(); |
|
77 | + } |
|
78 | 78 | |
79 | 79 | |
80 | 80 | |
81 | - /** |
|
82 | - * Returns an array, object, or string, however, the IPN data was received |
|
83 | - * |
|
84 | - * @return mixed |
|
85 | - */ |
|
86 | - public function getIpnData() |
|
87 | - { |
|
88 | - return $this->ipn_data; |
|
89 | - } |
|
81 | + /** |
|
82 | + * Returns an array, object, or string, however, the IPN data was received |
|
83 | + * |
|
84 | + * @return mixed |
|
85 | + */ |
|
86 | + public function getIpnData() |
|
87 | + { |
|
88 | + return $this->ipn_data; |
|
89 | + } |
|
90 | 90 | |
91 | 91 | } |
92 | 92 | \ No newline at end of file |
@@ -1,8 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | use EventEspresso\modules\invalid_checkout_access\InvalidCheckoutAccess; |
3 | 3 | |
4 | -if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
5 | - exit( 'No direct script access allowed' ); |
|
4 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
5 | + exit('No direct script access allowed'); |
|
6 | 6 | } |
7 | 7 | |
8 | 8 | |
@@ -36,12 +36,12 @@ discard block |
||
36 | 36 | public static function set_hooks_admin() { |
37 | 37 | add_action( |
38 | 38 | 'AHEE__Extend_Registration_Form_Admin_Page___reg_form_settings_template', |
39 | - array( 'EED_Invalid_Checkout_Access', 'display_invalid_checkout_access_form' ), |
|
39 | + array('EED_Invalid_Checkout_Access', 'display_invalid_checkout_access_form'), |
|
40 | 40 | 15 |
41 | 41 | ); |
42 | 42 | add_filter( |
43 | 43 | 'FHEE__Extend_Registration_Form_Admin_Page___update_reg_form_settings__CFG_registration', |
44 | - array( 'EED_Invalid_Checkout_Access', 'process_invalid_checkout_access_form' ) |
|
44 | + array('EED_Invalid_Checkout_Access', 'process_invalid_checkout_access_form') |
|
45 | 45 | ); |
46 | 46 | } |
47 | 47 | |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | * |
54 | 54 | * @var WP $WP |
55 | 55 | */ |
56 | - public function run( $WP ) { |
|
56 | + public function run($WP) { |
|
57 | 57 | // TODO: Implement run() method. |
58 | 58 | } |
59 | 59 | |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | * @return InvalidCheckoutAccess |
64 | 64 | */ |
65 | 65 | public static function getInvalidCheckoutAccess() { |
66 | - if ( ! self::$invalid_checkout_access_form instanceof InvalidCheckoutAccess ) { |
|
66 | + if ( ! self::$invalid_checkout_access_form instanceof InvalidCheckoutAccess) { |
|
67 | 67 | self::$invalid_checkout_access_form = new InvalidCheckoutAccess(); |
68 | 68 | } |
69 | 69 | return self::$invalid_checkout_access_form; |
@@ -90,9 +90,9 @@ discard block |
||
90 | 90 | * @param \EE_Registration_Config $EE_Registration_Config |
91 | 91 | * @return \EE_Registration_Config |
92 | 92 | */ |
93 | - public static function process_invalid_checkout_access_form( \EE_Registration_Config $EE_Registration_Config ) { |
|
93 | + public static function process_invalid_checkout_access_form(\EE_Registration_Config $EE_Registration_Config) { |
|
94 | 94 | $invalid_checkout_access_form = \EED_Invalid_Checkout_Access::getInvalidCheckoutAccess(); |
95 | - return $invalid_checkout_access_form->processForm( $EE_Registration_Config ); |
|
95 | + return $invalid_checkout_access_form->processForm($EE_Registration_Config); |
|
96 | 96 | } |
97 | 97 | |
98 | 98 |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | namespace EventEspresso\core\exceptions; |
3 | 3 | |
4 | -defined( 'ABSPATH' ) || exit; |
|
4 | +defined('ABSPATH') || exit; |
|
5 | 5 | |
6 | 6 | |
7 | 7 | |
@@ -22,11 +22,11 @@ discard block |
||
22 | 22 | * @param int $code |
23 | 23 | * @param \Exception $previous |
24 | 24 | */ |
25 | - public function __construct( $message = '', $code = 0, \Exception $previous = null ) { |
|
26 | - if ( empty( $message ) ) { |
|
27 | - $message = esc_html__( 'The session data is either missing or invalid.', 'event_espresso' ); |
|
25 | + public function __construct($message = '', $code = 0, \Exception $previous = null) { |
|
26 | + if (empty($message)) { |
|
27 | + $message = esc_html__('The session data is either missing or invalid.', 'event_espresso'); |
|
28 | 28 | } |
29 | - parent::__construct( $message, $code, $previous ); |
|
29 | + parent::__construct($message, $code, $previous); |
|
30 | 30 | } |
31 | 31 | |
32 | 32 |
@@ -1,3 +1,3 @@ |
||
1 | 1 | <div class="padding"> |
2 | - <p><?php printf( esc_html__( 'Check out the %1$sroadmap for Event Espresso%2$s.', 'event_espresso' ), '<a href="https://trello.com/b/zg9DCIpe/event-espresso-public-roadmap" target="_blank">','</a>' ); ?></p> |
|
2 | + <p><?php printf(esc_html__('Check out the %1$sroadmap for Event Espresso%2$s.', 'event_espresso'), '<a href="https://trello.com/b/zg9DCIpe/event-espresso-public-roadmap" target="_blank">', '</a>'); ?></p> |
|
3 | 3 | </div> |
4 | 4 | \ No newline at end of file |
@@ -1,7 +1,7 @@ |
||
1 | 1 | <div class="padding"> |
2 | - <h3><?php esc_html_e( 'Frequently Asked Questions about Event Espresso', 'event_espresso' ); ?></h3> |
|
2 | + <h3><?php esc_html_e('Frequently Asked Questions about Event Espresso', 'event_espresso'); ?></h3> |
|
3 | 3 | |
4 | - <h4><?php esc_html_e( 'New to Event Espresso?', 'event_espresso' ); ?></h4> |
|
4 | + <h4><?php esc_html_e('New to Event Espresso?', 'event_espresso'); ?></h4> |
|
5 | 5 | |
6 | - <p><?php printf( esc_html__( 'Check out the %1$squick start guide for Event Espresso 4%2$s. It has recommendations, tips, and tutorials so you can get your project started %3$squicker%4$s.', 'event_espresso' ), '<a href="https://eventespresso.com/wiki/welcome-to-event-espresso/#event-espresso-4" target="_blank">','</a>','<em>','</em>' ); ?></p> |
|
6 | + <p><?php printf(esc_html__('Check out the %1$squick start guide for Event Espresso 4%2$s. It has recommendations, tips, and tutorials so you can get your project started %3$squicker%4$s.', 'event_espresso'), '<a href="https://eventespresso.com/wiki/welcome-to-event-espresso/#event-espresso-4" target="_blank">', '</a>', '<em>', '</em>'); ?></p> |
|
7 | 7 | </div> |
8 | 8 | \ No newline at end of file |
@@ -3,33 +3,33 @@ |
||
3 | 3 | global $post; |
4 | 4 | ?> |
5 | 5 | <div class="event-content"> |
6 | -<?php if ( apply_filters( 'FHEE__content_espresso_events_details_template__display_entry_meta', TRUE )): ?> |
|
6 | +<?php if (apply_filters('FHEE__content_espresso_events_details_template__display_entry_meta', TRUE)): ?> |
|
7 | 7 | <div class="entry-meta"> |
8 | - <span class="tags-links"><?php espresso_event_categories( $post->ID, TRUE, TRUE ); ?></span> |
|
8 | + <span class="tags-links"><?php espresso_event_categories($post->ID, TRUE, TRUE); ?></span> |
|
9 | 9 | <?php |
10 | - if ( ! post_password_required() && ( comments_open() || get_comments_number() ) ) : |
|
10 | + if ( ! post_password_required() && (comments_open() || get_comments_number())) : |
|
11 | 11 | ?> |
12 | - <span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'event_espresso' ), __( '1 Comment', 'event_espresso' ), __( '% Comments', 'event_espresso' ) ); ?></span> |
|
12 | + <span class="comments-link"><?php comments_popup_link(__('Leave a comment', 'event_espresso'), __('1 Comment', 'event_espresso'), __('% Comments', 'event_espresso')); ?></span> |
|
13 | 13 | <?php |
14 | 14 | endif; |
15 | - edit_post_link( __( 'Edit', 'event_espresso' ), '<span class="edit-link">', '</span>' ); |
|
15 | + edit_post_link(__('Edit', 'event_espresso'), '<span class="edit-link">', '</span>'); |
|
16 | 16 | ?> |
17 | 17 | </div> |
18 | 18 | <?php endif; |
19 | - $event_phone = espresso_event_phone( $post->ID, FALSE ); |
|
20 | - if ( $event_phone != '' ) : ?> |
|
19 | + $event_phone = espresso_event_phone($post->ID, FALSE); |
|
20 | + if ($event_phone != '') : ?> |
|
21 | 21 | <p> |
22 | - <span class="small-text"><strong><?php _e( 'Event Phone:', 'event_espresso' ); ?> </strong></span> <?php echo $event_phone; ?> |
|
22 | + <span class="small-text"><strong><?php _e('Event Phone:', 'event_espresso'); ?> </strong></span> <?php echo $event_phone; ?> |
|
23 | 23 | </p> |
24 | -<?php endif; ?> |
|
24 | +<?php endif; ?> |
|
25 | 25 | <?php |
26 | - if ( apply_filters( 'FHEE__content_espresso_events_details_template__display_the_content', true ) ) { |
|
27 | - do_action( 'AHEE_event_details_before_the_content', $post ); |
|
26 | + if (apply_filters('FHEE__content_espresso_events_details_template__display_the_content', true)) { |
|
27 | + do_action('AHEE_event_details_before_the_content', $post); |
|
28 | 28 | echo apply_filters( |
29 | 29 | 'FHEE__content_espresso_events_details_template__the_content', |
30 | - espresso_event_content_or_excerpt( 55, null, false ) |
|
30 | + espresso_event_content_or_excerpt(55, null, false) |
|
31 | 31 | ); |
32 | - do_action( 'AHEE_event_details_after_the_content', $post ); |
|
32 | + do_action('AHEE_event_details_after_the_content', $post); |
|
33 | 33 | } |
34 | 34 | ?> |
35 | 35 | </div> |