@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | * @return EED_Venue_Single |
28 | 28 | */ |
29 | 29 | public static function instance() { |
30 | - return parent::get_instance( __CLASS__ ); |
|
30 | + return parent::get_instance(__CLASS__); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | /** |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | * @return void |
38 | 38 | */ |
39 | 39 | public static function set_hooks() { |
40 | - EE_Config::register_route( 'venue', 'Venue_Single', 'run' ); |
|
40 | + EE_Config::register_route('venue', 'Venue_Single', 'run'); |
|
41 | 41 | // EE_Config::register_view( 'venue', 0, EE_TEMPLATES . EE_Config::get_current_theme() . DS . 'single-espresso_venues.php' ); |
42 | 42 | } |
43 | 43 | |
@@ -58,10 +58,10 @@ discard block |
||
58 | 58 | * @access public |
59 | 59 | * @return void |
60 | 60 | */ |
61 | - public function run( $WP ) { |
|
61 | + public function run($WP) { |
|
62 | 62 | // check what template is loaded |
63 | - add_filter( 'template_include', array( $this, 'template_include' ), 999, 1 ); |
|
64 | - add_action('wp_enqueue_scripts', array( $this, 'wp_enqueue_scripts' ), 10 ); |
|
63 | + add_filter('template_include', array($this, 'template_include'), 999, 1); |
|
64 | + add_action('wp_enqueue_scripts', array($this, 'wp_enqueue_scripts'), 10); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | |
@@ -72,16 +72,16 @@ discard block |
||
72 | 72 | * @access public |
73 | 73 | * @return void |
74 | 74 | */ |
75 | - public function template_include( $template ) { |
|
75 | + public function template_include($template) { |
|
76 | 76 | // not a custom template? |
77 | - if ( EE_Front_Controller::instance()->get_selected_template() != 'single-espresso_venues.php' ) { |
|
77 | + if (EE_Front_Controller::instance()->get_selected_template() != 'single-espresso_venues.php') { |
|
78 | 78 | EEH_Template::load_espresso_theme_functions(); |
79 | 79 | // then add extra event data via hooks |
80 | - add_filter( 'the_title', array( $this, 'the_title' ), 100, 2 ); |
|
81 | - add_filter( 'the_content', array( $this, 'venue_details' ), 100 ); |
|
82 | - add_filter( 'the_content', array( $this, 'venue_location' ), 110 ); |
|
80 | + add_filter('the_title', array($this, 'the_title'), 100, 2); |
|
81 | + add_filter('the_content', array($this, 'venue_details'), 100); |
|
82 | + add_filter('the_content', array($this, 'venue_location'), 110); |
|
83 | 83 | // don't diplay entry meta because the existing theme will take car of that |
84 | - add_filter( 'FHEE__content_espresso_venues_details_template__display_entry_meta', '__return_false' ); |
|
84 | + add_filter('FHEE__content_espresso_venues_details_template__display_entry_meta', '__return_false'); |
|
85 | 85 | } |
86 | 86 | return $template; |
87 | 87 | } |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | * @param string $title |
96 | 96 | * @return void |
97 | 97 | */ |
98 | - public function the_title( $title = '', $id = '' ) { |
|
98 | + public function the_title($title = '', $id = '') { |
|
99 | 99 | return $title; |
100 | 100 | // global $post; |
101 | 101 | // return in_the_loop() && $post->ID == $id ? espresso_event_status_banner( $post->ID ) . $title : $title; |
@@ -109,17 +109,17 @@ discard block |
||
109 | 109 | * @param string $content |
110 | 110 | * @return void |
111 | 111 | */ |
112 | - public function venue_details( $content ) { |
|
112 | + public function venue_details($content) { |
|
113 | 113 | global $post; |
114 | 114 | // since the 'content-espresso_venues-details.php' template might be used directly from within a theme, |
115 | 115 | // it uses the_content() for displaying the $post->post_content |
116 | 116 | // so in order to load a template that uses the_content() from within a callback being used to filter the_content(), |
117 | 117 | // we need to first remove this callback from being applied to the_content() (otherwise it will recurse and blow up the interweb) |
118 | - remove_filter( 'the_content', array( $this, 'venue_details' ), 100 ); |
|
118 | + remove_filter('the_content', array($this, 'venue_details'), 100); |
|
119 | 119 | // now load our template |
120 | - $template = EEH_Template::locate_template( 'content-espresso_venues-details.php' ); |
|
120 | + $template = EEH_Template::locate_template('content-espresso_venues-details.php'); |
|
121 | 121 | // we're not returning the $content directly because the template we are loading uses the_content (or the_excerpt) |
122 | - return ! empty( $template ) ? $template : $content; |
|
122 | + return ! empty($template) ? $template : $content; |
|
123 | 123 | } |
124 | 124 | |
125 | 125 | |
@@ -131,8 +131,8 @@ discard block |
||
131 | 131 | * @param string $content |
132 | 132 | * @return void |
133 | 133 | */ |
134 | - public function venue_location( $content ) { |
|
135 | - return $content . EEH_Template::locate_template( 'content-espresso_venues-location.php' ); |
|
134 | + public function venue_location($content) { |
|
135 | + return $content.EEH_Template::locate_template('content-espresso_venues-location.php'); |
|
136 | 136 | } |
137 | 137 | |
138 | 138 | |
@@ -145,23 +145,23 @@ discard block |
||
145 | 145 | */ |
146 | 146 | public function wp_enqueue_scripts() { |
147 | 147 | // get some style |
148 | - if ( apply_filters( 'FHEE_enable_default_espresso_css', TRUE ) && is_single() ) { |
|
148 | + if (apply_filters('FHEE_enable_default_espresso_css', TRUE) && is_single()) { |
|
149 | 149 | // first check theme folder |
150 | - if ( is_readable( get_stylesheet_directory() . $this->theme . DS . 'style.css' )) { |
|
151 | - wp_register_style( $this->theme, get_stylesheet_directory_uri() . $this->theme . DS . 'style.css', array( 'dashicons', 'espresso_default' ) ); |
|
152 | - } else if ( is_readable( EE_TEMPLATES . $this->theme . DS . 'style.css' )) { |
|
153 | - wp_register_style( $this->theme, EE_TEMPLATES_URL . $this->theme . DS . 'style.css', array( 'dashicons', 'espresso_default' ) ); |
|
150 | + if (is_readable(get_stylesheet_directory().$this->theme.DS.'style.css')) { |
|
151 | + wp_register_style($this->theme, get_stylesheet_directory_uri().$this->theme.DS.'style.css', array('dashicons', 'espresso_default')); |
|
152 | + } else if (is_readable(EE_TEMPLATES.$this->theme.DS.'style.css')) { |
|
153 | + wp_register_style($this->theme, EE_TEMPLATES_URL.$this->theme.DS.'style.css', array('dashicons', 'espresso_default')); |
|
154 | 154 | } |
155 | 155 | // if ( is_readable( get_stylesheet_directory() . EE_Config::get_current_theme() . DS . 'single-espresso_venues.js' )) { |
156 | 156 | // wp_register_script( 'single-espresso_venues', get_stylesheet_directory_uri() . EE_Config::get_current_theme() . DS . 'single-espresso_venues.js', array('espresso_core'), '1.0', TRUE ); |
157 | 157 | // } else if ( is_readable( EE_TEMPLATES . EE_Config::get_current_theme() . DS . 'single-espresso_venues.js' )) { |
158 | 158 | // wp_register_script( 'single-espresso_venues', EE_TEMPLATES_URL . EE_Config::get_current_theme() . DS . 'single-espresso_venues.js', array('espresso_core'), '1.0', TRUE ); |
159 | 159 | // } |
160 | - wp_enqueue_style( $this->theme ); |
|
160 | + wp_enqueue_style($this->theme); |
|
161 | 161 | // wp_enqueue_script( 'single-espresso_venues' ); |
162 | - if ( EE_Registry::instance()->CFG->map_settings->use_google_maps ) { |
|
163 | - EE_Registry::instance()->load_helper( 'Maps' ); |
|
164 | - add_action('wp_enqueue_scripts', array( 'EEH_Maps', 'espresso_google_map_js' ), 11 ); |
|
162 | + if (EE_Registry::instance()->CFG->map_settings->use_google_maps) { |
|
163 | + EE_Registry::instance()->load_helper('Maps'); |
|
164 | + add_action('wp_enqueue_scripts', array('EEH_Maps', 'espresso_google_map_js'), 11); |
|
165 | 165 | } |
166 | 166 | } |
167 | 167 | } |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | * |
98 | 98 | * @access public |
99 | 99 | * @param string $title |
100 | - * @return void |
|
100 | + * @return string |
|
101 | 101 | */ |
102 | 102 | public function the_title( $title = '', $id = '' ) { |
103 | 103 | return $title; |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | * |
138 | 138 | * @access public |
139 | 139 | * @param string $content |
140 | - * @return void |
|
140 | + * @return string |
|
141 | 141 | */ |
142 | 142 | public function venue_location( $content ) { |
143 | 143 | return $content . EEH_Template::locate_template( 'content-espresso_venues-location.php' ); |
@@ -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 | * Event Espresso |
4 | 6 | * |
@@ -2,16 +2,16 @@ |
||
2 | 2 | if (!defined('EVENT_ESPRESSO_VERSION')) |
3 | 3 | exit('No direct script access allowed'); |
4 | 4 | /** |
5 | - * |
|
6 | - * EE_PMT_Admin_Only. |
|
7 | - * These payment methods really shouldn't be shown on frontend and contain nearly no functionality. |
|
8 | - * They should just be used admin-side for recording payments like Cash, Check, etc. |
|
9 | - * |
|
10 | - * @package Event Espresso |
|
11 | - * @subpackage |
|
12 | - * @author Mike Nelson |
|
13 | - * |
|
14 | - */ |
|
5 | + * |
|
6 | + * EE_PMT_Admin_Only. |
|
7 | + * These payment methods really shouldn't be shown on frontend and contain nearly no functionality. |
|
8 | + * They should just be used admin-side for recording payments like Cash, Check, etc. |
|
9 | + * |
|
10 | + * @package Event Espresso |
|
11 | + * @subpackage |
|
12 | + * @author Mike Nelson |
|
13 | + * |
|
14 | + */ |
|
15 | 15 | class EE_PMT_Admin_Only extends EE_PMT_Base{ |
16 | 16 | |
17 | 17 |
@@ -1,5 +1,5 @@ discard block |
||
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 | * |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | * @author Mike Nelson |
13 | 13 | * |
14 | 14 | */ |
15 | -class EE_PMT_Admin_Only extends EE_PMT_Base{ |
|
15 | +class EE_PMT_Admin_Only extends EE_PMT_Base { |
|
16 | 16 | |
17 | 17 | |
18 | 18 | |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | * @param \EE_Transaction $transaction |
35 | 35 | * @return NULL |
36 | 36 | */ |
37 | - public function generate_new_billing_form( EE_Transaction $transaction = NULL ) { |
|
37 | + public function generate_new_billing_form(EE_Transaction $transaction = NULL) { |
|
38 | 38 | return NULL; |
39 | 39 | } |
40 | 40 |
@@ -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 | * Event Espresso |
7 | 8 | * |
@@ -3,27 +3,27 @@ |
||
3 | 3 | if (!defined('EVENT_ESPRESSO_VERSION')) |
4 | 4 | exit('No direct script access allowed'); |
5 | 5 | /** |
6 | - * Event Espresso |
|
7 | - * |
|
8 | - * Event Registration and Management Plugin for WordPress |
|
9 | - * |
|
10 | - * @ package Event Espresso |
|
11 | - * @ author Seth Shoultes |
|
12 | - * @ copyright (c) 2008-2011 Event Espresso All Rights Reserved. |
|
13 | - * @ license http://eventespresso.com/support/terms-conditions/ * see Plugin Licensing * |
|
14 | - * @ link http://www.eventespresso.com |
|
15 | - * @ version 4.3 |
|
16 | - * |
|
17 | - * ------------------------------------------------------------------------ |
|
18 | - * |
|
19 | - * bank_payment_overview_content |
|
20 | - * |
|
21 | - * @package Event Espresso |
|
22 | - * @subpackage |
|
23 | - * @author Mike Nelson |
|
24 | - * |
|
25 | - * ------------------------------------------------------------------------ |
|
26 | - */ |
|
6 | + * Event Espresso |
|
7 | + * |
|
8 | + * Event Registration and Management Plugin for WordPress |
|
9 | + * |
|
10 | + * @ package Event Espresso |
|
11 | + * @ author Seth Shoultes |
|
12 | + * @ copyright (c) 2008-2011 Event Espresso All Rights Reserved. |
|
13 | + * @ license http://eventespresso.com/support/terms-conditions/ * see Plugin Licensing * |
|
14 | + * @ link http://www.eventespresso.com |
|
15 | + * @ version 4.3 |
|
16 | + * |
|
17 | + * ------------------------------------------------------------------------ |
|
18 | + * |
|
19 | + * bank_payment_overview_content |
|
20 | + * |
|
21 | + * @package Event Espresso |
|
22 | + * @subpackage |
|
23 | + * @author Mike Nelson |
|
24 | + * |
|
25 | + * ------------------------------------------------------------------------ |
|
26 | + */ |
|
27 | 27 | ?><div class="event-display-boxes"> |
28 | 28 | <h4 id="page_title" class="payment_type_title section-heading"><?php echo $page_title ?></h4> |
29 | 29 | <p class="instruct"><?php echo wpautop( $payment_instructions ) ?></p> |
@@ -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 | * Event Espresso |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | */ |
27 | 27 | ?><div class="event-display-boxes"> |
28 | 28 | <h4 id="page_title" class="payment_type_title section-heading"><?php echo $page_title ?></h4> |
29 | - <p class="instruct"><?php echo wpautop( $payment_instructions ) ?></p> |
|
29 | + <p class="instruct"><?php echo wpautop($payment_instructions) ?></p> |
|
30 | 30 | </div> |
31 | 31 | <?php |
32 | 32 | // End of file bank_payment_overview_content.template.php |
33 | 33 | \ No newline at end of file |
@@ -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 | * Event Espresso |
7 | 8 | * |
@@ -1,7 +1,8 @@ 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 | 7 | /** |
7 | 8 | * Event Espresso |
@@ -69,7 +70,7 @@ discard block |
||
69 | 70 | $default_address .= $state ? $state->name() . '<br />' : ''; |
70 | 71 | $default_address .= $country ? $country->name(). '<br />' : ''; |
71 | 72 | $default_address .= $organization->zip != '' ? $organization->get_pretty( 'zip' ) : ''; |
72 | - }else{ |
|
73 | + } else{ |
|
73 | 74 | $default_address = 'unknown'; |
74 | 75 | $organization_name = 'unknown'; |
75 | 76 | } |
@@ -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,7 +25,7 @@ discard block |
||
25 | 25 | * |
26 | 26 | * ------------------------------------------------------------------------ |
27 | 27 | */ |
28 | -class EE_PMT_Check extends EE_PMT_Base{ |
|
28 | +class EE_PMT_Check extends EE_PMT_Base { |
|
29 | 29 | |
30 | 30 | |
31 | 31 | /** |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | */ |
35 | 35 | public function __construct($pm_instance = NULL) { |
36 | 36 | $this->_pretty_name = __("Check", 'event_espresso'); |
37 | - $this->_default_description = __( 'After clicking "Finalize Registration", you will be given instructions on how to complete your payment.', 'event_espresso' ); |
|
37 | + $this->_default_description = __('After clicking "Finalize Registration", you will be given instructions on how to complete your payment.', 'event_espresso'); |
|
38 | 38 | parent::__construct($pm_instance); |
39 | 39 | $this->_default_button_url = $this->file_url().'lib'.DS.'check-logo.png'; |
40 | 40 | } |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | * @param \EE_Transaction $transaction |
47 | 47 | * @return NULL |
48 | 48 | */ |
49 | - public function generate_new_billing_form( EE_Transaction $transaction = NULL ) { |
|
49 | + public function generate_new_billing_form(EE_Transaction $transaction = NULL) { |
|
50 | 50 | return NULL; |
51 | 51 | } |
52 | 52 | |
@@ -57,41 +57,41 @@ discard block |
||
57 | 57 | * @return EE_Form_Section_Proper |
58 | 58 | */ |
59 | 59 | public function generate_new_settings_form() { |
60 | - if ( EE_Maintenance_Mode::instance()->level() != EE_Maintenance_Mode::level_2_complete_maintenance){ |
|
60 | + if (EE_Maintenance_Mode::instance()->level() != EE_Maintenance_Mode::level_2_complete_maintenance) { |
|
61 | 61 | $organization = EE_Registry::instance()->CFG->organization; |
62 | - $organization_name = $organization->get_pretty( 'name' ); |
|
63 | - $default_address = $organization->address_1 != '' ? $organization->get_pretty( 'address_1' ) . '<br />' : ''; |
|
64 | - $default_address .= $organization->address_2 != '' ? $organization->get_pretty( 'address_2' ) . '<br />' : ''; |
|
65 | - $default_address .= $organization->city != '' ? $organization->get_pretty( 'city' ) : ''; |
|
66 | - $default_address .= ( $organization->city != '' && $organization->STA_ID != '') ? ', ' : '<br />'; |
|
67 | - $state = EE_Registry::instance()->load_model( 'State' )->get_one_by_ID( $organization->STA_ID ); |
|
68 | - $country = EE_Registry::instance()->load_model( 'Country' )->get_one_by_ID( $organization->CNT_ISO ) ; |
|
69 | - $default_address .= $state ? $state->name() . '<br />' : ''; |
|
70 | - $default_address .= $country ? $country->name(). '<br />' : ''; |
|
71 | - $default_address .= $organization->zip != '' ? $organization->get_pretty( 'zip' ) : ''; |
|
72 | - }else{ |
|
62 | + $organization_name = $organization->get_pretty('name'); |
|
63 | + $default_address = $organization->address_1 != '' ? $organization->get_pretty('address_1').'<br />' : ''; |
|
64 | + $default_address .= $organization->address_2 != '' ? $organization->get_pretty('address_2').'<br />' : ''; |
|
65 | + $default_address .= $organization->city != '' ? $organization->get_pretty('city') : ''; |
|
66 | + $default_address .= ($organization->city != '' && $organization->STA_ID != '') ? ', ' : '<br />'; |
|
67 | + $state = EE_Registry::instance()->load_model('State')->get_one_by_ID($organization->STA_ID); |
|
68 | + $country = EE_Registry::instance()->load_model('Country')->get_one_by_ID($organization->CNT_ISO); |
|
69 | + $default_address .= $state ? $state->name().'<br />' : ''; |
|
70 | + $default_address .= $country ? $country->name().'<br />' : ''; |
|
71 | + $default_address .= $organization->zip != '' ? $organization->get_pretty('zip') : ''; |
|
72 | + } else { |
|
73 | 73 | $default_address = 'unknown'; |
74 | 74 | $organization_name = 'unknown'; |
75 | 75 | } |
76 | 76 | return new EE_Payment_Method_Form(array( |
77 | 77 | 'extra_meta_inputs'=>array( |
78 | 78 | 'check_title'=> new EE_Text_Input(array( |
79 | - 'html_label_text'=> sprintf(__("Title %s", "event_espresso"), $this->get_help_tab_link()), |
|
79 | + 'html_label_text'=> sprintf(__("Title %s", "event_espresso"), $this->get_help_tab_link()), |
|
80 | 80 | 'default'=> __("Check/Money Order Payments", 'event_espresso'), |
81 | 81 | )), |
82 | 82 | 'payment_instructions'=>new EE_Text_Area_Input(array( |
83 | - 'html_label_text'=> sprintf(__("Instructions %s", "event_espresso"), $this->get_help_tab_link()), |
|
83 | + 'html_label_text'=> sprintf(__("Instructions %s", "event_espresso"), $this->get_help_tab_link()), |
|
84 | 84 | 'default'=> __("Please send Check/Money Order to the address below. Payment must be received within 48 hours of event date.", 'event_espresso'), |
85 | - 'validation_strategies' => array( new EE_Full_HTML_Validation_Strategy() ), |
|
85 | + 'validation_strategies' => array(new EE_Full_HTML_Validation_Strategy()), |
|
86 | 86 | )), |
87 | 87 | 'payable_to'=>new EE_Text_Input(array( |
88 | - 'html_label_text'=> sprintf(__("Payable To %s", "event_espresso"), $this->get_help_tab_link()), |
|
88 | + 'html_label_text'=> sprintf(__("Payable To %s", "event_espresso"), $this->get_help_tab_link()), |
|
89 | 89 | 'default'=>$organization_name |
90 | 90 | )), |
91 | 91 | 'address_to_send_payment'=>new EE_Text_Area_Input(array( |
92 | - 'html_label_text'=> sprintf(__("Address Payable %s", "event_espresso"), $this->get_help_tab_link()), |
|
92 | + 'html_label_text'=> sprintf(__("Address Payable %s", "event_espresso"), $this->get_help_tab_link()), |
|
93 | 93 | 'default'=>$default_address, |
94 | - 'validation_strategies' => array( new EE_Full_HTML_Validation_Strategy() ), |
|
94 | + 'validation_strategies' => array(new EE_Full_HTML_Validation_Strategy()), |
|
95 | 95 | )), |
96 | 96 | ), |
97 | 97 | 'exclude'=>array('PMD_debug_mode') |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | * @see EE_PMT_Base::help_tabs_config() |
106 | 106 | * @return array |
107 | 107 | */ |
108 | - public function help_tabs_config(){ |
|
108 | + public function help_tabs_config() { |
|
109 | 109 | return array( |
110 | 110 | $this->get_help_tab_name() => array( |
111 | 111 | 'title' => __('Check Settings', 'event_espresso'), |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | * Other gateways may want to override this, such as offline gateways. |
123 | 123 | * @return string |
124 | 124 | */ |
125 | - public function payment_overview_content(EE_Payment $payment){ |
|
125 | + public function payment_overview_content(EE_Payment $payment) { |
|
126 | 126 | EE_Registry::instance()->load_helper('Template'); |
127 | 127 | $extra_meta_for_payment_method = $this->_pm_instance->all_extra_meta_array(); |
128 | 128 | $template_vars = array_merge( |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | ), |
137 | 137 | $extra_meta_for_payment_method); |
138 | 138 | return EEH_Template::locate_template( |
139 | - 'payment_methods' . DS . 'Check'. DS . 'templates'.DS.'check_payment_details_content.template.php', |
|
139 | + 'payment_methods'.DS.'Check'.DS.'templates'.DS.'check_payment_details_content.template.php', |
|
140 | 140 | $template_vars |
141 | 141 | ); |
142 | 142 | } |
@@ -3,27 +3,27 @@ |
||
3 | 3 | if (!defined('EVENT_ESPRESSO_VERSION')) |
4 | 4 | exit('No direct script access allowed'); |
5 | 5 | /** |
6 | - * Event Espresso |
|
7 | - * |
|
8 | - * Event Registration and Management Plugin for WordPress |
|
9 | - * |
|
10 | - * @ package Event Espresso |
|
11 | - * @ author Seth Shoultes |
|
12 | - * @ copyright (c) 2008-2011 Event Espresso All Rights Reserved. |
|
13 | - * @ license http://eventespresso.com/support/terms-conditions/ * see Plugin Licensing * |
|
14 | - * @ link http://www.eventespresso.com |
|
15 | - * @ version 4.3 |
|
16 | - * |
|
17 | - * ------------------------------------------------------------------------ |
|
18 | - * |
|
19 | - * check_payment_details_content |
|
20 | - * |
|
21 | - * @package Event Espresso |
|
22 | - * @subpackage |
|
23 | - * @author Mike Nelson |
|
24 | - * |
|
25 | - * ------------------------------------------------------------------------ |
|
26 | - */ |
|
6 | + * Event Espresso |
|
7 | + * |
|
8 | + * Event Registration and Management Plugin for WordPress |
|
9 | + * |
|
10 | + * @ package Event Espresso |
|
11 | + * @ author Seth Shoultes |
|
12 | + * @ copyright (c) 2008-2011 Event Espresso All Rights Reserved. |
|
13 | + * @ license http://eventespresso.com/support/terms-conditions/ * see Plugin Licensing * |
|
14 | + * @ link http://www.eventespresso.com |
|
15 | + * @ version 4.3 |
|
16 | + * |
|
17 | + * ------------------------------------------------------------------------ |
|
18 | + * |
|
19 | + * check_payment_details_content |
|
20 | + * |
|
21 | + * @package Event Espresso |
|
22 | + * @subpackage |
|
23 | + * @author Mike Nelson |
|
24 | + * |
|
25 | + * ------------------------------------------------------------------------ |
|
26 | + */ |
|
27 | 27 | ?> |
28 | 28 | <div class="event-display-boxes"> |
29 | 29 | <h4 id="check_title" class="payment_type_title section-heading"><?php echo $check_title ?></h4> |
@@ -1,6 +1,6 @@ |
||
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 | * Event Espresso |
@@ -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 | * Event Espresso |
7 | 8 | * |
@@ -3,27 +3,27 @@ |
||
3 | 3 | if (!defined('EVENT_ESPRESSO_VERSION')) |
4 | 4 | exit('No direct script access allowed'); |
5 | 5 | /** |
6 | - * Event Espresso |
|
7 | - * |
|
8 | - * Event Registration and Management Plugin for WordPress |
|
9 | - * |
|
10 | - * @ package Event Espresso |
|
11 | - * @ author Seth Shoultes |
|
12 | - * @ copyright (c) 2008-2011 Event Espresso All Rights Reserved. |
|
13 | - * @ license http://eventespresso.com/support/terms-conditions/ * see Plugin Licensing * |
|
14 | - * @ link http://www.eventespresso.com |
|
15 | - * @ version 4.3 |
|
16 | - * |
|
17 | - * ------------------------------------------------------------------------ |
|
18 | - * |
|
19 | - * invoice_payment_details_content |
|
20 | - * |
|
21 | - * @package Event Espresso |
|
22 | - * @subpackage |
|
23 | - * @author Mike Nelson |
|
24 | - * |
|
25 | - * ------------------------------------------------------------------------ |
|
26 | - */ |
|
6 | + * Event Espresso |
|
7 | + * |
|
8 | + * Event Registration and Management Plugin for WordPress |
|
9 | + * |
|
10 | + * @ package Event Espresso |
|
11 | + * @ author Seth Shoultes |
|
12 | + * @ copyright (c) 2008-2011 Event Espresso All Rights Reserved. |
|
13 | + * @ license http://eventespresso.com/support/terms-conditions/ * see Plugin Licensing * |
|
14 | + * @ link http://www.eventespresso.com |
|
15 | + * @ version 4.3 |
|
16 | + * |
|
17 | + * ------------------------------------------------------------------------ |
|
18 | + * |
|
19 | + * invoice_payment_details_content |
|
20 | + * |
|
21 | + * @package Event Espresso |
|
22 | + * @subpackage |
|
23 | + * @author Mike Nelson |
|
24 | + * |
|
25 | + * ------------------------------------------------------------------------ |
|
26 | + */ |
|
27 | 27 | ?> |
28 | 28 | <div class="event-display-boxes"> |
29 | 29 | <?php |
@@ -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 | * Event Espresso |
@@ -27,10 +27,10 @@ discard block |
||
27 | 27 | ?> |
28 | 28 | <div class="event-display-boxes"> |
29 | 29 | <?php |
30 | - if ( ! empty( $page_title )) { |
|
31 | - echo '<h4 id="invoice_title" class="payment_type_title section-heading">' . stripslashes_deep( $page_title ) . '</h4>'; |
|
30 | + if ( ! empty($page_title)) { |
|
31 | + echo '<h4 id="invoice_title" class="payment_type_title section-heading">'.stripslashes_deep($page_title).'</h4>'; |
|
32 | 32 | } |
33 | - if ( ! empty( $invoice_url )) { |
|
33 | + if ( ! empty($invoice_url)) { |
|
34 | 34 | ?> |
35 | 35 | <p> |
36 | 36 | <a href="<?php echo $invoice_url; ?>" class="ee-button-lnk inline-button" target="_blank"> |
@@ -40,10 +40,10 @@ discard block |
||
40 | 40 | <?php |
41 | 41 | |
42 | 42 | if (isset($page_confirmation_text)) { |
43 | - echo '<div class="event-messages ui-state-highlight"><span class="ui-icon ui-icon-alert"></span><p class="instruct">' . stripslashes_deep($page_confirmation_text) . '</p></div>'; |
|
43 | + echo '<div class="event-messages ui-state-highlight"><span class="ui-icon ui-icon-alert"></span><p class="instruct">'.stripslashes_deep($page_confirmation_text).'</p></div>'; |
|
44 | 44 | } |
45 | 45 | |
46 | - if ( ! empty( $page_extra_info )) { |
|
46 | + if ( ! empty($page_extra_info)) { |
|
47 | 47 | ?> |
48 | 48 | <div class="address-block"> |
49 | 49 | <?php echo wpautop(stripslashes_deep($page_extra_info)); ?> |
@@ -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 | * Event Espresso |
7 | 8 | * |
@@ -3,27 +3,27 @@ |
||
3 | 3 | if (!defined('EVENT_ESPRESSO_VERSION')) |
4 | 4 | exit('No direct script access allowed'); |
5 | 5 | /** |
6 | - * Event Espresso |
|
7 | - * |
|
8 | - * Event Registration and Management Plugin for WordPress |
|
9 | - * |
|
10 | - * @ package Event Espresso |
|
11 | - * @ author Seth Shoultes |
|
12 | - * @ copyright (c) 2008-2011 Event Espresso All Rights Reserved. |
|
13 | - * @ license http://eventespresso.com/support/terms-conditions/ * see Plugin Licensing * |
|
14 | - * @ link http://www.eventespresso.com |
|
15 | - * @ version 4.3 |
|
16 | - * |
|
17 | - * ------------------------------------------------------------------------ |
|
18 | - * |
|
19 | - * invoice_settings_header_display |
|
20 | - * |
|
21 | - * @package Event Espresso |
|
22 | - * @subpackage |
|
23 | - * @author Mike Nelson |
|
24 | - * |
|
25 | - * ------------------------------------------------------------------------ |
|
26 | - */ |
|
6 | + * Event Espresso |
|
7 | + * |
|
8 | + * Event Registration and Management Plugin for WordPress |
|
9 | + * |
|
10 | + * @ package Event Espresso |
|
11 | + * @ author Seth Shoultes |
|
12 | + * @ copyright (c) 2008-2011 Event Espresso All Rights Reserved. |
|
13 | + * @ license http://eventespresso.com/support/terms-conditions/ * see Plugin Licensing * |
|
14 | + * @ link http://www.eventespresso.com |
|
15 | + * @ version 4.3 |
|
16 | + * |
|
17 | + * ------------------------------------------------------------------------ |
|
18 | + * |
|
19 | + * invoice_settings_header_display |
|
20 | + * |
|
21 | + * @package Event Espresso |
|
22 | + * @subpackage |
|
23 | + * @author Mike Nelson |
|
24 | + * |
|
25 | + * ------------------------------------------------------------------------ |
|
26 | + */ |
|
27 | 27 | ?> |
28 | 28 | <tr> |
29 | 29 | <th><h4><?php _e("Invoice Display Settings", 'event_espresso');?></h4></th> |
@@ -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 | * Event Espresso |
@@ -26,9 +26,9 @@ discard block |
||
26 | 26 | */ |
27 | 27 | ?> |
28 | 28 | <tr> |
29 | - <th><h4><?php _e("Invoice Display Settings", 'event_espresso');?></h4></th> |
|
29 | + <th><h4><?php _e("Invoice Display Settings", 'event_espresso'); ?></h4></th> |
|
30 | 30 | <td> |
31 | - <span class="description"><?php _e("The following settings affect the content and/or appearance of the downloadable PDF invoice.", 'event_espresso');?></span> |
|
31 | + <span class="description"><?php _e("The following settings affect the content and/or appearance of the downloadable PDF invoice.", 'event_espresso'); ?></span> |
|
32 | 32 | </td> |
33 | 33 | </tr> |
34 | 34 | <?php |
@@ -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 | * Event Espresso |
7 | 8 | * |
@@ -3,27 +3,27 @@ |
||
3 | 3 | if (!defined('EVENT_ESPRESSO_VERSION')) |
4 | 4 | exit('No direct script access allowed'); |
5 | 5 | /** |
6 | - * Event Espresso |
|
7 | - * |
|
8 | - * Event Registration and Management Plugin for WordPress |
|
9 | - * |
|
10 | - * @ package Event Espresso |
|
11 | - * @ author Seth Shoultes |
|
12 | - * @ copyright (c) 2008-2011 Event Espresso All Rights Reserved. |
|
13 | - * @ license http://eventespresso.com/support/terms-conditions/ * see Plugin Licensing * |
|
14 | - * @ link http://www.eventespresso.com |
|
15 | - * @ version 4.3 |
|
16 | - * |
|
17 | - * ------------------------------------------------------------------------ |
|
18 | - * |
|
19 | - * invoice_settings_header_gateway |
|
20 | - * |
|
21 | - * @package Event Espresso |
|
22 | - * @subpackage |
|
23 | - * @author Mike Nelson |
|
24 | - * |
|
25 | - * ------------------------------------------------------------------------ |
|
26 | - */ |
|
6 | + * Event Espresso |
|
7 | + * |
|
8 | + * Event Registration and Management Plugin for WordPress |
|
9 | + * |
|
10 | + * @ package Event Espresso |
|
11 | + * @ author Seth Shoultes |
|
12 | + * @ copyright (c) 2008-2011 Event Espresso All Rights Reserved. |
|
13 | + * @ license http://eventespresso.com/support/terms-conditions/ * see Plugin Licensing * |
|
14 | + * @ link http://www.eventespresso.com |
|
15 | + * @ version 4.3 |
|
16 | + * |
|
17 | + * ------------------------------------------------------------------------ |
|
18 | + * |
|
19 | + * invoice_settings_header_gateway |
|
20 | + * |
|
21 | + * @package Event Espresso |
|
22 | + * @subpackage |
|
23 | + * @author Mike Nelson |
|
24 | + * |
|
25 | + * ------------------------------------------------------------------------ |
|
26 | + */ |
|
27 | 27 | ?> |
28 | 28 | <tr> |
29 | 29 | <th><h4><?php _e("Invoice Gateway Settings", 'event_espresso');?></h4></th> |
@@ -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 | * Event Espresso |
@@ -26,9 +26,9 @@ discard block |
||
26 | 26 | */ |
27 | 27 | ?> |
28 | 28 | <tr> |
29 | - <th><h4><?php _e("Invoice Gateway Settings", 'event_espresso');?></h4></th> |
|
29 | + <th><h4><?php _e("Invoice Gateway Settings", 'event_espresso'); ?></h4></th> |
|
30 | 30 | <td> |
31 | - <span class="description"><?php _e("The following settings affect the functioning of the Invoice gateway.", 'event_espresso');?></span> |
|
31 | + <span class="description"><?php _e("The following settings affect the functioning of the Invoice gateway.", 'event_espresso'); ?></span> |
|
32 | 32 | </td> |
33 | 33 | </tr> |
34 | 34 | <?php |
@@ -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 | * Event Espresso |
7 | 8 | * |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | parent::set_settings($settings_array); |
78 | 78 | if($this->_debug_mode){ |
79 | 79 | $this->_gateway_url = 'https://www.sandbox.paypal.com/cgi-bin/webscr'; |
80 | - }else{ |
|
80 | + } else{ |
|
81 | 81 | $this->_gateway_url = 'https://www.paypal.com/cgi-bin/webscr'; |
82 | 82 | } |
83 | 83 | } |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | if( ! $this->_paypal_taxes ){ |
127 | 127 | $redirect_args['tax_cart'] = $total_line_item->get_total_tax(); |
128 | 128 | } |
129 | - }else{ |
|
129 | + } else{ |
|
130 | 130 | //this is a partial payment, so we can't really show all the line items |
131 | 131 | $redirect_args['item_name_' . $item_num] = substr( sprintf(__('Payment of %1$s for %2$s', "event_espresso"),$payment->amount(), $primary_registrant->reg_code()), 0, 127 ); |
132 | 132 | $redirect_args['amount_' . $item_num] = $payment->amount(); |
@@ -306,8 +306,9 @@ discard block |
||
306 | 306 | $update_info = array(); |
307 | 307 | foreach ( $raw_post_array as $keyval ) { |
308 | 308 | $keyval = explode( '=', $keyval ); |
309 | - if ( count( $keyval ) == 2 ) |
|
310 | - $update_info[ $keyval[ 0 ] ] = urldecode( $keyval[ 1 ] ); |
|
309 | + if ( count( $keyval ) == 2 ) { |
|
310 | + $update_info[ $keyval[ 0 ] ] = urldecode( $keyval[ 1 ] ); |
|
311 | + } |
|
311 | 312 | } |
312 | 313 | // read the IPN message sent from PayPal and prepend 'cmd=_notify-validate' |
313 | 314 | $req = 'cmd=_notify-validate'; |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | * @return EEG_Paypal_Standard |
64 | 64 | */ |
65 | 65 | public function __construct() { |
66 | - $this->set_uses_separate_IPN_request( true ) ; |
|
66 | + $this->set_uses_separate_IPN_request(true); |
|
67 | 67 | parent::__construct(); |
68 | 68 | } |
69 | 69 | |
@@ -73,11 +73,11 @@ discard block |
||
73 | 73 | * Also sets the gateway url class variable based on whether debug mode is enabled or not |
74 | 74 | * @param array $settings_array |
75 | 75 | */ |
76 | - public function set_settings($settings_array){ |
|
76 | + public function set_settings($settings_array) { |
|
77 | 77 | parent::set_settings($settings_array); |
78 | - if($this->_debug_mode){ |
|
78 | + if ($this->_debug_mode) { |
|
79 | 79 | $this->_gateway_url = 'https://www.sandbox.paypal.com/cgi-bin/webscr'; |
80 | - }else{ |
|
80 | + } else { |
|
81 | 81 | $this->_gateway_url = 'https://www.paypal.com/cgi-bin/webscr'; |
82 | 82 | } |
83 | 83 | } |
@@ -92,47 +92,47 @@ discard block |
||
92 | 92 | * @param string $cancel_url URL to send the user to after a cancelled payment attempt on teh payment provider's website |
93 | 93 | * @return EEI_Payment |
94 | 94 | */ |
95 | - public function set_redirection_info( $payment, $billing_info = array(), $return_url = NULL, $notify_url = NULL, $cancel_url = NULL ){ |
|
95 | + public function set_redirection_info($payment, $billing_info = array(), $return_url = NULL, $notify_url = NULL, $cancel_url = NULL) { |
|
96 | 96 | $redirect_args = array(); |
97 | 97 | $transaction = $payment->transaction(); |
98 | 98 | $primary_registrant = $transaction->primary_registration(); |
99 | 99 | $item_num = 1; |
100 | 100 | $total_line_item = $transaction->total_line_item(); |
101 | - if( $this->_can_easily_itemize_transaction_for( $payment ) ){ |
|
101 | + if ($this->_can_easily_itemize_transaction_for($payment)) { |
|
102 | 102 | //this payment is for the entire transaction, |
103 | 103 | //so let's show all the line items |
104 | - foreach($total_line_item->get_items() as $line_item){ |
|
105 | - if ( $line_item instanceof EE_Line_Item ) { |
|
104 | + foreach ($total_line_item->get_items() as $line_item) { |
|
105 | + if ($line_item instanceof EE_Line_Item) { |
|
106 | 106 | //if this is a re-attempt at paying, don't re-add PayPal's shipping |
107 | - if ( $line_item->code() == 'paypal_shipping' ) { |
|
107 | + if ($line_item->code() == 'paypal_shipping') { |
|
108 | 108 | continue; |
109 | 109 | } |
110 | - $redirect_args[ 'item_name_' . $item_num ] = substr( |
|
111 | - sprintf( __( '%1$s for %2$s', 'event_espresso' ), $line_item->name(), $line_item->ticket_event_name() ), 0, 127 ); |
|
112 | - $redirect_args[ 'amount_' . $item_num ] = $line_item->unit_price(); |
|
113 | - $redirect_args[ 'quantity_' . $item_num ] = $line_item->quantity(); |
|
114 | - if ( ! $line_item->is_taxable() ) { |
|
115 | - $redirect_args[ 'tax_' . $item_num ] = 0; |
|
110 | + $redirect_args['item_name_'.$item_num] = substr( |
|
111 | + sprintf(__('%1$s for %2$s', 'event_espresso'), $line_item->name(), $line_item->ticket_event_name()), 0, 127 ); |
|
112 | + $redirect_args['amount_'.$item_num] = $line_item->unit_price(); |
|
113 | + $redirect_args['quantity_'.$item_num] = $line_item->quantity(); |
|
114 | + if ( ! $line_item->is_taxable()) { |
|
115 | + $redirect_args['tax_'.$item_num] = 0; |
|
116 | 116 | } |
117 | 117 | //if we're not letting PayPal calculate shipping, tell them its 0 |
118 | - if ( ! $this->_paypal_shipping ) { |
|
119 | - $redirect_args[ 'shipping_' . $item_num ] = '0'; |
|
120 | - $redirect_args[ 'shipping2_' . $item_num ] = '0'; |
|
118 | + if ( ! $this->_paypal_shipping) { |
|
119 | + $redirect_args['shipping_'.$item_num] = '0'; |
|
120 | + $redirect_args['shipping2_'.$item_num] = '0'; |
|
121 | 121 | } |
122 | 122 | $item_num++; |
123 | 123 | } |
124 | 124 | } |
125 | 125 | //add our taxes to the order if we're NOT using PayPal's |
126 | - if( ! $this->_paypal_taxes ){ |
|
126 | + if ( ! $this->_paypal_taxes) { |
|
127 | 127 | $redirect_args['tax_cart'] = $total_line_item->get_total_tax(); |
128 | 128 | } |
129 | - }else{ |
|
129 | + } else { |
|
130 | 130 | //this is a partial payment, so we can't really show all the line items |
131 | - $redirect_args['item_name_' . $item_num] = substr( sprintf(__('Payment of %1$s for %2$s', "event_espresso"),$payment->amount(), $primary_registrant->reg_code()), 0, 127 ); |
|
132 | - $redirect_args['amount_' . $item_num] = $payment->amount(); |
|
131 | + $redirect_args['item_name_'.$item_num] = substr(sprintf(__('Payment of %1$s for %2$s', "event_espresso"), $payment->amount(), $primary_registrant->reg_code()), 0, 127); |
|
132 | + $redirect_args['amount_'.$item_num] = $payment->amount(); |
|
133 | 133 | //if we aren't allowing PayPal to calculate shipping, set it to 0 |
134 | - $redirect_args['shipping_' . $item_num ] = '0'; |
|
135 | - $redirect_args['shipping2_' . $item_num ] = '0'; |
|
134 | + $redirect_args['shipping_'.$item_num] = '0'; |
|
135 | + $redirect_args['shipping2_'.$item_num] = '0'; |
|
136 | 136 | //PayPal can't calculate taxes because we don't know what parts of it are taxable |
137 | 137 | $redirect_args['tax_cart'] = '0'; |
138 | 138 | |
@@ -141,16 +141,16 @@ discard block |
||
141 | 141 | |
142 | 142 | |
143 | 143 | } |
144 | - if($this->_debug_mode){ |
|
145 | - $redirect_args['item_name_' . $item_num] = 'DEBUG INFO (this item only added in sandbox mode'; |
|
146 | - $redirect_args['amount_' . $item_num] = 0; |
|
144 | + if ($this->_debug_mode) { |
|
145 | + $redirect_args['item_name_'.$item_num] = 'DEBUG INFO (this item only added in sandbox mode'; |
|
146 | + $redirect_args['amount_'.$item_num] = 0; |
|
147 | 147 | $redirect_args['on0_'.$item_num] = 'NOTIFY URL'; |
148 | - $redirect_args['os0_' . $item_num] = $notify_url; |
|
148 | + $redirect_args['os0_'.$item_num] = $notify_url; |
|
149 | 149 | $redirect_args['on1_'.$item_num] = 'RETURN URL'; |
150 | - $redirect_args['os1_' . $item_num] = $return_url; |
|
150 | + $redirect_args['os1_'.$item_num] = $return_url; |
|
151 | 151 | // $redirect_args['option_index_' . $item_num] = 1; // <-- dunno if this is needed ? |
152 | - $redirect_args['shipping_' . $item_num ] = '0'; |
|
153 | - $redirect_args['shipping2_' . $item_num ] = '0'; |
|
152 | + $redirect_args['shipping_'.$item_num] = '0'; |
|
153 | + $redirect_args['shipping2_'.$item_num] = '0'; |
|
154 | 154 | } |
155 | 155 | |
156 | 156 | $redirect_args['business'] = $this->_paypal_id; |
@@ -160,14 +160,14 @@ discard block |
||
160 | 160 | $redirect_args['cmd'] = '_cart'; |
161 | 161 | $redirect_args['upload'] = 1; |
162 | 162 | $redirect_args['currency_code'] = $payment->currency_code(); |
163 | - $redirect_args['rm'] = 2;//makes the user return with method=POST |
|
164 | - if($this->_image_url){ |
|
163 | + $redirect_args['rm'] = 2; //makes the user return with method=POST |
|
164 | + if ($this->_image_url) { |
|
165 | 165 | $redirect_args['image_url'] = $this->_image_url; |
166 | 166 | } |
167 | 167 | $redirect_args['no_shipping'] = $this->_shipping_details; |
168 | - $redirect_args['bn'] = 'EventEspresso_SP';//EE will blow up if you change this |
|
168 | + $redirect_args['bn'] = 'EventEspresso_SP'; //EE will blow up if you change this |
|
169 | 169 | |
170 | - $redirect_args = apply_filters( "FHEE__EEG_Paypal_Standard__set_redirection_info__arguments", $redirect_args ); |
|
170 | + $redirect_args = apply_filters("FHEE__EEG_Paypal_Standard__set_redirection_info__arguments", $redirect_args); |
|
171 | 171 | |
172 | 172 | $payment->set_redirect_url($this->_gateway_url); |
173 | 173 | $payment->set_redirect_args($redirect_args); |
@@ -185,55 +185,55 @@ discard block |
||
185 | 185 | * @return \EEI_Payment updated |
186 | 186 | * @throws \EE_Error |
187 | 187 | */ |
188 | - public function handle_payment_update( $update_info, $transaction ){ |
|
188 | + public function handle_payment_update($update_info, $transaction) { |
|
189 | 189 | //verify there's payment data that's been sent |
190 | - if ( empty( $update_info[ 'payment_status' ] ) || empty( $update_info[ 'txn_id' ] ) ) { |
|
190 | + if (empty($update_info['payment_status']) || empty($update_info['txn_id'])) { |
|
191 | 191 | // waaaait... is this a PDT request? (see https://developer.paypal.com/docs/classic/products/payment-data-transfer/) |
192 | 192 | // indicated by the "tx" argument? If so, we don't need it. We'll just use the IPN data when it comes |
193 | - if ( isset( $update_info[ 'tx' ] ) ) { |
|
193 | + if (isset($update_info['tx'])) { |
|
194 | 194 | return $transaction->last_payment(); |
195 | 195 | } else { |
196 | 196 | return null; |
197 | 197 | } |
198 | 198 | } |
199 | - $payment = $this->_pay_model->get_payment_by_txn_id_chq_nmbr( $update_info[ 'txn_id' ] ); |
|
200 | - if ( ! $payment instanceof EEI_Payment ) { |
|
199 | + $payment = $this->_pay_model->get_payment_by_txn_id_chq_nmbr($update_info['txn_id']); |
|
200 | + if ( ! $payment instanceof EEI_Payment) { |
|
201 | 201 | $payment = $transaction->last_payment(); |
202 | 202 | } |
203 | 203 | // ok, then validate the IPN. Even if we've already processed this payment, |
204 | 204 | // let PayPal know we don't want to hear from them anymore! |
205 | - if ( ! $this->validate_ipn( $update_info, $payment ) ) { |
|
205 | + if ( ! $this->validate_ipn($update_info, $payment)) { |
|
206 | 206 | return $payment; |
207 | 207 | } |
208 | 208 | //ok, well let's process this payment then! |
209 | - switch ( $update_info[ 'payment_status' ] ) { |
|
209 | + switch ($update_info['payment_status']) { |
|
210 | 210 | |
211 | 211 | case 'Completed' : |
212 | 212 | $status = $this->_pay_model->approved_status(); |
213 | - $gateway_response = __( 'The payment is approved.', 'event_espresso' ); |
|
213 | + $gateway_response = __('The payment is approved.', 'event_espresso'); |
|
214 | 214 | break; |
215 | 215 | |
216 | 216 | case 'Pending' : |
217 | 217 | $status = $this->_pay_model->pending_status(); |
218 | - $gateway_response = __( 'The payment is in progress. Another message will be sent when payment is approved.', 'event_espresso' ); |
|
218 | + $gateway_response = __('The payment is in progress. Another message will be sent when payment is approved.', 'event_espresso'); |
|
219 | 219 | break; |
220 | 220 | |
221 | 221 | case 'Denied' : |
222 | 222 | $status = $this->_pay_model->declined_status(); |
223 | - $gateway_response = __( 'The payment has been declined.', 'event_espresso' ); |
|
223 | + $gateway_response = __('The payment has been declined.', 'event_espresso'); |
|
224 | 224 | break; |
225 | 225 | |
226 | 226 | case 'Expired' : |
227 | 227 | case 'Failed' : |
228 | 228 | $status = $this->_pay_model->failed_status(); |
229 | - $gateway_response = __( 'The payment failed for technical reasons or expired.', 'event_espresso' ); |
|
229 | + $gateway_response = __('The payment failed for technical reasons or expired.', 'event_espresso'); |
|
230 | 230 | break; |
231 | 231 | |
232 | 232 | case 'Refunded' : |
233 | 233 | case 'Partially_Refunded' : |
234 | 234 | // even though it's a refund, we consider the payment as approved, it just has a negative value |
235 | 235 | $status = $this->_pay_model->approved_status(); |
236 | - $gateway_response = __( 'The payment has been refunded. Please update registrations accordingly.', 'event_espresso' ); |
|
236 | + $gateway_response = __('The payment has been refunded. Please update registrations accordingly.', 'event_espresso'); |
|
237 | 237 | break; |
238 | 238 | |
239 | 239 | case 'Voided' : |
@@ -241,25 +241,25 @@ discard block |
||
241 | 241 | case 'Canceled_Reversal' : |
242 | 242 | default : |
243 | 243 | $status = $this->_pay_model->cancelled_status(); |
244 | - $gateway_response = __( 'The payment was cancelled, reversed, or voided. Please update registrations accordingly.', 'event_espresso' ); |
|
244 | + $gateway_response = __('The payment was cancelled, reversed, or voided. Please update registrations accordingly.', 'event_espresso'); |
|
245 | 245 | break; |
246 | 246 | |
247 | 247 | } |
248 | 248 | |
249 | 249 | //check if we've already processed this payment |
250 | - if ( $payment instanceof EEI_Payment ) { |
|
250 | + if ($payment instanceof EEI_Payment) { |
|
251 | 251 | //payment exists. if this has the exact same status and amount, don't bother updating. just return |
252 | - if ( $payment->status() == $status && $payment->amount() == $update_info[ 'mc_gross' ] ) { |
|
252 | + if ($payment->status() == $status && $payment->amount() == $update_info['mc_gross']) { |
|
253 | 253 | // DUPLICATED IPN! dont bother updating transaction foo!; |
254 | - $message_log = sprintf( __( 'It appears we have received a duplicate IPN from PayPal for payment %d', 'event_espresso' ), $payment->ID() ); |
|
254 | + $message_log = sprintf(__('It appears we have received a duplicate IPN from PayPal for payment %d', 'event_espresso'), $payment->ID()); |
|
255 | 255 | } else { |
256 | 256 | // new payment yippee !!! |
257 | - $payment->set_status( $status ); |
|
258 | - $payment->set_amount( floatval( $update_info[ 'mc_gross' ] ) ); |
|
259 | - $payment->set_gateway_response( $gateway_response ); |
|
260 | - $payment->set_details( $update_info ); |
|
261 | - $payment->set_txn_id_chq_nmbr( $update_info[ 'txn_id' ] ); |
|
262 | - $message_log = sprintf( __( 'Updated payment either from IPN or as part of POST from PayPal', 'event_espresso' ) ); |
|
257 | + $payment->set_status($status); |
|
258 | + $payment->set_amount(floatval($update_info['mc_gross'])); |
|
259 | + $payment->set_gateway_response($gateway_response); |
|
260 | + $payment->set_details($update_info); |
|
261 | + $payment->set_txn_id_chq_nmbr($update_info['txn_id']); |
|
262 | + $message_log = sprintf(__('Updated payment either from IPN or as part of POST from PayPal', 'event_espresso')); |
|
263 | 263 | } |
264 | 264 | $this->log( |
265 | 265 | array( |
@@ -271,11 +271,11 @@ discard block |
||
271 | 271 | $payment |
272 | 272 | ); |
273 | 273 | } |
274 | - do_action( 'FHEE__EEG_Paypal_Standard__handle_payment_update__payment_processed', $payment, $this ); |
|
274 | + do_action('FHEE__EEG_Paypal_Standard__handle_payment_update__payment_processed', $payment, $this); |
|
275 | 275 | // kill request here if this is a refund |
276 | - if ( $update_info[ 'payment_status' ] == 'Refunded' || $update_info[ 'payment_status' ] == 'Partially_Refunded' ) { |
|
277 | - if ( apply_filters( 'FHEE__EEG_Paypal_Standard__handle_payment_update__kill_refund_request', true ) ) { |
|
278 | - status_header( 200 ); |
|
276 | + if ($update_info['payment_status'] == 'Refunded' || $update_info['payment_status'] == 'Partially_Refunded') { |
|
277 | + if (apply_filters('FHEE__EEG_Paypal_Standard__handle_payment_update__kill_refund_request', true)) { |
|
278 | + status_header(200); |
|
279 | 279 | exit(); |
280 | 280 | } |
281 | 281 | } |
@@ -291,9 +291,9 @@ discard block |
||
291 | 291 | * @param EE_Payment|EEI_Payment $payment |
292 | 292 | * @return boolean |
293 | 293 | */ |
294 | - public function validate_ipn( $update_info, $payment ) { |
|
294 | + public function validate_ipn($update_info, $payment) { |
|
295 | 295 | //allow us to skip validating IPNs with PayPal (useful for testing) |
296 | - if ( apply_filters( 'FHEE__EEG_Paypal_Standard__validate_ipn__skip', false ) ) { |
|
296 | + if (apply_filters('FHEE__EEG_Paypal_Standard__validate_ipn__skip', false)) { |
|
297 | 297 | return true; |
298 | 298 | } |
299 | 299 | //...otherwise, we actually don't care what the $update_info is, we need to look |
@@ -301,22 +301,22 @@ discard block |
||
301 | 301 | // Reading POSTed data directly from $_POST causes serialization issues with array data in the POST. |
302 | 302 | // Instead, read raw POST data from the input stream. |
303 | 303 | // @see https://gist.github.com/xcommerce-gists/3440401 |
304 | - $raw_post_data = file_get_contents( 'php://input' ); |
|
305 | - $raw_post_array = explode( '&', $raw_post_data ); |
|
304 | + $raw_post_data = file_get_contents('php://input'); |
|
305 | + $raw_post_array = explode('&', $raw_post_data); |
|
306 | 306 | $update_info = array(); |
307 | - foreach ( $raw_post_array as $keyval ) { |
|
308 | - $keyval = explode( '=', $keyval ); |
|
309 | - if ( count( $keyval ) == 2 ) |
|
310 | - $update_info[ $keyval[ 0 ] ] = urldecode( $keyval[ 1 ] ); |
|
307 | + foreach ($raw_post_array as $keyval) { |
|
308 | + $keyval = explode('=', $keyval); |
|
309 | + if (count($keyval) == 2) |
|
310 | + $update_info[$keyval[0]] = urldecode($keyval[1]); |
|
311 | 311 | } |
312 | 312 | // read the IPN message sent from PayPal and prepend 'cmd=_notify-validate' |
313 | 313 | $req = 'cmd=_notify-validate'; |
314 | - $get_magic_quotes_exists = function_exists( 'get_magic_quotes_gpc' ) ? true : false; |
|
315 | - foreach ( $update_info as $key => $value ) { |
|
316 | - if ( $get_magic_quotes_exists && get_magic_quotes_gpc() == 1 ) { |
|
317 | - $value = urlencode( stripslashes( $value ) ); |
|
314 | + $get_magic_quotes_exists = function_exists('get_magic_quotes_gpc') ? true : false; |
|
315 | + foreach ($update_info as $key => $value) { |
|
316 | + if ($get_magic_quotes_exists && get_magic_quotes_gpc() == 1) { |
|
317 | + $value = urlencode(stripslashes($value)); |
|
318 | 318 | } else { |
319 | - $value = urlencode( $value ); |
|
319 | + $value = urlencode($value); |
|
320 | 320 | } |
321 | 321 | $req .= "&$key=$value"; |
322 | 322 | } |
@@ -326,21 +326,21 @@ discard block |
||
326 | 326 | array( |
327 | 327 | 'body' => $req, |
328 | 328 | 'sslverify' => false, |
329 | - 'timeout' => 60 , |
|
329 | + 'timeout' => 60, |
|
330 | 330 | // make sure to set a site specific unique "user-agent" string since the WordPres default gets declined by PayPal |
331 | 331 | // plz see: https://github.com/websharks/s2member/issues/610 |
332 | - 'user-agent' => 'Event Espresso v' . EVENT_ESPRESSO_VERSION . '; ' . home_url(), |
|
332 | + 'user-agent' => 'Event Espresso v'.EVENT_ESPRESSO_VERSION.'; '.home_url(), |
|
333 | 333 | ) |
334 | 334 | ); |
335 | 335 | // then check the response |
336 | - if ( ! is_wp_error( $response ) && array_key_exists( 'body', $response ) && strcmp( $response[ 'body' ], "VERIFIED" ) == 0 ) { |
|
336 | + if ( ! is_wp_error($response) && array_key_exists('body', $response) && strcmp($response['body'], "VERIFIED") == 0) { |
|
337 | 337 | return true; |
338 | 338 | } else { |
339 | 339 | // huh, something's wack... the IPN didn't validate. We must have replied to the IPN incorrectly, |
340 | 340 | // or their API must have changed: http://www.paypalobjects.com/en_US/ebook/PP_OrderManagement_IntegrationGuide/ipn.html |
341 | - $payment->set_gateway_response( sprintf( __( "IPN Validation failed! Paypal responded with '%s'", "event_espresso" ), $response[ 'body' ] ) ); |
|
342 | - $payment->set_details( array( 'REQUEST' => $update_info, 'VALIDATION_RESPONSE' => $response ) ); |
|
343 | - $payment->set_status( EEM_Payment::status_id_failed ); |
|
341 | + $payment->set_gateway_response(sprintf(__("IPN Validation failed! Paypal responded with '%s'", "event_espresso"), $response['body'])); |
|
342 | + $payment->set_details(array('REQUEST' => $update_info, 'VALIDATION_RESPONSE' => $response)); |
|
343 | + $payment->set_status(EEM_Payment::status_id_failed); |
|
344 | 344 | // log the results |
345 | 345 | $this->log( |
346 | 346 | array( |
@@ -362,9 +362,9 @@ discard block |
||
362 | 362 | */ |
363 | 363 | protected function _process_response_url() { |
364 | 364 | EE_Registry::instance()->load_helper('URL'); |
365 | - if ( isset( $_SERVER[ 'HTTP_HOST' ], $_SERVER[ 'REQUEST_URI' ] ) ) { |
|
365 | + if (isset($_SERVER['HTTP_HOST'], $_SERVER['REQUEST_URI'])) { |
|
366 | 366 | $url = is_ssl() ? 'https://' : 'http://'; |
367 | - $url .= EEH_URL::filter_input_server_url( 'HTTP_HOST' ); |
|
367 | + $url .= EEH_URL::filter_input_server_url('HTTP_HOST'); |
|
368 | 368 | $url .= EEH_URL::filter_input_server_url(); |
369 | 369 | } else { |
370 | 370 | $url = 'unknown'; |
@@ -380,19 +380,19 @@ discard block |
||
380 | 380 | * like the taxes or shipping |
381 | 381 | * @param EEI_Payment $payment |
382 | 382 | */ |
383 | - public function update_txn_based_on_payment( $payment ) { |
|
383 | + public function update_txn_based_on_payment($payment) { |
|
384 | 384 | $update_info = $payment->details(); |
385 | 385 | $redirect_args = $payment->redirect_args(); |
386 | 386 | $transaction = $payment->transaction(); |
387 | - if( ! $transaction ){ |
|
388 | - $this->log( __( 'Payment with ID %d has no related transaction, and so update_txn_based_on_payment couldn\'t be executed properly', 'event_espresso' ), $payment ); |
|
387 | + if ( ! $transaction) { |
|
388 | + $this->log(__('Payment with ID %d has no related transaction, and so update_txn_based_on_payment couldn\'t be executed properly', 'event_espresso'), $payment); |
|
389 | 389 | return; |
390 | 390 | } |
391 | - if( ! is_array( $update_info ) || ! isset( $update_info[ 'mc_shipping' ] ) || ! isset( $update_info[ 'tax' ] ) ) { |
|
391 | + if ( ! is_array($update_info) || ! isset($update_info['mc_shipping']) || ! isset($update_info['tax'])) { |
|
392 | 392 | $this->log( |
393 | 393 | array( |
394 | 394 | 'url' => $this->_process_response_url(), |
395 | - 'message' => __( 'Could not update transaction based on payment because the payment details have not yet been put on the payment. This normally happens during the IPN or returning from PayPal', 'event_espresso' ), |
|
395 | + 'message' => __('Could not update transaction based on payment because the payment details have not yet been put on the payment. This normally happens during the IPN or returning from PayPal', 'event_espresso'), |
|
396 | 396 | 'payment' => $payment->model_field_array() |
397 | 397 | ), |
398 | 398 | $payment |
@@ -408,24 +408,24 @@ discard block |
||
408 | 408 | $grand_total_needs_resaving = FALSE; |
409 | 409 | |
410 | 410 | //might PayPal have added shipping? |
411 | - if( $this->_paypal_shipping && floatval( $update_info[ 'mc_shipping' ] ) != 0 ){ |
|
412 | - $this->_line_item->add_unrelated_item( $transaction->total_line_item(), __('Shipping', 'event_espresso'), floatval( $update_info[ 'mc_shipping' ] ), __('Shipping charges calculated by Paypal', 'event_espresso'), 1, FALSE, 'paypal_shipping' ); |
|
411 | + if ($this->_paypal_shipping && floatval($update_info['mc_shipping']) != 0) { |
|
412 | + $this->_line_item->add_unrelated_item($transaction->total_line_item(), __('Shipping', 'event_espresso'), floatval($update_info['mc_shipping']), __('Shipping charges calculated by Paypal', 'event_espresso'), 1, FALSE, 'paypal_shipping'); |
|
413 | 413 | $grand_total_needs_resaving = TRUE; |
414 | 414 | |
415 | 415 | } |
416 | 416 | //might PayPal have changed the taxes? |
417 | - if( $this->_paypal_taxes && floatval( $update_info[ 'tax' ] ) != $redirect_args[ 'tax_cart' ] ){ |
|
418 | - $this->_line_item->set_total_tax_to( $transaction->total_line_item(), floatval( $update_info['tax'] ), __( 'Taxes', 'event_espresso' ), __( 'Calculated by Paypal', 'event_espresso' ) ); |
|
417 | + if ($this->_paypal_taxes && floatval($update_info['tax']) != $redirect_args['tax_cart']) { |
|
418 | + $this->_line_item->set_total_tax_to($transaction->total_line_item(), floatval($update_info['tax']), __('Taxes', 'event_espresso'), __('Calculated by Paypal', 'event_espresso')); |
|
419 | 419 | $grand_total_needs_resaving = TRUE; |
420 | 420 | } |
421 | 421 | |
422 | - if( $grand_total_needs_resaving ){ |
|
423 | - $transaction->total_line_item()->save_this_and_descendants_to_txn( $transaction->ID() ); |
|
422 | + if ($grand_total_needs_resaving) { |
|
423 | + $transaction->total_line_item()->save_this_and_descendants_to_txn($transaction->ID()); |
|
424 | 424 | } |
425 | 425 | $this->log( |
426 | 426 | array( |
427 | 427 | 'url' => $this->_process_response_url(), |
428 | - 'message' => __( 'Updated transaction related to payment', 'event_espresso' ), |
|
428 | + 'message' => __('Updated transaction related to payment', 'event_espresso'), |
|
429 | 429 | 'transaction (updated)' => $transaction->model_field_array(), |
430 | 430 | 'payment (updated)' => $payment->model_field_array(), |
431 | 431 | 'use_paypal_shipping' => $this->_paypal_shipping, |