@@ -65,20 +65,20 @@ discard block |
||
65 | 65 | </thead> |
66 | 66 | <tbody> |
67 | 67 | <?php |
68 | - /** |
|
69 | - * Recursive function for traversing all the sub-items of each line item |
|
70 | - * and displaying them in the table |
|
71 | - * |
|
72 | - * @param EE_Line_Item $line_item |
|
73 | - * @param boolean $odd for indicating whether to style this line item as an 'odd' or 'even' |
|
74 | - */ |
|
75 | - function ee_invoice_display_line_item(EE_Line_Item $line_item, $show_line_item_description, $odd = false) |
|
76 | - { |
|
77 | - switch ($line_item->type()) { |
|
78 | - case EEM_Line_Item::type_total: |
|
79 | - foreach ($line_item->children() as $child_line_item) { |
|
80 | - ee_invoice_display_line_item($child_line_item, $show_line_item_description); |
|
81 | - } ?> |
|
68 | + /** |
|
69 | + * Recursive function for traversing all the sub-items of each line item |
|
70 | + * and displaying them in the table |
|
71 | + * |
|
72 | + * @param EE_Line_Item $line_item |
|
73 | + * @param boolean $odd for indicating whether to style this line item as an 'odd' or 'even' |
|
74 | + */ |
|
75 | + function ee_invoice_display_line_item(EE_Line_Item $line_item, $show_line_item_description, $odd = false) |
|
76 | + { |
|
77 | + switch ($line_item->type()) { |
|
78 | + case EEM_Line_Item::type_total: |
|
79 | + foreach ($line_item->children() as $child_line_item) { |
|
80 | + ee_invoice_display_line_item($child_line_item, $show_line_item_description); |
|
81 | + } ?> |
|
82 | 82 | <tr> |
83 | 83 | <td colspan="<?php echo $show_line_item_description ? 5 : 4 ?>"> |
84 | 84 | <hr> |
@@ -90,50 +90,50 @@ discard block |
||
90 | 90 | <td class="total"><?php echo $line_item->total_no_code(); ?></td> |
91 | 91 | </tr> |
92 | 92 | <?php |
93 | - break; |
|
93 | + break; |
|
94 | 94 | |
95 | 95 | |
96 | - case EEM_Line_Item::type_sub_total: |
|
97 | - foreach ($line_item->children() as $child_line_item) { |
|
98 | - // $odd = !$odd; |
|
99 | - ee_invoice_display_line_item($child_line_item, $show_line_item_description, $odd); |
|
100 | - } ?> |
|
96 | + case EEM_Line_Item::type_sub_total: |
|
97 | + foreach ($line_item->children() as $child_line_item) { |
|
98 | + // $odd = !$odd; |
|
99 | + ee_invoice_display_line_item($child_line_item, $show_line_item_description, $odd); |
|
100 | + } ?> |
|
101 | 101 | <tr class="total_tr odd"> |
102 | 102 | <td colspan="<?php echo $show_line_item_description ? 2 : 1 ?>"> </td> |
103 | 103 | <td colspan="2" class="total" id="total_currency"> |
104 | 104 | <?php _e( |
105 | - 'Sub-Total', |
|
106 | - 'event_espresso' |
|
107 | - ); ?></td> |
|
105 | + 'Sub-Total', |
|
106 | + 'event_espresso' |
|
107 | + ); ?></td> |
|
108 | 108 | <td class="total"><?php echo $line_item->total_no_code(); ?></td> |
109 | 109 | </tr> |
110 | 110 | <?php |
111 | - break; |
|
111 | + break; |
|
112 | 112 | |
113 | 113 | |
114 | - case EEM_Line_Item::type_tax_sub_total: |
|
115 | - foreach ($line_item->children() as $child_line_item) { |
|
116 | - $odd = ! $odd; |
|
117 | - ee_invoice_display_line_item($child_line_item, $show_line_item_description, $odd); |
|
118 | - } ?> |
|
114 | + case EEM_Line_Item::type_tax_sub_total: |
|
115 | + foreach ($line_item->children() as $child_line_item) { |
|
116 | + $odd = ! $odd; |
|
117 | + ee_invoice_display_line_item($child_line_item, $show_line_item_description, $odd); |
|
118 | + } ?> |
|
119 | 119 | <tr class="total_tr odd"> |
120 | 120 | <td colspan="<?php echo $show_line_item_description ? 2 : 1 ?>"> </td> |
121 | 121 | <td colspan="2" class="total" id="total_currency"> |
122 | 122 | <?php _e( |
123 | - 'Tax Total', |
|
124 | - 'event_espresso' |
|
125 | - ); ?></td> |
|
123 | + 'Tax Total', |
|
124 | + 'event_espresso' |
|
125 | + ); ?></td> |
|
126 | 126 | <td class="total"><?php echo $line_item->total_no_code(); ?></td> |
127 | 127 | </tr> |
128 | 128 | <?php |
129 | - break; |
|
129 | + break; |
|
130 | 130 | |
131 | 131 | |
132 | - case EEM_Line_Item::type_line_item: |
|
133 | - $subitems = $line_item->children(); |
|
134 | - $has_subitems = count($subitems) > 1; |
|
135 | - if ($has_subitems) { |
|
136 | - ?> |
|
132 | + case EEM_Line_Item::type_line_item: |
|
133 | + $subitems = $line_item->children(); |
|
134 | + $has_subitems = count($subitems) > 1; |
|
135 | + if ($has_subitems) { |
|
136 | + ?> |
|
137 | 137 | <tr class="item <?php echo $odd ? 'odd' : ''; ?>"> |
138 | 138 | <td class="item_l"><?php echo $line_item->name() ?></td> |
139 | 139 | <?php if ($show_line_item_description) { ?> |
@@ -144,18 +144,18 @@ discard block |
||
144 | 144 | <td class="item_c"><?php echo $line_item->unit_price_no_code() ?></td> |
145 | 145 | |
146 | 146 | <td class="item_r"> <?php echo $line_item->total_no_code(); |
147 | - echo $line_item->is_taxable() ? '*' : '' ?> </td> |
|
147 | + echo $line_item->is_taxable() ? '*' : '' ?> </td> |
|
148 | 148 | <?php // <td class="item_l"><?php $datetimes_strings = array(); foreach($datetimes as $datetime){ $datetimes_strings[]= $datetime->start_date_and_time();} echo implode(", ",$datetimes_strings); |
149 | - ?> |
|
149 | + ?> |
|
150 | 150 | </tr> |
151 | 151 | <?php |
152 | - if ($has_subitems) { |
|
153 | - foreach ($line_item->children() as $child_line_item) { |
|
154 | - ee_invoice_display_line_item($child_line_item, $show_line_item_description, $odd); |
|
155 | - } |
|
156 | - } |
|
157 | - } else {// no subitems - just show this line item |
|
158 | - ?> |
|
152 | + if ($has_subitems) { |
|
153 | + foreach ($line_item->children() as $child_line_item) { |
|
154 | + ee_invoice_display_line_item($child_line_item, $show_line_item_description, $odd); |
|
155 | + } |
|
156 | + } |
|
157 | + } else {// no subitems - just show this line item |
|
158 | + ?> |
|
159 | 159 | <tr class="item <?php echo $odd ? 'odd' : ''; ?>"> |
160 | 160 | <td class="item_l"><?php echo $line_item->name() ?></td> |
161 | 161 | <?php if ($show_line_item_description) { ?> |
@@ -164,15 +164,15 @@ discard block |
||
164 | 164 | <td class="item_l"><?php echo $line_item->quantity() ?></td> |
165 | 165 | <td class="item_c"><?php echo $line_item->unit_price_no_code() ?></td> |
166 | 166 | <td class="item_r"> <?php echo $line_item->total_no_code(); |
167 | - echo $line_item->is_taxable() ? '*' : '' ?> </td> |
|
167 | + echo $line_item->is_taxable() ? '*' : '' ?> </td> |
|
168 | 168 | <?php // <td class="item_l"><?php $datetimes_strings = array(); foreach($datetimes as $datetime){ $datetimes_strings[]= $datetime->start_date_and_time();} echo implode(", ",$datetimes_strings); |
169 | - ?> |
|
169 | + ?> |
|
170 | 170 | </tr> |
171 | 171 | <?php } |
172 | 172 | |
173 | - break; |
|
174 | - case EEM_Line_Item::type_sub_line_item: |
|
175 | - ?> |
|
173 | + break; |
|
174 | + case EEM_Line_Item::type_sub_line_item: |
|
175 | + ?> |
|
176 | 176 | <tr class="item subitem-row"> |
177 | 177 | <td class="item_l subitem"><?php echo $line_item->name(); ?></td> |
178 | 178 | <?php if ($show_line_item_description) { ?> |
@@ -188,9 +188,9 @@ discard block |
||
188 | 188 | <td class="item_r"><?php echo $line_item->total_no_code(); ?></td> |
189 | 189 | </tr> |
190 | 190 | <?php |
191 | - break; |
|
192 | - case EEM_Line_Item::type_tax: |
|
193 | - ?> |
|
191 | + break; |
|
192 | + case EEM_Line_Item::type_tax: |
|
193 | + ?> |
|
194 | 194 | <tr class="item sub-item tax-total"> |
195 | 195 | <td class="item_l"><?php echo $line_item->name(); ?></td> |
196 | 196 | <?php if ($show_line_item_description) { ?> |
@@ -200,15 +200,15 @@ discard block |
||
200 | 200 | |
201 | 201 | <td class="item_r"><?php echo $line_item->total_no_code(); ?></td> |
202 | 202 | </tr><?php |
203 | - break; |
|
204 | - } |
|
205 | - } |
|
203 | + break; |
|
204 | + } |
|
205 | + } |
|
206 | 206 | |
207 | - $c = false; |
|
208 | - /* @var $transaction EE_Transaction */ |
|
209 | - $total_line_item = $transaction->total_line_item(); |
|
210 | - ee_invoice_display_line_item($total_line_item, $show_line_item_description); |
|
211 | - /* foreach($transaction->registrations() as $registration){ |
|
207 | + $c = false; |
|
208 | + /* @var $transaction EE_Transaction */ |
|
209 | + $total_line_item = $transaction->total_line_item(); |
|
210 | + ee_invoice_display_line_item($total_line_item, $show_line_item_description); |
|
211 | + /* foreach($transaction->registrations() as $registration){ |
|
212 | 212 | ?> |
213 | 213 | <tr class="item <?php echo ($c = !$c) ? ' odd' : ''; ?>"> |
214 | 214 | <td class="item_l">1</td> |
@@ -237,11 +237,11 @@ discard block |
||
237 | 237 | </thead> |
238 | 238 | <tbody> |
239 | 239 | <?php |
240 | - $c = false; |
|
241 | - if (! empty($payments)) { |
|
242 | - foreach ($payments as $payment) { |
|
243 | - /* @var $payment EE_Payment */ |
|
244 | - ?> |
|
240 | + $c = false; |
|
241 | + if (! empty($payments)) { |
|
242 | + foreach ($payments as $payment) { |
|
243 | + /* @var $payment EE_Payment */ |
|
244 | + ?> |
|
245 | 245 | <tr class='item <?php echo(($c = ! $c) ? ' odd' : '') ?>'> |
246 | 246 | <td><?php $payment->e('PAY_gateway') ?></td> |
247 | 247 | <td><?php echo $payment->timestamp('D M j, Y') ?></td> |
@@ -251,17 +251,17 @@ discard block |
||
251 | 251 | <td class='item_r'><?php echo EEH_Template::format_currency($payment->amount()); ?></td> |
252 | 252 | </tr> |
253 | 253 | <?php } |
254 | - } else { |
|
255 | - ?> |
|
254 | + } else { |
|
255 | + ?> |
|
256 | 256 | <tr class='item'> |
257 | 257 | <td class='aln-cntr' colspan=6> |
258 | 258 | <?php _e( |
259 | - "No approved payments have been received", |
|
260 | - 'event_espresso' |
|
261 | - ) ?></td> |
|
259 | + "No approved payments have been received", |
|
260 | + 'event_espresso' |
|
261 | + ) ?></td> |
|
262 | 262 | </tr> |
263 | 263 | <?php } |
264 | - ?> |
|
264 | + ?> |
|
265 | 265 | </tbody> |
266 | 266 | <tfoot> |
267 | 267 | <tr class='total_tr'> |
@@ -238,7 +238,7 @@ |
||
238 | 238 | <tbody> |
239 | 239 | <?php |
240 | 240 | $c = false; |
241 | - if (! empty($payments)) { |
|
241 | + if ( ! empty($payments)) { |
|
242 | 242 | foreach ($payments as $payment) { |
243 | 243 | /* @var $payment EE_Payment */ |
244 | 244 | ?> |
@@ -8,9 +8,9 @@ |
||
8 | 8 | <head> |
9 | 9 | <title>[organization]<?php __(' Invoice #', 'event_espresso'); ?>[registration_code] |
10 | 10 | <?php __( |
11 | - ' for ', |
|
12 | - 'event_espresso' |
|
13 | - ); ?>[name]</title> |
|
11 | + ' for ', |
|
12 | + 'event_espresso' |
|
13 | + ); ?>[name]</title> |
|
14 | 14 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
15 | 15 | <!-- Base Stylesheet do not change or remove --> |
16 | 16 | <link rel="stylesheet" type="text/css" href="[base_url]base.css" media="screen"/> |
@@ -43,33 +43,33 @@ discard block |
||
43 | 43 | </h3> |
44 | 44 | <h3 id="invoice-txn-status"><?php _e('Status:', 'event_espresso') ?> <span |
45 | 45 | class="<?php echo $transaction->status_ID( |
46 | - ) ?> plain-text"><?php echo $transaction->pretty_status(); ?></span></h3> |
|
46 | + ) ?> plain-text"><?php echo $transaction->pretty_status(); ?></span></h3> |
|
47 | 47 | </div> |
48 | 48 | </td> |
49 | 49 | </tr> |
50 | 50 | </table> |
51 | 51 | <div class="events"> |
52 | 52 | <?php foreach ($events_for_txn as $event_id => $event) { |
53 | - ?><h3 class="section-title event-name"><img class="icon" |
|
53 | + ?><h3 class="section-title event-name"><img class="icon" |
|
54 | 54 | src="<?php echo EE_IMAGES_URL . 'calendar_year-24x24.png'; ?>"> |
55 | 55 | <?php _e( |
56 | - "Event Name:", |
|
57 | - "event_espresso" |
|
58 | - ) ?> <span class="plain-text"><?php echo $event->name(); ?></span> <span class="small-text link">[ <a |
|
56 | + "Event Name:", |
|
57 | + "event_espresso" |
|
58 | + ) ?> <span class="plain-text"><?php echo $event->name(); ?></span> <span class="small-text link">[ <a |
|
59 | 59 | href='<?php echo $event->get_permalink() ?>'><?php _e('view', 'event_espresso'); ?></a> ]</span> |
60 | 60 | </h3> |
61 | 61 | <?php |
62 | - if (strlen($event->description() > 1)) { |
|
63 | - ?><p class="event-description"><?php $event->description() ?></p> |
|
62 | + if (strlen($event->description() > 1)) { |
|
63 | + ?><p class="event-description"><?php $event->description() ?></p> |
|
64 | 64 | <?php |
65 | - } ?> |
|
65 | + } ?> |
|
66 | 66 | <ul class="tickets-per-event"> |
67 | 67 | <?php foreach ($ticket_line_items_per_event[ $event_id ] as $line_item_id => $line_item) { |
68 | - $ticket = $line_item->ticket(); |
|
69 | - $taxable_html = $ticket->taxable() ? '*' : ''; |
|
70 | - $subitems = $line_item->children(); |
|
71 | - $ticket_uses = $ticket->get_pretty('TKT_uses', __("any", "event_espresso")); |
|
72 | - ?> |
|
68 | + $ticket = $line_item->ticket(); |
|
69 | + $taxable_html = $ticket->taxable() ? '*' : ''; |
|
70 | + $subitems = $line_item->children(); |
|
71 | + $ticket_uses = $ticket->get_pretty('TKT_uses', __("any", "event_espresso")); |
|
72 | + ?> |
|
73 | 73 | <li class="event-ticket"> |
74 | 74 | <div class="ticket-details"> |
75 | 75 | <table class="invoice-amount"> |
@@ -78,9 +78,9 @@ discard block |
||
78 | 78 | <th class="name-column"><?php _e("Ticket", "event_espresso"); ?></th> |
79 | 79 | <th colspan="2" class="desc-column"> |
80 | 80 | <?php _e( |
81 | - "Description", |
|
82 | - "event_espresso" |
|
83 | - ); ?></th> |
|
81 | + "Description", |
|
82 | + "event_espresso" |
|
83 | + ); ?></th> |
|
84 | 84 | <th class="number-column item_c"><?php _e("Quantity", "event_espresso"); ?></th> |
85 | 85 | <th class="number-column item_c"><?php _e("Price", "event_espresso"); ?></th> |
86 | 86 | <th class="number-column item_r"><?php _e("Total", "event_espresso"); ?></th> |
@@ -93,12 +93,12 @@ discard block |
||
93 | 93 | <td colspan="2"><?php echo $line_item->desc(); ?><p |
94 | 94 | class="ticket-note"> |
95 | 95 | <?php echo sprintf( |
96 | - __( |
|
97 | - 'This ticket can be used once at %s of the dates/times below.', |
|
98 | - 'event_espresso' |
|
99 | - ), |
|
100 | - $ticket_uses |
|
101 | - ); ?></p></td> |
|
96 | + __( |
|
97 | + 'This ticket can be used once at %s of the dates/times below.', |
|
98 | + 'event_espresso' |
|
99 | + ), |
|
100 | + $ticket_uses |
|
101 | + ); ?></p></td> |
|
102 | 102 | <td class="item_c"><?php echo $line_item->quantity() ?></td> |
103 | 103 | <td class="item_c"><?php echo $line_item->unit_price_no_code() ?></td> |
104 | 104 | <td class="item_r"><?php echo $line_item->total_no_code() ?></td> |
@@ -109,24 +109,24 @@ discard block |
||
109 | 109 | <td colspan="2"><?php echo $line_item->desc(); ?><p |
110 | 110 | class="ticket-note"> |
111 | 111 | <?php echo sprintf( |
112 | - __( |
|
113 | - 'This ticket can be used once at %s of the dates/times below.', |
|
114 | - 'event_espresso' |
|
115 | - ), |
|
116 | - $ticket_uses |
|
117 | - ); ?></p></td> |
|
112 | + __( |
|
113 | + 'This ticket can be used once at %s of the dates/times below.', |
|
114 | + 'event_espresso' |
|
115 | + ), |
|
116 | + $ticket_uses |
|
117 | + ); ?></p></td> |
|
118 | 118 | <td class="item_c"><?php echo $line_item->quantity() ?></td> |
119 | 119 | <td class="item_c"><?php echo $line_item->unit_price_no_code() ?></td> |
120 | 120 | <td class="item_r"><?php echo $line_item->total_no_code() ?></td> |
121 | 121 | </tr> |
122 | 122 | <?php foreach ($subitems as $sub_line_item) { |
123 | - $is_percent = $sub_line_item->is_percent(); ?> |
|
123 | + $is_percent = $sub_line_item->is_percent(); ?> |
|
124 | 124 | <tr class="subitem-row"> |
125 | 125 | <td class="subitem"><?php echo $sub_line_item->name() ?></td> |
126 | 126 | <td colspan="2"><?php echo $sub_line_item->desc() ?></td> |
127 | 127 | <td class="item_c"><?php // echo $is_percent ? '' : $sub_line_item->quantity()?></td> |
128 | 128 | <td class="item_c"><?php echo $is_percent ? $sub_line_item->percent() . "%" |
129 | - : $sub_line_item->unit_price_no_code() ?></td> |
|
129 | + : $sub_line_item->unit_price_no_code() ?></td> |
|
130 | 130 | <td class="item_r"><?php echo $sub_line_item->total_no_code() ?></td> |
131 | 131 | </tr> |
132 | 132 | <?php } ?> |
@@ -134,9 +134,9 @@ discard block |
||
134 | 134 | <td colspan="4"></td> |
135 | 135 | <td class="total" nowrap="nowrap"> |
136 | 136 | <?php _e( |
137 | - "Ticket Total:", |
|
138 | - "event_espresso" |
|
139 | - ); ?></td> |
|
137 | + "Ticket Total:", |
|
138 | + "event_espresso" |
|
139 | + ); ?></td> |
|
140 | 140 | <td class="item_r"><?php echo $line_item->total_no_code() ?></td> |
141 | 141 | </tr> |
142 | 142 | <?php } ?> |
@@ -150,25 +150,25 @@ discard block |
||
150 | 150 | <h4 class="sub-section-title no-bottom-margin"><img class="icon" |
151 | 151 | src="<?php echo EE_IMAGES_URL . 'clock-16x16.png'; ?>"> |
152 | 152 | <?php echo _n( |
153 | - "Date/Time:", |
|
154 | - "Dates/Times:", |
|
155 | - count($ticket->datetimes()), |
|
156 | - "event_espresso" |
|
157 | - ); ?></h4> |
|
153 | + "Date/Time:", |
|
154 | + "Dates/Times:", |
|
155 | + count($ticket->datetimes()), |
|
156 | + "event_espresso" |
|
157 | + ); ?></h4> |
|
158 | 158 | <ul class="event-dates"> |
159 | 159 | <?php foreach ($ticket->datetimes_ordered() as $datetime) { |
160 | - /* @var $datetime EE_Datetime */ ?> |
|
160 | + /* @var $datetime EE_Datetime */ ?> |
|
161 | 161 | <li><?php |
162 | - echo $datetime->name() ? '<b>' . $datetime->name() . ' </b>' : ''; |
|
163 | - echo sprintf( |
|
164 | - __("%s - %s (%s)", "event_espresso"), |
|
165 | - $datetime->start_date_and_time(), |
|
166 | - $datetime->end_date_and_time(), |
|
167 | - $datetime->get_timezone() |
|
168 | - ); |
|
169 | - echo $datetime->description() |
|
170 | - ? '<p class="ticket-note">' . $datetime->description() . '</p>' |
|
171 | - : '' ?></li> |
|
162 | + echo $datetime->name() ? '<b>' . $datetime->name() . ' </b>' : ''; |
|
163 | + echo sprintf( |
|
164 | + __("%s - %s (%s)", "event_espresso"), |
|
165 | + $datetime->start_date_and_time(), |
|
166 | + $datetime->end_date_and_time(), |
|
167 | + $datetime->get_timezone() |
|
168 | + ); |
|
169 | + echo $datetime->description() |
|
170 | + ? '<p class="ticket-note">' . $datetime->description() . '</p>' |
|
171 | + : '' ?></li> |
|
172 | 172 | <?php } ?> |
173 | 173 | </ul> |
174 | 174 | </div> |
@@ -177,19 +177,19 @@ discard block |
||
177 | 177 | <h4 class="sub-section-title no-bottom-margin"><img class="icon" |
178 | 178 | src="<?php echo EE_IMAGES_URL . 'location-pin-16x16.png'; ?>"> |
179 | 179 | <?php echo _n( |
180 | - "Venue:", |
|
181 | - "Venues:", |
|
182 | - count($event->venues()), |
|
183 | - "event_espresso" |
|
184 | - ); ?></h4> |
|
180 | + "Venue:", |
|
181 | + "Venues:", |
|
182 | + count($event->venues()), |
|
183 | + "event_espresso" |
|
184 | + ); ?></h4> |
|
185 | 185 | <ul class="event-venues"> |
186 | 186 | <?php foreach ($event->venues() as $venue) { ?> |
187 | 187 | <li><?php echo $venue->name() ?> <span class="small-text">[ <a |
188 | 188 | href='<?php echo $venue->get_permalink() ?>'> |
189 | 189 | <?php _e( |
190 | - 'view', |
|
191 | - 'event_espresso' |
|
192 | - ); ?></a> ]</span></li> |
|
190 | + 'view', |
|
191 | + 'event_espresso' |
|
192 | + ); ?></a> ]</span></li> |
|
193 | 193 | <?php } ?> |
194 | 194 | </ul> |
195 | 195 | </div> |
@@ -199,21 +199,21 @@ discard block |
||
199 | 199 | <h4 class="sub-section-title"><img class="icon" |
200 | 200 | src="<?php echo EE_IMAGES_URL . 'users-16x16.png'; ?>"> |
201 | 201 | <?php echo __( |
202 | - "Registration Details", |
|
203 | - "event_espresso" |
|
204 | - ); ?> <span class="small-text link">[ <a class="print_button noPrint" |
|
202 | + "Registration Details", |
|
203 | + "event_espresso" |
|
204 | + ); ?> <span class="small-text link">[ <a class="print_button noPrint" |
|
205 | 205 | href="<?php echo $edit_reg_info_url; ?>"> |
206 | 206 | <?php _e( |
207 | - 'edit', |
|
208 | - 'event_espresso' |
|
209 | - ); ?></a> ]</span></h4> |
|
207 | + 'edit', |
|
208 | + 'event_espresso' |
|
209 | + ); ?></a> ]</span></h4> |
|
210 | 210 | <ul class="ticket-registrations-list"> |
211 | 211 | <?php foreach ($registrations_per_line_item[ $line_item_id ] as $registration) { |
212 | - /* @var $registration EE_Registration */ |
|
213 | - $attendee = $registration->attendee(); |
|
214 | - $answers = $registration->answers( |
|
215 | - array('order_by' => array('Question.Question_Group_Question.QGQ_order' => 'ASC')) |
|
216 | - ); ?> |
|
212 | + /* @var $registration EE_Registration */ |
|
213 | + $attendee = $registration->attendee(); |
|
214 | + $answers = $registration->answers( |
|
215 | + array('order_by' => array('Question.Question_Group_Question.QGQ_order' => 'ASC')) |
|
216 | + ); ?> |
|
217 | 217 | <li class="ticket-registration"> |
218 | 218 | <table class="registration-details"> |
219 | 219 | <tr class="odd"> |
@@ -224,39 +224,39 @@ discard block |
||
224 | 224 | </td> |
225 | 225 | </tr> |
226 | 226 | <?php |
227 | - foreach ($event->question_groups() as $question_group) { |
|
228 | - ?> |
|
227 | + foreach ($event->question_groups() as $question_group) { |
|
228 | + ?> |
|
229 | 229 | <tr> |
230 | 230 | <th><?php $question_group->e('QSG_name'); ?></th> |
231 | 231 | <td></td></tr><?php |
232 | - $has_personal_info = false; |
|
233 | - foreach ($question_group->questions() as $question) { |
|
234 | - if (in_array($question->system_ID(), $questions_to_skip)) { |
|
235 | - $has_personal_info = true; |
|
236 | - continue; |
|
237 | - } |
|
238 | - ?> |
|
232 | + $has_personal_info = false; |
|
233 | + foreach ($question_group->questions() as $question) { |
|
234 | + if (in_array($question->system_ID(), $questions_to_skip)) { |
|
235 | + $has_personal_info = true; |
|
236 | + continue; |
|
237 | + } |
|
238 | + ?> |
|
239 | 239 | <tr> |
240 | 240 | <th><?php echo $question->display_text() ?></th> |
241 | 241 | <td> |
242 | 242 | <?php echo $registration->answer_value_to_question( |
243 | - $question |
|
244 | - ); ?></td> |
|
243 | + $question |
|
244 | + ); ?></td> |
|
245 | 245 | </tr><?php |
246 | - } |
|
247 | - if ($has_personal_info) { |
|
248 | - ?> |
|
246 | + } |
|
247 | + if ($has_personal_info) { |
|
248 | + ?> |
|
249 | 249 | <tr> |
250 | 250 | <th><?php _e('Attendee', 'event_espresso'); ?></th> |
251 | 251 | <td> |
252 | 252 | <?php echo sprintf( |
253 | - __('%s (%s)', "event_espresso"), |
|
254 | - $attendee->full_name(), |
|
255 | - $attendee->email() |
|
256 | - ) ?></td></tr><?php |
|
257 | - } |
|
258 | - } |
|
259 | - ?> |
|
253 | + __('%s (%s)', "event_espresso"), |
|
254 | + $attendee->full_name(), |
|
255 | + $attendee->email() |
|
256 | + ) ?></td></tr><?php |
|
257 | + } |
|
258 | + } |
|
259 | + ?> |
|
260 | 260 | </table> |
261 | 261 | </li> |
262 | 262 | <?php } ?> |
@@ -284,8 +284,8 @@ discard block |
||
284 | 284 | </thead> |
285 | 285 | <tbody> |
286 | 286 | <?php |
287 | - foreach ($tax_total_line_item->children() as $child_tax) { |
|
288 | - ?> |
|
287 | + foreach ($tax_total_line_item->children() as $child_tax) { |
|
288 | + ?> |
|
289 | 289 | <tr> |
290 | 290 | <td><?php echo $child_tax->name() ?></td> |
291 | 291 | <td><?php echo $child_tax->desc() ?></td> |
@@ -307,9 +307,9 @@ discard block |
||
307 | 307 | <div class="grand-total-dv"> |
308 | 308 | <h2 class="grand-total"> |
309 | 309 | <?php printf( |
310 | - __("Grand Total: %s", "event_espresso"), |
|
311 | - EEH_Template::format_currency($total_cost) |
|
312 | - ); ?></h2> |
|
310 | + __("Grand Total: %s", "event_espresso"), |
|
311 | + EEH_Template::format_currency($total_cost) |
|
312 | + ); ?></h2> |
|
313 | 313 | </div> |
314 | 314 | <div class="payment-dv"> |
315 | 315 | <h3 class="section-title"><?php _e("Payments", 'event_espresso') ?></h3> |
@@ -327,11 +327,11 @@ discard block |
||
327 | 327 | </thead> |
328 | 328 | <tbody> |
329 | 329 | <?php |
330 | - $c = false; |
|
331 | - if (! empty($payments)) { |
|
332 | - foreach ($payments as $payment) { |
|
333 | - /* @var $payment EE_Payment */ |
|
334 | - ?> |
|
330 | + $c = false; |
|
331 | + if (! empty($payments)) { |
|
332 | + foreach ($payments as $payment) { |
|
333 | + /* @var $payment EE_Payment */ |
|
334 | + ?> |
|
335 | 335 | <tr class='item <?php echo(($c = ! $c) ? ' odd' : '') ?>'> |
336 | 336 | <td><?php $payment->e('PAY_gateway') ?></td> |
337 | 337 | <td><?php echo $payment->timestamp() ?></td> |
@@ -341,28 +341,28 @@ discard block |
||
341 | 341 | <td class='item_r'><?php echo $payment->amount_no_code() ?></td> |
342 | 342 | </tr> |
343 | 343 | <?php } |
344 | - } else { |
|
345 | - ?> |
|
344 | + } else { |
|
345 | + ?> |
|
346 | 346 | <tr class='item'> |
347 | 347 | <td class='aln-cntr' colspan="6"> |
348 | 348 | <?php _e( |
349 | - "No approved payments have been received.", |
|
350 | - 'event_espresso' |
|
351 | - ) ?> </td> |
|
349 | + "No approved payments have been received.", |
|
350 | + 'event_espresso' |
|
351 | + ) ?> </td> |
|
352 | 352 | </tr> |
353 | 353 | <?php } |
354 | - ?> |
|
354 | + ?> |
|
355 | 355 | <tr class="item"> |
356 | 356 | <td class='aln-cntr' colspan="6"> |
357 | 357 | <?php |
358 | - if ($amount_owed) { |
|
359 | - ?><a class="noPrint" href='<?php echo $retry_payment_url ?>'> |
|
358 | + if ($amount_owed) { |
|
359 | + ?><a class="noPrint" href='<?php echo $retry_payment_url ?>'> |
|
360 | 360 | <?php _e( |
361 | - "Please make a payment.", |
|
362 | - "event_espresso" |
|
363 | - ); |
|
364 | - } |
|
365 | - ?></a></td> |
|
361 | + "Please make a payment.", |
|
362 | + "event_espresso" |
|
363 | + ); |
|
364 | + } |
|
365 | + ?></a></td> |
|
366 | 366 | </tr> |
367 | 367 | </tbody> |
368 | 368 | <tfoot> |
@@ -386,25 +386,25 @@ discard block |
||
386 | 386 | <?php if ($venues_for_events) { ?> |
387 | 387 | <h2> |
388 | 388 | <?php echo _n( |
389 | - "Venue Details:", |
|
390 | - "Venues Details:", |
|
391 | - count($venues_for_events), |
|
392 | - "event_espresso" |
|
393 | - ); ?></h2> |
|
389 | + "Venue Details:", |
|
390 | + "Venues Details:", |
|
391 | + count($venues_for_events), |
|
392 | + "event_espresso" |
|
393 | + ); ?></h2> |
|
394 | 394 | <table class="venue-list"> |
395 | 395 | <?php foreach ($venues_for_events as $venue) { ?> |
396 | 396 | <tr class="venue-details"> |
397 | 397 | <td class="venue-details-part venue-address-dv"> |
398 | 398 | <h3><a href='<?php echo $venue->get_permalink() ?>'><?php |
399 | - echo $venue->name() |
|
400 | - ?></a></h3> |
|
399 | + echo $venue->name() |
|
400 | + ?></a></h3> |
|
401 | 401 | <p><?php echo $venue->description() ?></p> |
402 | 402 | <?php echo EEH_Address::format($venue); ?></td> |
403 | 403 | <?php if ($venue->enable_for_gmap()) { ?> |
404 | 404 | <td class="venue-details-part venue-image-dv"> |
405 | 405 | <?php echo EEH_Venue_View::espresso_google_static_map( |
406 | - $venue |
|
407 | - ) ?></td> |
|
406 | + $venue |
|
407 | + ) ?></td> |
|
408 | 408 | <?php } ?> |
409 | 409 | </tr> |
410 | 410 | <?php } ?> |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | <div class="events"> |
52 | 52 | <?php foreach ($events_for_txn as $event_id => $event) { |
53 | 53 | ?><h3 class="section-title event-name"><img class="icon" |
54 | - src="<?php echo EE_IMAGES_URL . 'calendar_year-24x24.png'; ?>"> |
|
54 | + src="<?php echo EE_IMAGES_URL.'calendar_year-24x24.png'; ?>"> |
|
55 | 55 | <?php _e( |
56 | 56 | "Event Name:", |
57 | 57 | "event_espresso" |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | <?php |
65 | 65 | } ?> |
66 | 66 | <ul class="tickets-per-event"> |
67 | - <?php foreach ($ticket_line_items_per_event[ $event_id ] as $line_item_id => $line_item) { |
|
67 | + <?php foreach ($ticket_line_items_per_event[$event_id] as $line_item_id => $line_item) { |
|
68 | 68 | $ticket = $line_item->ticket(); |
69 | 69 | $taxable_html = $ticket->taxable() ? '*' : ''; |
70 | 70 | $subitems = $line_item->children(); |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | <tbody> |
90 | 90 | <?php if (count($subitems) < 2) { ?> |
91 | 91 | <tr class="item"> |
92 | - <td><?php echo $line_item->name() . $taxable_html ?></td> |
|
92 | + <td><?php echo $line_item->name().$taxable_html ?></td> |
|
93 | 93 | <td colspan="2"><?php echo $line_item->desc(); ?><p |
94 | 94 | class="ticket-note"> |
95 | 95 | <?php echo sprintf( |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | </tr> |
106 | 106 | <?php } else { ?> |
107 | 107 | <tr class="item"> |
108 | - <td class="aln-left"><?php echo $line_item->name() . $taxable_html ?></td> |
|
108 | + <td class="aln-left"><?php echo $line_item->name().$taxable_html ?></td> |
|
109 | 109 | <td colspan="2"><?php echo $line_item->desc(); ?><p |
110 | 110 | class="ticket-note"> |
111 | 111 | <?php echo sprintf( |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | <td class="subitem"><?php echo $sub_line_item->name() ?></td> |
126 | 126 | <td colspan="2"><?php echo $sub_line_item->desc() ?></td> |
127 | 127 | <td class="item_c"><?php // echo $is_percent ? '' : $sub_line_item->quantity()?></td> |
128 | - <td class="item_c"><?php echo $is_percent ? $sub_line_item->percent() . "%" |
|
128 | + <td class="item_c"><?php echo $is_percent ? $sub_line_item->percent()."%" |
|
129 | 129 | : $sub_line_item->unit_price_no_code() ?></td> |
130 | 130 | <td class="item_r"><?php echo $sub_line_item->total_no_code() ?></td> |
131 | 131 | </tr> |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | <div class="ticket-time-and-place-details"> |
149 | 149 | <div class="ticket-time-details"> |
150 | 150 | <h4 class="sub-section-title no-bottom-margin"><img class="icon" |
151 | - src="<?php echo EE_IMAGES_URL . 'clock-16x16.png'; ?>"> |
|
151 | + src="<?php echo EE_IMAGES_URL.'clock-16x16.png'; ?>"> |
|
152 | 152 | <?php echo _n( |
153 | 153 | "Date/Time:", |
154 | 154 | "Dates/Times:", |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | <?php foreach ($ticket->datetimes_ordered() as $datetime) { |
160 | 160 | /* @var $datetime EE_Datetime */ ?> |
161 | 161 | <li><?php |
162 | - echo $datetime->name() ? '<b>' . $datetime->name() . ' </b>' : ''; |
|
162 | + echo $datetime->name() ? '<b>'.$datetime->name().' </b>' : ''; |
|
163 | 163 | echo sprintf( |
164 | 164 | __("%s - %s (%s)", "event_espresso"), |
165 | 165 | $datetime->start_date_and_time(), |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | $datetime->get_timezone() |
168 | 168 | ); |
169 | 169 | echo $datetime->description() |
170 | - ? '<p class="ticket-note">' . $datetime->description() . '</p>' |
|
170 | + ? '<p class="ticket-note">'.$datetime->description().'</p>' |
|
171 | 171 | : '' ?></li> |
172 | 172 | <?php } ?> |
173 | 173 | </ul> |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | <?php if ($event->venues()) { ?> |
176 | 176 | <div class="ticket-place-details"> |
177 | 177 | <h4 class="sub-section-title no-bottom-margin"><img class="icon" |
178 | - src="<?php echo EE_IMAGES_URL . 'location-pin-16x16.png'; ?>"> |
|
178 | + src="<?php echo EE_IMAGES_URL.'location-pin-16x16.png'; ?>"> |
|
179 | 179 | <?php echo _n( |
180 | 180 | "Venue:", |
181 | 181 | "Venues:", |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | </div> |
198 | 198 | <div class="ticket-registrations-area"> |
199 | 199 | <h4 class="sub-section-title"><img class="icon" |
200 | - src="<?php echo EE_IMAGES_URL . 'users-16x16.png'; ?>"> |
|
200 | + src="<?php echo EE_IMAGES_URL.'users-16x16.png'; ?>"> |
|
201 | 201 | <?php echo __( |
202 | 202 | "Registration Details", |
203 | 203 | "event_espresso" |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | 'event_espresso' |
209 | 209 | ); ?></a> ]</span></h4> |
210 | 210 | <ul class="ticket-registrations-list"> |
211 | - <?php foreach ($registrations_per_line_item[ $line_item_id ] as $registration) { |
|
211 | + <?php foreach ($registrations_per_line_item[$line_item_id] as $registration) { |
|
212 | 212 | /* @var $registration EE_Registration */ |
213 | 213 | $attendee = $registration->attendee(); |
214 | 214 | $answers = $registration->answers( |
@@ -328,7 +328,7 @@ discard block |
||
328 | 328 | <tbody> |
329 | 329 | <?php |
330 | 330 | $c = false; |
331 | - if (! empty($payments)) { |
|
331 | + if ( ! empty($payments)) { |
|
332 | 332 | foreach ($payments as $payment) { |
333 | 333 | /* @var $payment EE_Payment */ |
334 | 334 | ?> |
@@ -10,718 +10,718 @@ discard block |
||
10 | 10 | class EED_Thank_You_Page extends EED_Module |
11 | 11 | { |
12 | 12 | |
13 | - /** |
|
14 | - * time in seconds to wait for the IPN to arrive before telling the registrant to bugger off ( 1200s = 20 minutes ) |
|
15 | - */ |
|
16 | - const IPN_wait_time = 1200; |
|
17 | - |
|
18 | - /** |
|
19 | - * The transaction specified by the reg_url_link passed from the Request, or from the Session |
|
20 | - * |
|
21 | - * @var EE_Transaction $_current_txn |
|
22 | - */ |
|
23 | - private $_current_txn; |
|
24 | - |
|
25 | - /** |
|
26 | - * @var EE_Registration $_primary_registrant |
|
27 | - */ |
|
28 | - private $_primary_registrant; |
|
29 | - |
|
30 | - /** |
|
31 | - * The reg_url_link passed from the Request, or from the Session |
|
32 | - * |
|
33 | - * @var string $_reg_url_link |
|
34 | - */ |
|
35 | - private $_reg_url_link; |
|
36 | - |
|
37 | - /** |
|
38 | - * whether the incoming reg_url_link is for the primary registrant or not |
|
39 | - * |
|
40 | - * @var boolean $_is_primary |
|
41 | - */ |
|
42 | - private $_is_primary; |
|
43 | - |
|
44 | - /** |
|
45 | - * The URL for revisiting the SPCO attendee information step |
|
46 | - * |
|
47 | - * @var string $_SPCO_attendee_information_url |
|
48 | - */ |
|
49 | - private $_SPCO_attendee_information_url; |
|
50 | - |
|
51 | - /** |
|
52 | - * The URL for revisiting the SPCO payment options step |
|
53 | - * |
|
54 | - * @var string $_SPCO_payment_options_url |
|
55 | - */ |
|
56 | - private $_SPCO_payment_options_url; |
|
57 | - |
|
58 | - /** |
|
59 | - * whether to display the Payment Options link |
|
60 | - * |
|
61 | - * @var boolean $_show_try_pay_again_link |
|
62 | - */ |
|
63 | - private $_show_try_pay_again_link = false; |
|
64 | - |
|
65 | - /** |
|
66 | - * whether payments are allowed at this time |
|
67 | - * |
|
68 | - * @var boolean $_payments_closed |
|
69 | - */ |
|
70 | - private $_payments_closed = false; |
|
71 | - |
|
72 | - /** |
|
73 | - * whether the selected payment method is Bank, Check , Invoice, etc |
|
74 | - * |
|
75 | - * @var boolean $_is_offline_payment_method |
|
76 | - */ |
|
77 | - private $_is_offline_payment_method = true; |
|
78 | - |
|
79 | - |
|
80 | - /** |
|
81 | - * @return EED_Module|EED_Thank_You_Page |
|
82 | - */ |
|
83 | - public static function instance() |
|
84 | - { |
|
85 | - return parent::get_instance(__CLASS__); |
|
86 | - } |
|
87 | - |
|
88 | - |
|
89 | - /** |
|
90 | - * set_hooks - for hooking into EE Core, modules, etc |
|
91 | - * |
|
92 | - * @return void |
|
93 | - */ |
|
94 | - public static function set_hooks() |
|
95 | - { |
|
96 | - add_action('wp_loaded', array('EED_Thank_You_Page', 'set_definitions'), 2); |
|
97 | - } |
|
98 | - |
|
99 | - |
|
100 | - /** |
|
101 | - * set_hooks_admin - for hooking into EE Admin Core, modules, etc |
|
102 | - * |
|
103 | - * @return void |
|
104 | - */ |
|
105 | - public static function set_hooks_admin() |
|
106 | - { |
|
107 | - // AJAX for IPN monitoring |
|
108 | - add_filter('heartbeat_received', array('EED_Thank_You_Page', 'thank_you_page_IPN_monitor'), 10, 3); |
|
109 | - add_filter( |
|
110 | - 'heartbeat_nopriv_received', |
|
111 | - array('EED_Thank_You_Page', 'thank_you_page_IPN_monitor'), |
|
112 | - 10, |
|
113 | - 3 |
|
114 | - ); |
|
115 | - add_action( |
|
116 | - 'wp_ajax_espresso_resend_reg_confirmation_email', |
|
117 | - array('EED_Thank_You_Page', 'resend_reg_confirmation_email'), |
|
118 | - 10, |
|
119 | - 2 |
|
120 | - ); |
|
121 | - add_action( |
|
122 | - 'wp_ajax_nopriv_espresso_resend_reg_confirmation_email', |
|
123 | - array('EED_Thank_You_Page', 'resend_reg_confirmation_email'), |
|
124 | - 10, |
|
125 | - 2 |
|
126 | - ); |
|
127 | - } |
|
128 | - |
|
129 | - |
|
130 | - /** |
|
131 | - * set_definitions |
|
132 | - * |
|
133 | - * @return void |
|
134 | - */ |
|
135 | - public static function set_definitions() |
|
136 | - { |
|
137 | - define('THANK_YOU_ASSETS_URL', plugin_dir_url(__FILE__) . 'assets' . DS); |
|
138 | - define('THANK_YOU_TEMPLATES_PATH', str_replace('\\', DS, plugin_dir_path(__FILE__)) . 'templates' . DS); |
|
139 | - } |
|
140 | - |
|
141 | - |
|
142 | - /** |
|
143 | - * get_txn |
|
144 | - * |
|
145 | - * @return EE_Transaction |
|
146 | - */ |
|
147 | - public function get_txn() |
|
148 | - { |
|
149 | - if ($this->_current_txn instanceof EE_Transaction) { |
|
150 | - return $this->_current_txn; |
|
151 | - } |
|
152 | - $TXN_model = EE_Registry::instance()->load_model('Transaction'); |
|
153 | - if (! $TXN_model instanceof EEM_Transaction) { |
|
154 | - EE_Error::add_error( |
|
155 | - __('The transaction model could not be established.', 'event_espresso'), |
|
156 | - __FILE__, |
|
157 | - __FUNCTION__, |
|
158 | - __LINE__ |
|
159 | - ); |
|
160 | - return null; |
|
161 | - } |
|
162 | - // get the transaction. yes, we may have just loaded it, but it may have been updated, or this may be via an ajax request |
|
163 | - $this->_current_txn = $TXN_model->get_transaction_from_reg_url_link($this->_reg_url_link); |
|
164 | - // verify TXN |
|
165 | - if (WP_DEBUG && ! $this->_current_txn instanceof EE_Transaction) { |
|
166 | - EE_Error::add_error( |
|
167 | - __( |
|
168 | - 'No transaction information could be retrieved or the transaction data is not of the correct type.', |
|
169 | - 'event_espresso' |
|
170 | - ), |
|
171 | - __FILE__, |
|
172 | - __FUNCTION__, |
|
173 | - __LINE__ |
|
174 | - ); |
|
175 | - return null; |
|
176 | - } |
|
177 | - return $this->_current_txn; |
|
178 | - } |
|
179 | - |
|
180 | - |
|
181 | - /** |
|
182 | - * get_txn_payments |
|
183 | - * |
|
184 | - * @param int $since |
|
185 | - * @return mixed array of EE_Payment || FALSE |
|
186 | - * @throws \EE_Error |
|
187 | - */ |
|
188 | - public function get_txn_payments($since = 0) |
|
189 | - { |
|
190 | - if (! $this->get_txn()) { |
|
191 | - return false; |
|
192 | - } |
|
193 | - $args = array('order_by' => array('PAY_timestamp' => 'ASC')); |
|
194 | - if ($since > 0) { |
|
195 | - $args[0] = array('PAY_timestamp' => array('>', $since)); |
|
196 | - } |
|
197 | - // get array of payments with most recent first |
|
198 | - return $this->_current_txn->payments($args); |
|
199 | - } |
|
200 | - |
|
201 | - |
|
202 | - /** |
|
203 | - * get_reg_url_link |
|
204 | - * |
|
205 | - * @return void |
|
206 | - */ |
|
207 | - private function _get_reg_url_link() |
|
208 | - { |
|
209 | - if (! empty($this->_reg_url_link)) { |
|
210 | - return; |
|
211 | - } |
|
212 | - // only do thank you page stuff if we have a REG_url_link in the url |
|
213 | - if (WP_DEBUG && ! EE_Registry::instance()->REQ->is_set('e_reg_url_link')) { |
|
214 | - EE_Error::add_error( |
|
215 | - __( |
|
216 | - 'No transaction information could be retrieved because the registration URL link is missing or invalid.', |
|
217 | - 'event_espresso' |
|
218 | - ), |
|
219 | - __FILE__, |
|
220 | - __FUNCTION__, |
|
221 | - __LINE__ |
|
222 | - ); |
|
223 | - return; |
|
224 | - } |
|
225 | - // check for reg_url_link |
|
226 | - $this->_reg_url_link = EE_Registry::instance()->REQ->get('e_reg_url_link'); |
|
227 | - } |
|
228 | - |
|
229 | - |
|
230 | - /** |
|
231 | - * set_reg_url_link |
|
232 | - * |
|
233 | - * @param string $reg_url_link |
|
234 | - */ |
|
235 | - public function set_reg_url_link($reg_url_link = null) |
|
236 | - { |
|
237 | - $this->_reg_url_link = ! empty($reg_url_link) ? $reg_url_link : $this->_reg_url_link; |
|
238 | - } |
|
239 | - |
|
240 | - |
|
241 | - /** |
|
242 | - * run - initial module setup |
|
243 | - * this method is primarily used for activating resources in the EE_Front_Controller thru the use of filters |
|
244 | - * |
|
245 | - * @param WP $WP |
|
246 | - * @return void |
|
247 | - * @throws \EE_Error |
|
248 | - */ |
|
249 | - public function run($WP) |
|
250 | - { |
|
251 | - } |
|
252 | - |
|
253 | - |
|
254 | - /** |
|
255 | - * load_resources |
|
256 | - * |
|
257 | - * @return void |
|
258 | - * @throws \EE_Error |
|
259 | - */ |
|
260 | - public function load_resources() |
|
261 | - { |
|
262 | - $this->_get_reg_url_link(); |
|
263 | - // resend_reg_confirmation_email ? |
|
264 | - if (EE_Registry::instance()->REQ->is_set('resend')) { |
|
265 | - EED_Thank_You_Page::resend_reg_confirmation_email(); |
|
266 | - } |
|
267 | - EE_Registry::instance()->SSN->clear_session(__CLASS__, __FUNCTION__); |
|
268 | - $this->_translate_strings(); |
|
269 | - // load assets |
|
270 | - add_action('wp_enqueue_scripts', array($this, 'load_js'), 10); |
|
271 | - } |
|
272 | - |
|
273 | - |
|
274 | - /** |
|
275 | - * load_js |
|
276 | - * |
|
277 | - * @return void |
|
278 | - */ |
|
279 | - protected function _translate_strings() |
|
280 | - { |
|
281 | - EE_Registry::$i18n_js_strings['e_reg_url_link'] = $this->_reg_url_link; |
|
282 | - EE_Registry::$i18n_js_strings['initial_access'] = time(); |
|
283 | - EE_Registry::$i18n_js_strings['IPN_wait_time'] = EED_Thank_You_Page::IPN_wait_time; |
|
284 | - EE_Registry::$i18n_js_strings['TXN_complete'] = EEM_Transaction::complete_status_code; |
|
285 | - EE_Registry::$i18n_js_strings['TXN_incomplete'] = EEM_Transaction::incomplete_status_code; |
|
286 | - EE_Registry::$i18n_js_strings['checking_for_new_payments'] = __( |
|
287 | - 'checking for new payments...', |
|
288 | - 'event_espresso' |
|
289 | - ); |
|
290 | - EE_Registry::$i18n_js_strings['loading_payment_info'] = __( |
|
291 | - 'loading payment information...', |
|
292 | - 'event_espresso' |
|
293 | - ); |
|
294 | - EE_Registry::$i18n_js_strings['server_error'] = __( |
|
295 | - 'An unknown error occurred on the server while attempting to process your request. Please refresh the page and try again.', |
|
296 | - 'event_espresso' |
|
297 | - ); |
|
298 | - EE_Registry::$i18n_js_strings['slow_IPN'] = apply_filters( |
|
299 | - 'EED_Thank_You_Page__load_js__slow_IPN', |
|
300 | - sprintf( |
|
301 | - __( |
|
302 | - '%sThe Payment Notification appears to be taking longer than usual to arrive. Maybe check back later or just wait for your payment and registration confirmation results to be sent to you via email. We apologize for any inconvenience this may have caused.%s', |
|
303 | - 'event_espresso' |
|
304 | - ), |
|
305 | - '<div id="espresso-thank-you-page-slow-IPN-dv" class="ee-attention jst-left">', |
|
306 | - '</div>' |
|
307 | - ) |
|
308 | - ); |
|
309 | - } |
|
310 | - |
|
311 | - |
|
312 | - /** |
|
313 | - * load_js |
|
314 | - * |
|
315 | - * @return void |
|
316 | - */ |
|
317 | - public function load_js() |
|
318 | - { |
|
319 | - wp_register_script( |
|
320 | - 'thank_you_page', |
|
321 | - THANK_YOU_ASSETS_URL . 'thank_you_page.js', |
|
322 | - array('espresso_core', 'heartbeat'), |
|
323 | - EVENT_ESPRESSO_VERSION, |
|
324 | - true |
|
325 | - ); |
|
326 | - wp_enqueue_script('thank_you_page'); |
|
327 | - wp_enqueue_style('espresso_default'); |
|
328 | - } |
|
329 | - |
|
330 | - |
|
331 | - /** |
|
332 | - * init |
|
333 | - * |
|
334 | - * @return void |
|
335 | - * @throws \EE_Error |
|
336 | - */ |
|
337 | - public function init() |
|
338 | - { |
|
339 | - $this->_get_reg_url_link(); |
|
340 | - if (! $this->get_txn()) { |
|
341 | - echo EEH_HTML::div( |
|
342 | - EEH_HTML::h4(__('We\'re sorry...', 'event_espresso'), '', '') . |
|
343 | - sprintf( |
|
344 | - __( |
|
345 | - 'This is a system page for displaying transaction information after a purchase.%1$sYou are most likely seeing this notice because you have navigated to this page%1$sthrough some means other than completing a transaction.%1$sSorry for the disappointment, but you will most likely find nothing of interest here.%1$s%1$s', |
|
346 | - 'event_espresso' |
|
347 | - ), |
|
348 | - '<br/>' |
|
349 | - ), |
|
350 | - '', |
|
351 | - 'ee-attention' |
|
352 | - ); |
|
353 | - return null; |
|
354 | - } |
|
355 | - // if we've made it to the Thank You page, then let's toggle any "Failed" transactions to "Incomplete" |
|
356 | - if ($this->_current_txn->status_ID() === EEM_Transaction::failed_status_code) { |
|
357 | - $this->_current_txn->set_status(EEM_Transaction::incomplete_status_code); |
|
358 | - $this->_current_txn->save(); |
|
359 | - } |
|
360 | - $this->_primary_registrant = $this->_current_txn->primary_registration() instanceof EE_Registration |
|
361 | - ? $this->_current_txn->primary_registration() |
|
362 | - : null; |
|
363 | - $this->_is_primary = $this->_primary_registrant->reg_url_link() === $this->_reg_url_link ? true : false; |
|
364 | - $show_try_pay_again_link_default = apply_filters( |
|
365 | - 'AFEE__EED_Thank_You_Page__init__show_try_pay_again_link_default', |
|
366 | - true |
|
367 | - ); |
|
368 | - $this->_show_try_pay_again_link = $show_try_pay_again_link_default; |
|
369 | - // txn status ? |
|
370 | - if ($this->_current_txn->is_completed()) { |
|
371 | - $this->_show_try_pay_again_link = $show_try_pay_again_link_default; |
|
372 | - } elseif ($this->_current_txn->is_incomplete() |
|
373 | - && ($this->_primary_registrant->is_approved() |
|
374 | - || $this->_primary_registrant->is_pending_payment()) |
|
375 | - ) { |
|
376 | - $this->_show_try_pay_again_link = true; |
|
377 | - } elseif ($this->_primary_registrant->is_approved() || $this->_primary_registrant->is_pending_payment()) { |
|
378 | - // its pending |
|
379 | - $this->_show_try_pay_again_link = isset( |
|
380 | - EE_Registry::instance()->CFG->registration->show_pending_payment_options |
|
381 | - ) |
|
382 | - && EE_Registry::instance()->CFG |
|
383 | - ->registration->show_pending_payment_options |
|
384 | - ? true |
|
385 | - : $show_try_pay_again_link_default; |
|
386 | - } |
|
387 | - $this->_payments_closed = ! $this->_current_txn->payment_method() instanceof EE_Payment_Method |
|
388 | - ? true |
|
389 | - : false; |
|
390 | - $this->_is_offline_payment_method = false; |
|
391 | - if (// if payment method is unknown |
|
392 | - ! $this->_current_txn->payment_method() instanceof EE_Payment_Method |
|
393 | - || ( |
|
394 | - // or is an offline payment method |
|
395 | - $this->_current_txn->payment_method() instanceof EE_Payment_Method |
|
396 | - && $this->_current_txn->payment_method()->is_off_line() |
|
397 | - ) |
|
398 | - ) { |
|
399 | - $this->_is_offline_payment_method = true; |
|
400 | - } |
|
401 | - // link to SPCO |
|
402 | - $revisit_spco_url = add_query_arg( |
|
403 | - array('ee' => '_register', 'revisit' => true, 'e_reg_url_link' => $this->_reg_url_link), |
|
404 | - EE_Registry::instance()->CFG->core->reg_page_url() |
|
405 | - ); |
|
406 | - // link to SPCO payment_options |
|
407 | - $this->_SPCO_payment_options_url = $this->_primary_registrant instanceof EE_Registration |
|
408 | - ? $this->_primary_registrant->payment_overview_url() |
|
409 | - : add_query_arg( |
|
410 | - array('step' => 'payment_options'), |
|
411 | - $revisit_spco_url |
|
412 | - ); |
|
413 | - // link to SPCO attendee_information |
|
414 | - $this->_SPCO_attendee_information_url = $this->_primary_registrant instanceof EE_Registration |
|
415 | - ? $this->_primary_registrant->edit_attendee_information_url() |
|
416 | - : false; |
|
417 | - do_action('AHEE__EED_Thank_You_Page__init_end', $this->_current_txn); |
|
418 | - // set no cache headers and constants |
|
419 | - EE_System::do_not_cache(); |
|
420 | - } |
|
421 | - |
|
422 | - |
|
423 | - /** |
|
424 | - * display_thank_you_page_results |
|
425 | - * |
|
426 | - * @return string |
|
427 | - * @throws \EE_Error |
|
428 | - */ |
|
429 | - public function thank_you_page_results() |
|
430 | - { |
|
431 | - $this->init(); |
|
432 | - if (! $this->_current_txn instanceof EE_Transaction) { |
|
433 | - return EE_Error::get_notices(); |
|
434 | - } |
|
435 | - // link to receipt |
|
436 | - $template_args['TXN_receipt_url'] = $this->_current_txn->receipt_url('html'); |
|
437 | - if (! empty($template_args['TXN_receipt_url'])) { |
|
438 | - $template_args['order_conf_desc'] = __( |
|
439 | - '%1$sCongratulations%2$sYour registration has been successfully processed.%3$sCheck your email for your registration confirmation or click the button below to view / download / print a full description of your purchases and registration information.', |
|
440 | - 'event_espresso' |
|
441 | - ); |
|
442 | - } else { |
|
443 | - $template_args['order_conf_desc'] = __( |
|
444 | - '%1$sCongratulations%2$sYour registration has been successfully processed.%3$sCheck your email for your registration confirmation.', |
|
445 | - 'event_espresso' |
|
446 | - ); |
|
447 | - } |
|
448 | - $template_args['transaction'] = $this->_current_txn; |
|
449 | - $template_args['revisit'] = EE_Registry::instance()->REQ->get('revisit', false); |
|
450 | - add_action('AHEE__thank_you_page_overview_template__content', array($this, 'get_registration_details')); |
|
451 | - if ($this->_is_primary && ! $this->_current_txn->is_free()) { |
|
452 | - add_action('AHEE__thank_you_page_overview_template__content', array($this, 'get_ajax_content')); |
|
453 | - } |
|
454 | - return EEH_Template::locate_template( |
|
455 | - THANK_YOU_TEMPLATES_PATH . 'thank-you-page-overview.template.php', |
|
456 | - $template_args, |
|
457 | - true, |
|
458 | - true |
|
459 | - ); |
|
460 | - } |
|
461 | - |
|
462 | - |
|
463 | - /** |
|
464 | - * thank_you_page_IPN_monitor |
|
465 | - * this basically just pulls the TXN based on the reg_url_link sent from the server, |
|
466 | - * then checks that the TXN status is not failed, and that no other errors have been generated. |
|
467 | - * it also calculates the IPN wait time since the Thank You page was first loaded |
|
468 | - * |
|
469 | - * @param array $response |
|
470 | - * @param array $data |
|
471 | - * @return array |
|
472 | - * @throws \EE_Error |
|
473 | - */ |
|
474 | - public static function thank_you_page_IPN_monitor($response = array(), $data = array()) |
|
475 | - { |
|
476 | - // does this heartbeat contain our data ? |
|
477 | - if (! isset($data['espresso_thank_you_page'])) { |
|
478 | - return $response; |
|
479 | - } |
|
480 | - // check for reg_url_link in the incoming heartbeat data |
|
481 | - if (! isset($data['espresso_thank_you_page']['e_reg_url_link'])) { |
|
482 | - $response['espresso_thank_you_page'] = array( |
|
483 | - 'errors' => ! empty($notices['errors']) |
|
484 | - ? $notices['errors'] |
|
485 | - : __( |
|
486 | - 'No transaction information could be retrieved because the registration URL link is missing or invalid.', |
|
487 | - 'event_espresso' |
|
488 | - ), |
|
489 | - ); |
|
490 | - return $response; |
|
491 | - } |
|
492 | - // kk heartbeat has our data |
|
493 | - $response['espresso_thank_you_page'] = array(); |
|
494 | - // set_definitions, instantiate the thank you page class, and get the ball rolling |
|
495 | - EED_Thank_You_Page::set_definitions(); |
|
496 | - /** @var $espresso_thank_you_page EED_Thank_You_Page */ |
|
497 | - $espresso_thank_you_page = EED_Thank_You_Page::instance(); |
|
498 | - $espresso_thank_you_page->set_reg_url_link($data['espresso_thank_you_page']['e_reg_url_link']); |
|
499 | - $espresso_thank_you_page->init(); |
|
500 | - // get TXN |
|
501 | - $TXN = $espresso_thank_you_page->get_txn(); |
|
502 | - // no TXN? then get out |
|
503 | - if (! $TXN instanceof EE_Transaction) { |
|
504 | - $notices = EE_Error::get_notices(); |
|
505 | - $response['espresso_thank_you_page'] = array( |
|
506 | - 'errors' => ! empty($notices['errors']) |
|
507 | - ? $notices['errors'] |
|
508 | - : sprintf( |
|
509 | - __( |
|
510 | - 'The information for your transaction could not be retrieved from the server or the transaction data received was invalid because of a technical reason. (%s)', |
|
511 | - 'event_espresso' |
|
512 | - ), |
|
513 | - __LINE__ |
|
514 | - ), |
|
515 | - ); |
|
516 | - return $response; |
|
517 | - } |
|
518 | - // grab transient of TXN's status |
|
519 | - $txn_status = isset($data['espresso_thank_you_page']['txn_status']) |
|
520 | - ? $data['espresso_thank_you_page']['txn_status'] |
|
521 | - : null; |
|
522 | - // has the TXN status changed since we last checked (or empty because this is the first time running through this code)? |
|
523 | - if ($txn_status !== $TXN->status_ID()) { |
|
524 | - // switch between two possible basic outcomes |
|
525 | - switch ($TXN->status_ID()) { |
|
526 | - // TXN has been updated in some way |
|
527 | - case EEM_Transaction::overpaid_status_code: |
|
528 | - case EEM_Transaction::complete_status_code: |
|
529 | - case EEM_Transaction::incomplete_status_code: |
|
530 | - // send updated TXN results back to client, |
|
531 | - $response['espresso_thank_you_page'] = array( |
|
532 | - 'transaction_details' => $espresso_thank_you_page->get_transaction_details(), |
|
533 | - 'txn_status' => $TXN->status_ID(), |
|
534 | - ); |
|
535 | - break; |
|
536 | - // or we have a bad TXN, or really slow IPN, so calculate the wait time and send that back... |
|
537 | - case EEM_Transaction::failed_status_code: |
|
538 | - default: |
|
539 | - // keep on waiting... |
|
540 | - return $espresso_thank_you_page->_update_server_wait_time($data['espresso_thank_you_page']); |
|
541 | - } |
|
542 | - // or is the TXN still failed (never been updated) ??? |
|
543 | - } elseif ($TXN->failed()) { |
|
544 | - // keep on waiting... |
|
545 | - return $espresso_thank_you_page->_update_server_wait_time($data['espresso_thank_you_page']); |
|
546 | - } |
|
547 | - // TXN is happening so let's get the payments now |
|
548 | - // if we've already gotten payments then the heartbeat data will contain the timestamp of the last time we checked |
|
549 | - $since = isset($data['espresso_thank_you_page']['get_payments_since']) |
|
550 | - ? $data['espresso_thank_you_page']['get_payments_since'] |
|
551 | - : 0; |
|
552 | - // then check for payments |
|
553 | - $payments = $espresso_thank_you_page->get_txn_payments($since); |
|
554 | - // has a payment been processed ? |
|
555 | - if (! empty($payments) || $espresso_thank_you_page->_is_offline_payment_method) { |
|
556 | - if ($since) { |
|
557 | - $response['espresso_thank_you_page'] = array( |
|
558 | - 'new_payments' => $espresso_thank_you_page->get_new_payments($payments), |
|
559 | - 'transaction_details' => $espresso_thank_you_page->get_transaction_details(), |
|
560 | - 'txn_status' => $TXN->status_ID(), |
|
561 | - ); |
|
562 | - } else { |
|
563 | - $response['espresso_thank_you_page']['payment_details'] = $espresso_thank_you_page->get_payment_details( |
|
564 | - $payments |
|
565 | - ); |
|
566 | - } |
|
567 | - // reset time to check for payments |
|
568 | - $response['espresso_thank_you_page']['get_payments_since'] = time(); |
|
569 | - } else { |
|
570 | - $response['espresso_thank_you_page']['get_payments_since'] = $since; |
|
571 | - } |
|
572 | - return $response; |
|
573 | - } |
|
574 | - |
|
575 | - |
|
576 | - /** |
|
577 | - * _update_server_wait_time |
|
578 | - * |
|
579 | - * @param array $thank_you_page_data thank you page portion of the incoming JSON array from the WP heartbeat data |
|
580 | - * @return array |
|
581 | - * @throws \EE_Error |
|
582 | - */ |
|
583 | - private function _update_server_wait_time($thank_you_page_data = array()) |
|
584 | - { |
|
585 | - $response['espresso_thank_you_page'] = array( |
|
586 | - 'still_waiting' => isset($thank_you_page_data['initial_access']) |
|
587 | - ? time() - $thank_you_page_data['initial_access'] |
|
588 | - : 0, |
|
589 | - 'txn_status' => $this->_current_txn->status_ID(), |
|
590 | - ); |
|
591 | - return $response; |
|
592 | - } |
|
593 | - |
|
594 | - |
|
595 | - /** |
|
596 | - * get_registration_details |
|
597 | - * |
|
598 | - * @throws \EE_Error |
|
599 | - */ |
|
600 | - public function get_registration_details() |
|
601 | - { |
|
602 | - // prepare variables for displaying |
|
603 | - $template_args = array(); |
|
604 | - $template_args['transaction'] = $this->_current_txn; |
|
605 | - $template_args['reg_url_link'] = $this->_reg_url_link; |
|
606 | - $template_args['is_primary'] = $this->_is_primary; |
|
607 | - $template_args['SPCO_attendee_information_url'] = $this->_SPCO_attendee_information_url; |
|
608 | - $template_args['resend_reg_confirmation_url'] = add_query_arg( |
|
609 | - array('token' => $this->_reg_url_link, 'resend_reg_confirmation' => 'true'), |
|
610 | - EE_Registry::instance()->CFG->core->thank_you_page_url() |
|
611 | - ); |
|
612 | - // verify template arguments |
|
613 | - EEH_Template_Validator::verify_instanceof($template_args['transaction'], '$transaction', 'EE_Transaction'); |
|
614 | - EEH_Template_Validator::verify_isnt_null( |
|
615 | - $template_args['SPCO_attendee_information_url'], |
|
616 | - '$SPCO_attendee_information_url' |
|
617 | - ); |
|
618 | - echo EEH_Template::locate_template( |
|
619 | - THANK_YOU_TEMPLATES_PATH . 'thank-you-page-registration-details.template.php', |
|
620 | - $template_args, |
|
621 | - true, |
|
622 | - true |
|
623 | - ); |
|
624 | - } |
|
625 | - |
|
626 | - |
|
627 | - /** |
|
628 | - * resend_reg_confirmation_email |
|
629 | - * |
|
630 | - * @throws \EE_Error |
|
631 | - */ |
|
632 | - public static function resend_reg_confirmation_email() |
|
633 | - { |
|
634 | - EE_Registry::instance()->load_core('Request_Handler'); |
|
635 | - $reg_url_link = EE_Registry::instance()->REQ->get('token'); |
|
636 | - // was a REG_ID passed ? |
|
637 | - if ($reg_url_link) { |
|
638 | - $registration = EE_Registry::instance()->load_model('Registration')->get_one( |
|
639 | - array(array('REG_url_link' => $reg_url_link)) |
|
640 | - ); |
|
641 | - if ($registration instanceof EE_Registration) { |
|
642 | - // resend email |
|
643 | - EED_Messages::process_resend(array('_REG_ID' => $registration->ID())); |
|
644 | - } else { |
|
645 | - EE_Error::add_error( |
|
646 | - __( |
|
647 | - 'The Registration Confirmation email could not be sent because a valid Registration could not be retrieved from the database.', |
|
648 | - 'event_espresso' |
|
649 | - ), |
|
650 | - __FILE__, |
|
651 | - __FUNCTION__, |
|
652 | - __LINE__ |
|
653 | - ); |
|
654 | - } |
|
655 | - } else { |
|
656 | - EE_Error::add_error( |
|
657 | - __( |
|
658 | - 'The Registration Confirmation email could not be sent because a registration token is missing or invalid.', |
|
659 | - 'event_espresso' |
|
660 | - ), |
|
661 | - __FILE__, |
|
662 | - __FUNCTION__, |
|
663 | - __LINE__ |
|
664 | - ); |
|
665 | - } |
|
666 | - // request sent via AJAX ? |
|
667 | - if (EE_FRONT_AJAX) { |
|
668 | - echo wp_json_encode(EE_Error::get_notices(false)); |
|
669 | - die(); |
|
670 | - // or was JS disabled ? |
|
671 | - } else { |
|
672 | - // save errors so that they get picked up on the next request |
|
673 | - EE_Error::get_notices(true, true); |
|
674 | - wp_safe_redirect( |
|
675 | - add_query_arg( |
|
676 | - array('e_reg_url_link' => $reg_url_link), |
|
677 | - EE_Registry::instance()->CFG->core->thank_you_page_url() |
|
678 | - ) |
|
679 | - ); |
|
680 | - } |
|
681 | - } |
|
682 | - |
|
683 | - |
|
684 | - /** |
|
685 | - * get_ajax_content |
|
686 | - * |
|
687 | - * @return void |
|
688 | - * @throws \EE_Error |
|
689 | - */ |
|
690 | - public function get_ajax_content() |
|
691 | - { |
|
692 | - if (! $this->get_txn()) { |
|
693 | - return; |
|
694 | - } |
|
695 | - // first determine which event(s) require pre-approval or not |
|
696 | - $events = array(); |
|
697 | - $events_requiring_pre_approval = array(); |
|
698 | - foreach ($this->_current_txn->registrations() as $registration) { |
|
699 | - if ($registration instanceof EE_Registration) { |
|
700 | - $event = $registration->event(); |
|
701 | - if ($event instanceof EE_Event) { |
|
702 | - if ($registration->is_not_approved() && $registration->event() instanceof EE_Event) { |
|
703 | - $events_requiring_pre_approval[ $event->ID() ] = $event; |
|
704 | - } else { |
|
705 | - $events[ $event->ID() ] = $event; |
|
706 | - } |
|
707 | - } |
|
708 | - } |
|
709 | - } |
|
710 | - $this->display_details_for_events_requiring_pre_approval($events_requiring_pre_approval); |
|
711 | - $this->display_details_for_events($events); |
|
712 | - } |
|
713 | - |
|
714 | - |
|
715 | - /** |
|
716 | - * display_details_for_events |
|
717 | - * |
|
718 | - * @param EE_Event[] $events |
|
719 | - * @return void |
|
720 | - */ |
|
721 | - public function display_details_for_events($events = array()) |
|
722 | - { |
|
723 | - if (! empty($events)) { |
|
724 | - ?> |
|
13 | + /** |
|
14 | + * time in seconds to wait for the IPN to arrive before telling the registrant to bugger off ( 1200s = 20 minutes ) |
|
15 | + */ |
|
16 | + const IPN_wait_time = 1200; |
|
17 | + |
|
18 | + /** |
|
19 | + * The transaction specified by the reg_url_link passed from the Request, or from the Session |
|
20 | + * |
|
21 | + * @var EE_Transaction $_current_txn |
|
22 | + */ |
|
23 | + private $_current_txn; |
|
24 | + |
|
25 | + /** |
|
26 | + * @var EE_Registration $_primary_registrant |
|
27 | + */ |
|
28 | + private $_primary_registrant; |
|
29 | + |
|
30 | + /** |
|
31 | + * The reg_url_link passed from the Request, or from the Session |
|
32 | + * |
|
33 | + * @var string $_reg_url_link |
|
34 | + */ |
|
35 | + private $_reg_url_link; |
|
36 | + |
|
37 | + /** |
|
38 | + * whether the incoming reg_url_link is for the primary registrant or not |
|
39 | + * |
|
40 | + * @var boolean $_is_primary |
|
41 | + */ |
|
42 | + private $_is_primary; |
|
43 | + |
|
44 | + /** |
|
45 | + * The URL for revisiting the SPCO attendee information step |
|
46 | + * |
|
47 | + * @var string $_SPCO_attendee_information_url |
|
48 | + */ |
|
49 | + private $_SPCO_attendee_information_url; |
|
50 | + |
|
51 | + /** |
|
52 | + * The URL for revisiting the SPCO payment options step |
|
53 | + * |
|
54 | + * @var string $_SPCO_payment_options_url |
|
55 | + */ |
|
56 | + private $_SPCO_payment_options_url; |
|
57 | + |
|
58 | + /** |
|
59 | + * whether to display the Payment Options link |
|
60 | + * |
|
61 | + * @var boolean $_show_try_pay_again_link |
|
62 | + */ |
|
63 | + private $_show_try_pay_again_link = false; |
|
64 | + |
|
65 | + /** |
|
66 | + * whether payments are allowed at this time |
|
67 | + * |
|
68 | + * @var boolean $_payments_closed |
|
69 | + */ |
|
70 | + private $_payments_closed = false; |
|
71 | + |
|
72 | + /** |
|
73 | + * whether the selected payment method is Bank, Check , Invoice, etc |
|
74 | + * |
|
75 | + * @var boolean $_is_offline_payment_method |
|
76 | + */ |
|
77 | + private $_is_offline_payment_method = true; |
|
78 | + |
|
79 | + |
|
80 | + /** |
|
81 | + * @return EED_Module|EED_Thank_You_Page |
|
82 | + */ |
|
83 | + public static function instance() |
|
84 | + { |
|
85 | + return parent::get_instance(__CLASS__); |
|
86 | + } |
|
87 | + |
|
88 | + |
|
89 | + /** |
|
90 | + * set_hooks - for hooking into EE Core, modules, etc |
|
91 | + * |
|
92 | + * @return void |
|
93 | + */ |
|
94 | + public static function set_hooks() |
|
95 | + { |
|
96 | + add_action('wp_loaded', array('EED_Thank_You_Page', 'set_definitions'), 2); |
|
97 | + } |
|
98 | + |
|
99 | + |
|
100 | + /** |
|
101 | + * set_hooks_admin - for hooking into EE Admin Core, modules, etc |
|
102 | + * |
|
103 | + * @return void |
|
104 | + */ |
|
105 | + public static function set_hooks_admin() |
|
106 | + { |
|
107 | + // AJAX for IPN monitoring |
|
108 | + add_filter('heartbeat_received', array('EED_Thank_You_Page', 'thank_you_page_IPN_monitor'), 10, 3); |
|
109 | + add_filter( |
|
110 | + 'heartbeat_nopriv_received', |
|
111 | + array('EED_Thank_You_Page', 'thank_you_page_IPN_monitor'), |
|
112 | + 10, |
|
113 | + 3 |
|
114 | + ); |
|
115 | + add_action( |
|
116 | + 'wp_ajax_espresso_resend_reg_confirmation_email', |
|
117 | + array('EED_Thank_You_Page', 'resend_reg_confirmation_email'), |
|
118 | + 10, |
|
119 | + 2 |
|
120 | + ); |
|
121 | + add_action( |
|
122 | + 'wp_ajax_nopriv_espresso_resend_reg_confirmation_email', |
|
123 | + array('EED_Thank_You_Page', 'resend_reg_confirmation_email'), |
|
124 | + 10, |
|
125 | + 2 |
|
126 | + ); |
|
127 | + } |
|
128 | + |
|
129 | + |
|
130 | + /** |
|
131 | + * set_definitions |
|
132 | + * |
|
133 | + * @return void |
|
134 | + */ |
|
135 | + public static function set_definitions() |
|
136 | + { |
|
137 | + define('THANK_YOU_ASSETS_URL', plugin_dir_url(__FILE__) . 'assets' . DS); |
|
138 | + define('THANK_YOU_TEMPLATES_PATH', str_replace('\\', DS, plugin_dir_path(__FILE__)) . 'templates' . DS); |
|
139 | + } |
|
140 | + |
|
141 | + |
|
142 | + /** |
|
143 | + * get_txn |
|
144 | + * |
|
145 | + * @return EE_Transaction |
|
146 | + */ |
|
147 | + public function get_txn() |
|
148 | + { |
|
149 | + if ($this->_current_txn instanceof EE_Transaction) { |
|
150 | + return $this->_current_txn; |
|
151 | + } |
|
152 | + $TXN_model = EE_Registry::instance()->load_model('Transaction'); |
|
153 | + if (! $TXN_model instanceof EEM_Transaction) { |
|
154 | + EE_Error::add_error( |
|
155 | + __('The transaction model could not be established.', 'event_espresso'), |
|
156 | + __FILE__, |
|
157 | + __FUNCTION__, |
|
158 | + __LINE__ |
|
159 | + ); |
|
160 | + return null; |
|
161 | + } |
|
162 | + // get the transaction. yes, we may have just loaded it, but it may have been updated, or this may be via an ajax request |
|
163 | + $this->_current_txn = $TXN_model->get_transaction_from_reg_url_link($this->_reg_url_link); |
|
164 | + // verify TXN |
|
165 | + if (WP_DEBUG && ! $this->_current_txn instanceof EE_Transaction) { |
|
166 | + EE_Error::add_error( |
|
167 | + __( |
|
168 | + 'No transaction information could be retrieved or the transaction data is not of the correct type.', |
|
169 | + 'event_espresso' |
|
170 | + ), |
|
171 | + __FILE__, |
|
172 | + __FUNCTION__, |
|
173 | + __LINE__ |
|
174 | + ); |
|
175 | + return null; |
|
176 | + } |
|
177 | + return $this->_current_txn; |
|
178 | + } |
|
179 | + |
|
180 | + |
|
181 | + /** |
|
182 | + * get_txn_payments |
|
183 | + * |
|
184 | + * @param int $since |
|
185 | + * @return mixed array of EE_Payment || FALSE |
|
186 | + * @throws \EE_Error |
|
187 | + */ |
|
188 | + public function get_txn_payments($since = 0) |
|
189 | + { |
|
190 | + if (! $this->get_txn()) { |
|
191 | + return false; |
|
192 | + } |
|
193 | + $args = array('order_by' => array('PAY_timestamp' => 'ASC')); |
|
194 | + if ($since > 0) { |
|
195 | + $args[0] = array('PAY_timestamp' => array('>', $since)); |
|
196 | + } |
|
197 | + // get array of payments with most recent first |
|
198 | + return $this->_current_txn->payments($args); |
|
199 | + } |
|
200 | + |
|
201 | + |
|
202 | + /** |
|
203 | + * get_reg_url_link |
|
204 | + * |
|
205 | + * @return void |
|
206 | + */ |
|
207 | + private function _get_reg_url_link() |
|
208 | + { |
|
209 | + if (! empty($this->_reg_url_link)) { |
|
210 | + return; |
|
211 | + } |
|
212 | + // only do thank you page stuff if we have a REG_url_link in the url |
|
213 | + if (WP_DEBUG && ! EE_Registry::instance()->REQ->is_set('e_reg_url_link')) { |
|
214 | + EE_Error::add_error( |
|
215 | + __( |
|
216 | + 'No transaction information could be retrieved because the registration URL link is missing or invalid.', |
|
217 | + 'event_espresso' |
|
218 | + ), |
|
219 | + __FILE__, |
|
220 | + __FUNCTION__, |
|
221 | + __LINE__ |
|
222 | + ); |
|
223 | + return; |
|
224 | + } |
|
225 | + // check for reg_url_link |
|
226 | + $this->_reg_url_link = EE_Registry::instance()->REQ->get('e_reg_url_link'); |
|
227 | + } |
|
228 | + |
|
229 | + |
|
230 | + /** |
|
231 | + * set_reg_url_link |
|
232 | + * |
|
233 | + * @param string $reg_url_link |
|
234 | + */ |
|
235 | + public function set_reg_url_link($reg_url_link = null) |
|
236 | + { |
|
237 | + $this->_reg_url_link = ! empty($reg_url_link) ? $reg_url_link : $this->_reg_url_link; |
|
238 | + } |
|
239 | + |
|
240 | + |
|
241 | + /** |
|
242 | + * run - initial module setup |
|
243 | + * this method is primarily used for activating resources in the EE_Front_Controller thru the use of filters |
|
244 | + * |
|
245 | + * @param WP $WP |
|
246 | + * @return void |
|
247 | + * @throws \EE_Error |
|
248 | + */ |
|
249 | + public function run($WP) |
|
250 | + { |
|
251 | + } |
|
252 | + |
|
253 | + |
|
254 | + /** |
|
255 | + * load_resources |
|
256 | + * |
|
257 | + * @return void |
|
258 | + * @throws \EE_Error |
|
259 | + */ |
|
260 | + public function load_resources() |
|
261 | + { |
|
262 | + $this->_get_reg_url_link(); |
|
263 | + // resend_reg_confirmation_email ? |
|
264 | + if (EE_Registry::instance()->REQ->is_set('resend')) { |
|
265 | + EED_Thank_You_Page::resend_reg_confirmation_email(); |
|
266 | + } |
|
267 | + EE_Registry::instance()->SSN->clear_session(__CLASS__, __FUNCTION__); |
|
268 | + $this->_translate_strings(); |
|
269 | + // load assets |
|
270 | + add_action('wp_enqueue_scripts', array($this, 'load_js'), 10); |
|
271 | + } |
|
272 | + |
|
273 | + |
|
274 | + /** |
|
275 | + * load_js |
|
276 | + * |
|
277 | + * @return void |
|
278 | + */ |
|
279 | + protected function _translate_strings() |
|
280 | + { |
|
281 | + EE_Registry::$i18n_js_strings['e_reg_url_link'] = $this->_reg_url_link; |
|
282 | + EE_Registry::$i18n_js_strings['initial_access'] = time(); |
|
283 | + EE_Registry::$i18n_js_strings['IPN_wait_time'] = EED_Thank_You_Page::IPN_wait_time; |
|
284 | + EE_Registry::$i18n_js_strings['TXN_complete'] = EEM_Transaction::complete_status_code; |
|
285 | + EE_Registry::$i18n_js_strings['TXN_incomplete'] = EEM_Transaction::incomplete_status_code; |
|
286 | + EE_Registry::$i18n_js_strings['checking_for_new_payments'] = __( |
|
287 | + 'checking for new payments...', |
|
288 | + 'event_espresso' |
|
289 | + ); |
|
290 | + EE_Registry::$i18n_js_strings['loading_payment_info'] = __( |
|
291 | + 'loading payment information...', |
|
292 | + 'event_espresso' |
|
293 | + ); |
|
294 | + EE_Registry::$i18n_js_strings['server_error'] = __( |
|
295 | + 'An unknown error occurred on the server while attempting to process your request. Please refresh the page and try again.', |
|
296 | + 'event_espresso' |
|
297 | + ); |
|
298 | + EE_Registry::$i18n_js_strings['slow_IPN'] = apply_filters( |
|
299 | + 'EED_Thank_You_Page__load_js__slow_IPN', |
|
300 | + sprintf( |
|
301 | + __( |
|
302 | + '%sThe Payment Notification appears to be taking longer than usual to arrive. Maybe check back later or just wait for your payment and registration confirmation results to be sent to you via email. We apologize for any inconvenience this may have caused.%s', |
|
303 | + 'event_espresso' |
|
304 | + ), |
|
305 | + '<div id="espresso-thank-you-page-slow-IPN-dv" class="ee-attention jst-left">', |
|
306 | + '</div>' |
|
307 | + ) |
|
308 | + ); |
|
309 | + } |
|
310 | + |
|
311 | + |
|
312 | + /** |
|
313 | + * load_js |
|
314 | + * |
|
315 | + * @return void |
|
316 | + */ |
|
317 | + public function load_js() |
|
318 | + { |
|
319 | + wp_register_script( |
|
320 | + 'thank_you_page', |
|
321 | + THANK_YOU_ASSETS_URL . 'thank_you_page.js', |
|
322 | + array('espresso_core', 'heartbeat'), |
|
323 | + EVENT_ESPRESSO_VERSION, |
|
324 | + true |
|
325 | + ); |
|
326 | + wp_enqueue_script('thank_you_page'); |
|
327 | + wp_enqueue_style('espresso_default'); |
|
328 | + } |
|
329 | + |
|
330 | + |
|
331 | + /** |
|
332 | + * init |
|
333 | + * |
|
334 | + * @return void |
|
335 | + * @throws \EE_Error |
|
336 | + */ |
|
337 | + public function init() |
|
338 | + { |
|
339 | + $this->_get_reg_url_link(); |
|
340 | + if (! $this->get_txn()) { |
|
341 | + echo EEH_HTML::div( |
|
342 | + EEH_HTML::h4(__('We\'re sorry...', 'event_espresso'), '', '') . |
|
343 | + sprintf( |
|
344 | + __( |
|
345 | + 'This is a system page for displaying transaction information after a purchase.%1$sYou are most likely seeing this notice because you have navigated to this page%1$sthrough some means other than completing a transaction.%1$sSorry for the disappointment, but you will most likely find nothing of interest here.%1$s%1$s', |
|
346 | + 'event_espresso' |
|
347 | + ), |
|
348 | + '<br/>' |
|
349 | + ), |
|
350 | + '', |
|
351 | + 'ee-attention' |
|
352 | + ); |
|
353 | + return null; |
|
354 | + } |
|
355 | + // if we've made it to the Thank You page, then let's toggle any "Failed" transactions to "Incomplete" |
|
356 | + if ($this->_current_txn->status_ID() === EEM_Transaction::failed_status_code) { |
|
357 | + $this->_current_txn->set_status(EEM_Transaction::incomplete_status_code); |
|
358 | + $this->_current_txn->save(); |
|
359 | + } |
|
360 | + $this->_primary_registrant = $this->_current_txn->primary_registration() instanceof EE_Registration |
|
361 | + ? $this->_current_txn->primary_registration() |
|
362 | + : null; |
|
363 | + $this->_is_primary = $this->_primary_registrant->reg_url_link() === $this->_reg_url_link ? true : false; |
|
364 | + $show_try_pay_again_link_default = apply_filters( |
|
365 | + 'AFEE__EED_Thank_You_Page__init__show_try_pay_again_link_default', |
|
366 | + true |
|
367 | + ); |
|
368 | + $this->_show_try_pay_again_link = $show_try_pay_again_link_default; |
|
369 | + // txn status ? |
|
370 | + if ($this->_current_txn->is_completed()) { |
|
371 | + $this->_show_try_pay_again_link = $show_try_pay_again_link_default; |
|
372 | + } elseif ($this->_current_txn->is_incomplete() |
|
373 | + && ($this->_primary_registrant->is_approved() |
|
374 | + || $this->_primary_registrant->is_pending_payment()) |
|
375 | + ) { |
|
376 | + $this->_show_try_pay_again_link = true; |
|
377 | + } elseif ($this->_primary_registrant->is_approved() || $this->_primary_registrant->is_pending_payment()) { |
|
378 | + // its pending |
|
379 | + $this->_show_try_pay_again_link = isset( |
|
380 | + EE_Registry::instance()->CFG->registration->show_pending_payment_options |
|
381 | + ) |
|
382 | + && EE_Registry::instance()->CFG |
|
383 | + ->registration->show_pending_payment_options |
|
384 | + ? true |
|
385 | + : $show_try_pay_again_link_default; |
|
386 | + } |
|
387 | + $this->_payments_closed = ! $this->_current_txn->payment_method() instanceof EE_Payment_Method |
|
388 | + ? true |
|
389 | + : false; |
|
390 | + $this->_is_offline_payment_method = false; |
|
391 | + if (// if payment method is unknown |
|
392 | + ! $this->_current_txn->payment_method() instanceof EE_Payment_Method |
|
393 | + || ( |
|
394 | + // or is an offline payment method |
|
395 | + $this->_current_txn->payment_method() instanceof EE_Payment_Method |
|
396 | + && $this->_current_txn->payment_method()->is_off_line() |
|
397 | + ) |
|
398 | + ) { |
|
399 | + $this->_is_offline_payment_method = true; |
|
400 | + } |
|
401 | + // link to SPCO |
|
402 | + $revisit_spco_url = add_query_arg( |
|
403 | + array('ee' => '_register', 'revisit' => true, 'e_reg_url_link' => $this->_reg_url_link), |
|
404 | + EE_Registry::instance()->CFG->core->reg_page_url() |
|
405 | + ); |
|
406 | + // link to SPCO payment_options |
|
407 | + $this->_SPCO_payment_options_url = $this->_primary_registrant instanceof EE_Registration |
|
408 | + ? $this->_primary_registrant->payment_overview_url() |
|
409 | + : add_query_arg( |
|
410 | + array('step' => 'payment_options'), |
|
411 | + $revisit_spco_url |
|
412 | + ); |
|
413 | + // link to SPCO attendee_information |
|
414 | + $this->_SPCO_attendee_information_url = $this->_primary_registrant instanceof EE_Registration |
|
415 | + ? $this->_primary_registrant->edit_attendee_information_url() |
|
416 | + : false; |
|
417 | + do_action('AHEE__EED_Thank_You_Page__init_end', $this->_current_txn); |
|
418 | + // set no cache headers and constants |
|
419 | + EE_System::do_not_cache(); |
|
420 | + } |
|
421 | + |
|
422 | + |
|
423 | + /** |
|
424 | + * display_thank_you_page_results |
|
425 | + * |
|
426 | + * @return string |
|
427 | + * @throws \EE_Error |
|
428 | + */ |
|
429 | + public function thank_you_page_results() |
|
430 | + { |
|
431 | + $this->init(); |
|
432 | + if (! $this->_current_txn instanceof EE_Transaction) { |
|
433 | + return EE_Error::get_notices(); |
|
434 | + } |
|
435 | + // link to receipt |
|
436 | + $template_args['TXN_receipt_url'] = $this->_current_txn->receipt_url('html'); |
|
437 | + if (! empty($template_args['TXN_receipt_url'])) { |
|
438 | + $template_args['order_conf_desc'] = __( |
|
439 | + '%1$sCongratulations%2$sYour registration has been successfully processed.%3$sCheck your email for your registration confirmation or click the button below to view / download / print a full description of your purchases and registration information.', |
|
440 | + 'event_espresso' |
|
441 | + ); |
|
442 | + } else { |
|
443 | + $template_args['order_conf_desc'] = __( |
|
444 | + '%1$sCongratulations%2$sYour registration has been successfully processed.%3$sCheck your email for your registration confirmation.', |
|
445 | + 'event_espresso' |
|
446 | + ); |
|
447 | + } |
|
448 | + $template_args['transaction'] = $this->_current_txn; |
|
449 | + $template_args['revisit'] = EE_Registry::instance()->REQ->get('revisit', false); |
|
450 | + add_action('AHEE__thank_you_page_overview_template__content', array($this, 'get_registration_details')); |
|
451 | + if ($this->_is_primary && ! $this->_current_txn->is_free()) { |
|
452 | + add_action('AHEE__thank_you_page_overview_template__content', array($this, 'get_ajax_content')); |
|
453 | + } |
|
454 | + return EEH_Template::locate_template( |
|
455 | + THANK_YOU_TEMPLATES_PATH . 'thank-you-page-overview.template.php', |
|
456 | + $template_args, |
|
457 | + true, |
|
458 | + true |
|
459 | + ); |
|
460 | + } |
|
461 | + |
|
462 | + |
|
463 | + /** |
|
464 | + * thank_you_page_IPN_monitor |
|
465 | + * this basically just pulls the TXN based on the reg_url_link sent from the server, |
|
466 | + * then checks that the TXN status is not failed, and that no other errors have been generated. |
|
467 | + * it also calculates the IPN wait time since the Thank You page was first loaded |
|
468 | + * |
|
469 | + * @param array $response |
|
470 | + * @param array $data |
|
471 | + * @return array |
|
472 | + * @throws \EE_Error |
|
473 | + */ |
|
474 | + public static function thank_you_page_IPN_monitor($response = array(), $data = array()) |
|
475 | + { |
|
476 | + // does this heartbeat contain our data ? |
|
477 | + if (! isset($data['espresso_thank_you_page'])) { |
|
478 | + return $response; |
|
479 | + } |
|
480 | + // check for reg_url_link in the incoming heartbeat data |
|
481 | + if (! isset($data['espresso_thank_you_page']['e_reg_url_link'])) { |
|
482 | + $response['espresso_thank_you_page'] = array( |
|
483 | + 'errors' => ! empty($notices['errors']) |
|
484 | + ? $notices['errors'] |
|
485 | + : __( |
|
486 | + 'No transaction information could be retrieved because the registration URL link is missing or invalid.', |
|
487 | + 'event_espresso' |
|
488 | + ), |
|
489 | + ); |
|
490 | + return $response; |
|
491 | + } |
|
492 | + // kk heartbeat has our data |
|
493 | + $response['espresso_thank_you_page'] = array(); |
|
494 | + // set_definitions, instantiate the thank you page class, and get the ball rolling |
|
495 | + EED_Thank_You_Page::set_definitions(); |
|
496 | + /** @var $espresso_thank_you_page EED_Thank_You_Page */ |
|
497 | + $espresso_thank_you_page = EED_Thank_You_Page::instance(); |
|
498 | + $espresso_thank_you_page->set_reg_url_link($data['espresso_thank_you_page']['e_reg_url_link']); |
|
499 | + $espresso_thank_you_page->init(); |
|
500 | + // get TXN |
|
501 | + $TXN = $espresso_thank_you_page->get_txn(); |
|
502 | + // no TXN? then get out |
|
503 | + if (! $TXN instanceof EE_Transaction) { |
|
504 | + $notices = EE_Error::get_notices(); |
|
505 | + $response['espresso_thank_you_page'] = array( |
|
506 | + 'errors' => ! empty($notices['errors']) |
|
507 | + ? $notices['errors'] |
|
508 | + : sprintf( |
|
509 | + __( |
|
510 | + 'The information for your transaction could not be retrieved from the server or the transaction data received was invalid because of a technical reason. (%s)', |
|
511 | + 'event_espresso' |
|
512 | + ), |
|
513 | + __LINE__ |
|
514 | + ), |
|
515 | + ); |
|
516 | + return $response; |
|
517 | + } |
|
518 | + // grab transient of TXN's status |
|
519 | + $txn_status = isset($data['espresso_thank_you_page']['txn_status']) |
|
520 | + ? $data['espresso_thank_you_page']['txn_status'] |
|
521 | + : null; |
|
522 | + // has the TXN status changed since we last checked (or empty because this is the first time running through this code)? |
|
523 | + if ($txn_status !== $TXN->status_ID()) { |
|
524 | + // switch between two possible basic outcomes |
|
525 | + switch ($TXN->status_ID()) { |
|
526 | + // TXN has been updated in some way |
|
527 | + case EEM_Transaction::overpaid_status_code: |
|
528 | + case EEM_Transaction::complete_status_code: |
|
529 | + case EEM_Transaction::incomplete_status_code: |
|
530 | + // send updated TXN results back to client, |
|
531 | + $response['espresso_thank_you_page'] = array( |
|
532 | + 'transaction_details' => $espresso_thank_you_page->get_transaction_details(), |
|
533 | + 'txn_status' => $TXN->status_ID(), |
|
534 | + ); |
|
535 | + break; |
|
536 | + // or we have a bad TXN, or really slow IPN, so calculate the wait time and send that back... |
|
537 | + case EEM_Transaction::failed_status_code: |
|
538 | + default: |
|
539 | + // keep on waiting... |
|
540 | + return $espresso_thank_you_page->_update_server_wait_time($data['espresso_thank_you_page']); |
|
541 | + } |
|
542 | + // or is the TXN still failed (never been updated) ??? |
|
543 | + } elseif ($TXN->failed()) { |
|
544 | + // keep on waiting... |
|
545 | + return $espresso_thank_you_page->_update_server_wait_time($data['espresso_thank_you_page']); |
|
546 | + } |
|
547 | + // TXN is happening so let's get the payments now |
|
548 | + // if we've already gotten payments then the heartbeat data will contain the timestamp of the last time we checked |
|
549 | + $since = isset($data['espresso_thank_you_page']['get_payments_since']) |
|
550 | + ? $data['espresso_thank_you_page']['get_payments_since'] |
|
551 | + : 0; |
|
552 | + // then check for payments |
|
553 | + $payments = $espresso_thank_you_page->get_txn_payments($since); |
|
554 | + // has a payment been processed ? |
|
555 | + if (! empty($payments) || $espresso_thank_you_page->_is_offline_payment_method) { |
|
556 | + if ($since) { |
|
557 | + $response['espresso_thank_you_page'] = array( |
|
558 | + 'new_payments' => $espresso_thank_you_page->get_new_payments($payments), |
|
559 | + 'transaction_details' => $espresso_thank_you_page->get_transaction_details(), |
|
560 | + 'txn_status' => $TXN->status_ID(), |
|
561 | + ); |
|
562 | + } else { |
|
563 | + $response['espresso_thank_you_page']['payment_details'] = $espresso_thank_you_page->get_payment_details( |
|
564 | + $payments |
|
565 | + ); |
|
566 | + } |
|
567 | + // reset time to check for payments |
|
568 | + $response['espresso_thank_you_page']['get_payments_since'] = time(); |
|
569 | + } else { |
|
570 | + $response['espresso_thank_you_page']['get_payments_since'] = $since; |
|
571 | + } |
|
572 | + return $response; |
|
573 | + } |
|
574 | + |
|
575 | + |
|
576 | + /** |
|
577 | + * _update_server_wait_time |
|
578 | + * |
|
579 | + * @param array $thank_you_page_data thank you page portion of the incoming JSON array from the WP heartbeat data |
|
580 | + * @return array |
|
581 | + * @throws \EE_Error |
|
582 | + */ |
|
583 | + private function _update_server_wait_time($thank_you_page_data = array()) |
|
584 | + { |
|
585 | + $response['espresso_thank_you_page'] = array( |
|
586 | + 'still_waiting' => isset($thank_you_page_data['initial_access']) |
|
587 | + ? time() - $thank_you_page_data['initial_access'] |
|
588 | + : 0, |
|
589 | + 'txn_status' => $this->_current_txn->status_ID(), |
|
590 | + ); |
|
591 | + return $response; |
|
592 | + } |
|
593 | + |
|
594 | + |
|
595 | + /** |
|
596 | + * get_registration_details |
|
597 | + * |
|
598 | + * @throws \EE_Error |
|
599 | + */ |
|
600 | + public function get_registration_details() |
|
601 | + { |
|
602 | + // prepare variables for displaying |
|
603 | + $template_args = array(); |
|
604 | + $template_args['transaction'] = $this->_current_txn; |
|
605 | + $template_args['reg_url_link'] = $this->_reg_url_link; |
|
606 | + $template_args['is_primary'] = $this->_is_primary; |
|
607 | + $template_args['SPCO_attendee_information_url'] = $this->_SPCO_attendee_information_url; |
|
608 | + $template_args['resend_reg_confirmation_url'] = add_query_arg( |
|
609 | + array('token' => $this->_reg_url_link, 'resend_reg_confirmation' => 'true'), |
|
610 | + EE_Registry::instance()->CFG->core->thank_you_page_url() |
|
611 | + ); |
|
612 | + // verify template arguments |
|
613 | + EEH_Template_Validator::verify_instanceof($template_args['transaction'], '$transaction', 'EE_Transaction'); |
|
614 | + EEH_Template_Validator::verify_isnt_null( |
|
615 | + $template_args['SPCO_attendee_information_url'], |
|
616 | + '$SPCO_attendee_information_url' |
|
617 | + ); |
|
618 | + echo EEH_Template::locate_template( |
|
619 | + THANK_YOU_TEMPLATES_PATH . 'thank-you-page-registration-details.template.php', |
|
620 | + $template_args, |
|
621 | + true, |
|
622 | + true |
|
623 | + ); |
|
624 | + } |
|
625 | + |
|
626 | + |
|
627 | + /** |
|
628 | + * resend_reg_confirmation_email |
|
629 | + * |
|
630 | + * @throws \EE_Error |
|
631 | + */ |
|
632 | + public static function resend_reg_confirmation_email() |
|
633 | + { |
|
634 | + EE_Registry::instance()->load_core('Request_Handler'); |
|
635 | + $reg_url_link = EE_Registry::instance()->REQ->get('token'); |
|
636 | + // was a REG_ID passed ? |
|
637 | + if ($reg_url_link) { |
|
638 | + $registration = EE_Registry::instance()->load_model('Registration')->get_one( |
|
639 | + array(array('REG_url_link' => $reg_url_link)) |
|
640 | + ); |
|
641 | + if ($registration instanceof EE_Registration) { |
|
642 | + // resend email |
|
643 | + EED_Messages::process_resend(array('_REG_ID' => $registration->ID())); |
|
644 | + } else { |
|
645 | + EE_Error::add_error( |
|
646 | + __( |
|
647 | + 'The Registration Confirmation email could not be sent because a valid Registration could not be retrieved from the database.', |
|
648 | + 'event_espresso' |
|
649 | + ), |
|
650 | + __FILE__, |
|
651 | + __FUNCTION__, |
|
652 | + __LINE__ |
|
653 | + ); |
|
654 | + } |
|
655 | + } else { |
|
656 | + EE_Error::add_error( |
|
657 | + __( |
|
658 | + 'The Registration Confirmation email could not be sent because a registration token is missing or invalid.', |
|
659 | + 'event_espresso' |
|
660 | + ), |
|
661 | + __FILE__, |
|
662 | + __FUNCTION__, |
|
663 | + __LINE__ |
|
664 | + ); |
|
665 | + } |
|
666 | + // request sent via AJAX ? |
|
667 | + if (EE_FRONT_AJAX) { |
|
668 | + echo wp_json_encode(EE_Error::get_notices(false)); |
|
669 | + die(); |
|
670 | + // or was JS disabled ? |
|
671 | + } else { |
|
672 | + // save errors so that they get picked up on the next request |
|
673 | + EE_Error::get_notices(true, true); |
|
674 | + wp_safe_redirect( |
|
675 | + add_query_arg( |
|
676 | + array('e_reg_url_link' => $reg_url_link), |
|
677 | + EE_Registry::instance()->CFG->core->thank_you_page_url() |
|
678 | + ) |
|
679 | + ); |
|
680 | + } |
|
681 | + } |
|
682 | + |
|
683 | + |
|
684 | + /** |
|
685 | + * get_ajax_content |
|
686 | + * |
|
687 | + * @return void |
|
688 | + * @throws \EE_Error |
|
689 | + */ |
|
690 | + public function get_ajax_content() |
|
691 | + { |
|
692 | + if (! $this->get_txn()) { |
|
693 | + return; |
|
694 | + } |
|
695 | + // first determine which event(s) require pre-approval or not |
|
696 | + $events = array(); |
|
697 | + $events_requiring_pre_approval = array(); |
|
698 | + foreach ($this->_current_txn->registrations() as $registration) { |
|
699 | + if ($registration instanceof EE_Registration) { |
|
700 | + $event = $registration->event(); |
|
701 | + if ($event instanceof EE_Event) { |
|
702 | + if ($registration->is_not_approved() && $registration->event() instanceof EE_Event) { |
|
703 | + $events_requiring_pre_approval[ $event->ID() ] = $event; |
|
704 | + } else { |
|
705 | + $events[ $event->ID() ] = $event; |
|
706 | + } |
|
707 | + } |
|
708 | + } |
|
709 | + } |
|
710 | + $this->display_details_for_events_requiring_pre_approval($events_requiring_pre_approval); |
|
711 | + $this->display_details_for_events($events); |
|
712 | + } |
|
713 | + |
|
714 | + |
|
715 | + /** |
|
716 | + * display_details_for_events |
|
717 | + * |
|
718 | + * @param EE_Event[] $events |
|
719 | + * @return void |
|
720 | + */ |
|
721 | + public function display_details_for_events($events = array()) |
|
722 | + { |
|
723 | + if (! empty($events)) { |
|
724 | + ?> |
|
725 | 725 | <div id="espresso-thank-you-page-ajax-content-dv"> |
726 | 726 | <div id="espresso-thank-you-page-ajax-transaction-dv"></div> |
727 | 727 | <div id="espresso-thank-you-page-ajax-payment-dv"></div> |
@@ -729,19 +729,19 @@ discard block |
||
729 | 729 | <div id="ee-ajax-loading-dv" class="float-left lt-blue-text"> |
730 | 730 | <span class="dashicons dashicons-upload"></span><span id="ee-ajax-loading-msg-spn"> |
731 | 731 | <?php _e( |
732 | - 'loading transaction and payment information...', |
|
733 | - 'event_espresso' |
|
734 | - ); ?></span> |
|
732 | + 'loading transaction and payment information...', |
|
733 | + 'event_espresso' |
|
734 | + ); ?></span> |
|
735 | 735 | </div> |
736 | 736 | <?php if (! $this->_is_offline_payment_method && ! $this->_payments_closed) : ?> |
737 | 737 | <p id="ee-ajax-loading-pg" class="highlight-bg small-text clear"> |
738 | 738 | <?php echo apply_filters( |
739 | - 'EED_Thank_You_Page__get_ajax_content__waiting_for_IPN_msg', |
|
740 | - __( |
|
741 | - 'Some payment gateways can take 15 minutes or more to return their payment notification, so please be patient if you require payment confirmation as soon as possible. Please note that as soon as everything is finalized, we will send your full payment and registration confirmation results to you via email.', |
|
742 | - 'event_espresso' |
|
743 | - ) |
|
744 | - ); ?> |
|
739 | + 'EED_Thank_You_Page__get_ajax_content__waiting_for_IPN_msg', |
|
740 | + __( |
|
741 | + 'Some payment gateways can take 15 minutes or more to return their payment notification, so please be patient if you require payment confirmation as soon as possible. Please note that as soon as everything is finalized, we will send your full payment and registration confirmation results to you via email.', |
|
742 | + 'event_espresso' |
|
743 | + ) |
|
744 | + ); ?> |
|
745 | 745 | <br/> |
746 | 746 | <span class="jst-rght ee-block small-text lt-grey-text"> |
747 | 747 | <?php _e('current wait time ', 'event_espresso'); ?> |
@@ -752,117 +752,117 @@ discard block |
||
752 | 752 | <div class="clear"></div> |
753 | 753 | </div> |
754 | 754 | <?php |
755 | - } |
|
756 | - } |
|
757 | - |
|
758 | - |
|
759 | - /** |
|
760 | - * display_details_for_events_requiring_pre_approval |
|
761 | - * |
|
762 | - * @param EE_Event[] $events |
|
763 | - * @return void |
|
764 | - */ |
|
765 | - public function display_details_for_events_requiring_pre_approval($events = array()) |
|
766 | - { |
|
767 | - if (! empty($events)) { |
|
768 | - ?> |
|
755 | + } |
|
756 | + } |
|
757 | + |
|
758 | + |
|
759 | + /** |
|
760 | + * display_details_for_events_requiring_pre_approval |
|
761 | + * |
|
762 | + * @param EE_Event[] $events |
|
763 | + * @return void |
|
764 | + */ |
|
765 | + public function display_details_for_events_requiring_pre_approval($events = array()) |
|
766 | + { |
|
767 | + if (! empty($events)) { |
|
768 | + ?> |
|
769 | 769 | <div id="espresso-thank-you-page-not-approved-message-dv"> |
770 | 770 | <h4 class="orange-text"><?php _e('Important Notice:', 'event_espresso'); ?></h4> |
771 | 771 | <p id="events-requiring-pre-approval-pg" class="small-text"> |
772 | 772 | <?php echo apply_filters( |
773 | - 'AHEE__EED_Thank_You_Page__get_ajax_content__not_approved_message', |
|
774 | - __( |
|
775 | - 'The following Event(s) you have registered for do not require payment at this time and will not be billed for during this transaction. Billing will only occur after all attendees have been approved by the event organizer. You will be notified when your registration has been processed. If this is a free event, then no billing will occur.', |
|
776 | - 'event_espresso' |
|
777 | - ) |
|
778 | - ); ?> |
|
773 | + 'AHEE__EED_Thank_You_Page__get_ajax_content__not_approved_message', |
|
774 | + __( |
|
775 | + 'The following Event(s) you have registered for do not require payment at this time and will not be billed for during this transaction. Billing will only occur after all attendees have been approved by the event organizer. You will be notified when your registration has been processed. If this is a free event, then no billing will occur.', |
|
776 | + 'event_espresso' |
|
777 | + ) |
|
778 | + ); ?> |
|
779 | 779 | </p> |
780 | 780 | <ul class="events-requiring-pre-approval-ul"> |
781 | 781 | <?php |
782 | - foreach ($events as $event) { |
|
783 | - if ($event instanceof EE_Event) { |
|
784 | - echo '<li><span class="dashicons dashicons-marker ee-icon-size-16 orange-text"></span>', |
|
785 | - $event->name(), |
|
786 | - '</li>'; |
|
787 | - } |
|
788 | - } ?> |
|
782 | + foreach ($events as $event) { |
|
783 | + if ($event instanceof EE_Event) { |
|
784 | + echo '<li><span class="dashicons dashicons-marker ee-icon-size-16 orange-text"></span>', |
|
785 | + $event->name(), |
|
786 | + '</li>'; |
|
787 | + } |
|
788 | + } ?> |
|
789 | 789 | </ul> |
790 | 790 | <div class="clear"></div> |
791 | 791 | </div> |
792 | 792 | <?php |
793 | - } |
|
794 | - } |
|
795 | - |
|
796 | - |
|
797 | - /** |
|
798 | - * get_transaction_details |
|
799 | - * |
|
800 | - * @return string |
|
801 | - * @throws \EE_Error |
|
802 | - */ |
|
803 | - public function get_transaction_details() |
|
804 | - { |
|
805 | - // prepare variables for displaying |
|
806 | - $template_args = array(); |
|
807 | - $template_args['transaction'] = $this->_current_txn; |
|
808 | - $template_args['reg_url_link'] = $this->_reg_url_link; |
|
809 | - $template_args['primary_registrant_name'] = $this->_primary_registrant->attendee()->full_name(true); |
|
810 | - // link to SPCO payment_options |
|
811 | - $template_args['show_try_pay_again_link'] = $this->_show_try_pay_again_link; |
|
812 | - $template_args['SPCO_payment_options_url'] = $this->_SPCO_payment_options_url; |
|
813 | - // verify template arguments |
|
814 | - EEH_Template_Validator::verify_instanceof($template_args['transaction'], '$transaction', 'EE_Transaction'); |
|
815 | - EEH_Template_Validator::verify_isnt_null( |
|
816 | - $template_args['show_try_pay_again_link'], |
|
817 | - '$show_try_pay_again_link' |
|
818 | - ); |
|
819 | - EEH_Template_Validator::verify_isnt_null( |
|
820 | - $template_args['SPCO_payment_options_url'], |
|
821 | - '$SPCO_payment_options_url' |
|
822 | - ); |
|
823 | - return EEH_Template::locate_template( |
|
824 | - THANK_YOU_TEMPLATES_PATH . 'thank-you-page-transaction-details.template.php', |
|
825 | - $template_args, |
|
826 | - true, |
|
827 | - true |
|
828 | - ); |
|
829 | - } |
|
830 | - |
|
831 | - |
|
832 | - /** |
|
833 | - * get_payment_row_html |
|
834 | - * |
|
835 | - * @param EE_Payment $payment |
|
836 | - * @return string |
|
837 | - * @throws \EE_Error |
|
838 | - */ |
|
839 | - public function get_payment_row_html($payment = null) |
|
840 | - { |
|
841 | - $html = ''; |
|
842 | - if ($payment instanceof EE_Payment) { |
|
843 | - if ($payment->payment_method() instanceof EE_Payment_Method |
|
844 | - && $payment->status() === EEM_Payment::status_id_failed |
|
845 | - && $payment->payment_method()->is_off_site() |
|
846 | - ) { |
|
847 | - // considering the registrant has made it to the Thank You page, |
|
848 | - // any failed payments may actually be pending and the IPN is just slow |
|
849 | - // so let's |
|
850 | - $payment->set_status(EEM_Payment::status_id_pending); |
|
851 | - } |
|
852 | - $payment_declined_msg = $payment->STS_ID() === EEM_Payment::status_id_declined |
|
853 | - ? '<br /><span class="small-text">' . $payment->gateway_response() . '</span>' |
|
854 | - : ''; |
|
855 | - $html .= ' |
|
793 | + } |
|
794 | + } |
|
795 | + |
|
796 | + |
|
797 | + /** |
|
798 | + * get_transaction_details |
|
799 | + * |
|
800 | + * @return string |
|
801 | + * @throws \EE_Error |
|
802 | + */ |
|
803 | + public function get_transaction_details() |
|
804 | + { |
|
805 | + // prepare variables for displaying |
|
806 | + $template_args = array(); |
|
807 | + $template_args['transaction'] = $this->_current_txn; |
|
808 | + $template_args['reg_url_link'] = $this->_reg_url_link; |
|
809 | + $template_args['primary_registrant_name'] = $this->_primary_registrant->attendee()->full_name(true); |
|
810 | + // link to SPCO payment_options |
|
811 | + $template_args['show_try_pay_again_link'] = $this->_show_try_pay_again_link; |
|
812 | + $template_args['SPCO_payment_options_url'] = $this->_SPCO_payment_options_url; |
|
813 | + // verify template arguments |
|
814 | + EEH_Template_Validator::verify_instanceof($template_args['transaction'], '$transaction', 'EE_Transaction'); |
|
815 | + EEH_Template_Validator::verify_isnt_null( |
|
816 | + $template_args['show_try_pay_again_link'], |
|
817 | + '$show_try_pay_again_link' |
|
818 | + ); |
|
819 | + EEH_Template_Validator::verify_isnt_null( |
|
820 | + $template_args['SPCO_payment_options_url'], |
|
821 | + '$SPCO_payment_options_url' |
|
822 | + ); |
|
823 | + return EEH_Template::locate_template( |
|
824 | + THANK_YOU_TEMPLATES_PATH . 'thank-you-page-transaction-details.template.php', |
|
825 | + $template_args, |
|
826 | + true, |
|
827 | + true |
|
828 | + ); |
|
829 | + } |
|
830 | + |
|
831 | + |
|
832 | + /** |
|
833 | + * get_payment_row_html |
|
834 | + * |
|
835 | + * @param EE_Payment $payment |
|
836 | + * @return string |
|
837 | + * @throws \EE_Error |
|
838 | + */ |
|
839 | + public function get_payment_row_html($payment = null) |
|
840 | + { |
|
841 | + $html = ''; |
|
842 | + if ($payment instanceof EE_Payment) { |
|
843 | + if ($payment->payment_method() instanceof EE_Payment_Method |
|
844 | + && $payment->status() === EEM_Payment::status_id_failed |
|
845 | + && $payment->payment_method()->is_off_site() |
|
846 | + ) { |
|
847 | + // considering the registrant has made it to the Thank You page, |
|
848 | + // any failed payments may actually be pending and the IPN is just slow |
|
849 | + // so let's |
|
850 | + $payment->set_status(EEM_Payment::status_id_pending); |
|
851 | + } |
|
852 | + $payment_declined_msg = $payment->STS_ID() === EEM_Payment::status_id_declined |
|
853 | + ? '<br /><span class="small-text">' . $payment->gateway_response() . '</span>' |
|
854 | + : ''; |
|
855 | + $html .= ' |
|
856 | 856 | <tr> |
857 | 857 | <td> |
858 | 858 | ' . $payment->timestamp() . ' |
859 | 859 | </td> |
860 | 860 | <td> |
861 | 861 | ' . ( |
862 | - $payment->payment_method() instanceof EE_Payment_Method |
|
863 | - ? $payment->payment_method()->name() |
|
864 | - : __('Unknown', 'event_espresso') |
|
865 | - ) . ' |
|
862 | + $payment->payment_method() instanceof EE_Payment_Method |
|
863 | + ? $payment->payment_method()->name() |
|
864 | + : __('Unknown', 'event_espresso') |
|
865 | + ) . ' |
|
866 | 866 | </td> |
867 | 867 | <td class="jst-rght"> |
868 | 868 | ' . EEH_Template::format_currency($payment->amount()) . ' |
@@ -871,83 +871,83 @@ discard block |
||
871 | 871 | ' . $payment->pretty_status(true) . $payment_declined_msg . ' |
872 | 872 | </td> |
873 | 873 | </tr>'; |
874 | - do_action('AHEE__thank_you_page_payment_details_template__after_each_payment', $payment); |
|
875 | - } |
|
876 | - return $html; |
|
877 | - } |
|
878 | - |
|
879 | - |
|
880 | - /** |
|
881 | - * get_payment_details |
|
882 | - * |
|
883 | - * @param array $payments |
|
884 | - * @return string |
|
885 | - * @throws \EE_Error |
|
886 | - */ |
|
887 | - public function get_payment_details($payments = array()) |
|
888 | - { |
|
889 | - // prepare variables for displaying |
|
890 | - $template_args = array(); |
|
891 | - $template_args['transaction'] = $this->_current_txn; |
|
892 | - $template_args['reg_url_link'] = $this->_reg_url_link; |
|
893 | - $template_args['payments'] = array(); |
|
894 | - foreach ($payments as $payment) { |
|
895 | - $template_args['payments'][] = $this->get_payment_row_html($payment); |
|
896 | - } |
|
897 | - // create a hacky payment object, but dont save it |
|
898 | - $payment = EE_Payment::new_instance( |
|
899 | - array( |
|
900 | - 'TXN_ID' => $this->_current_txn->ID(), |
|
901 | - 'STS_ID' => EEM_Payment::status_id_pending, |
|
902 | - 'PAY_timestamp' => time(), |
|
903 | - 'PAY_amount' => $this->_current_txn->total(), |
|
904 | - 'PMD_ID' => $this->_current_txn->payment_method_ID(), |
|
905 | - ) |
|
906 | - ); |
|
907 | - $payment_method = $this->_current_txn->payment_method(); |
|
908 | - if ($payment_method instanceof EE_Payment_Method && $payment_method->type_obj() instanceof EE_PMT_Base) { |
|
909 | - $template_args['gateway_content'] = $payment_method->type_obj()->payment_overview_content($payment); |
|
910 | - } else { |
|
911 | - $template_args['gateway_content'] = ''; |
|
912 | - } |
|
913 | - // link to SPCO payment_options |
|
914 | - $template_args['show_try_pay_again_link'] = $this->_show_try_pay_again_link; |
|
915 | - $template_args['SPCO_payment_options_url'] = $this->_SPCO_payment_options_url; |
|
916 | - // verify template arguments |
|
917 | - EEH_Template_Validator::verify_instanceof($template_args['transaction'], '$transaction', 'EE_Transaction'); |
|
918 | - EEH_Template_Validator::verify_isnt_null($template_args['payments'], '$payments'); |
|
919 | - EEH_Template_Validator::verify_isnt_null( |
|
920 | - $template_args['show_try_pay_again_link'], |
|
921 | - '$show_try_pay_again_link' |
|
922 | - ); |
|
923 | - EEH_Template_Validator::verify_isnt_null($template_args['gateway_content'], '$gateway_content'); |
|
924 | - EEH_Template_Validator::verify_isnt_null( |
|
925 | - $template_args['SPCO_payment_options_url'], |
|
926 | - '$SPCO_payment_options_url' |
|
927 | - ); |
|
928 | - return EEH_Template::locate_template( |
|
929 | - THANK_YOU_TEMPLATES_PATH . 'thank-you-page-payment-details.template.php', |
|
930 | - $template_args, |
|
931 | - true, |
|
932 | - true |
|
933 | - ); |
|
934 | - } |
|
935 | - |
|
936 | - |
|
937 | - /** |
|
938 | - * get_payment_details |
|
939 | - * |
|
940 | - * @param array $payments |
|
941 | - * @return string |
|
942 | - * @throws \EE_Error |
|
943 | - */ |
|
944 | - public function get_new_payments($payments = array()) |
|
945 | - { |
|
946 | - $payments_html = ''; |
|
947 | - // prepare variables for displaying |
|
948 | - foreach ($payments as $payment) { |
|
949 | - $payments_html .= $this->get_payment_row_html($payment); |
|
950 | - } |
|
951 | - return $payments_html; |
|
952 | - } |
|
874 | + do_action('AHEE__thank_you_page_payment_details_template__after_each_payment', $payment); |
|
875 | + } |
|
876 | + return $html; |
|
877 | + } |
|
878 | + |
|
879 | + |
|
880 | + /** |
|
881 | + * get_payment_details |
|
882 | + * |
|
883 | + * @param array $payments |
|
884 | + * @return string |
|
885 | + * @throws \EE_Error |
|
886 | + */ |
|
887 | + public function get_payment_details($payments = array()) |
|
888 | + { |
|
889 | + // prepare variables for displaying |
|
890 | + $template_args = array(); |
|
891 | + $template_args['transaction'] = $this->_current_txn; |
|
892 | + $template_args['reg_url_link'] = $this->_reg_url_link; |
|
893 | + $template_args['payments'] = array(); |
|
894 | + foreach ($payments as $payment) { |
|
895 | + $template_args['payments'][] = $this->get_payment_row_html($payment); |
|
896 | + } |
|
897 | + // create a hacky payment object, but dont save it |
|
898 | + $payment = EE_Payment::new_instance( |
|
899 | + array( |
|
900 | + 'TXN_ID' => $this->_current_txn->ID(), |
|
901 | + 'STS_ID' => EEM_Payment::status_id_pending, |
|
902 | + 'PAY_timestamp' => time(), |
|
903 | + 'PAY_amount' => $this->_current_txn->total(), |
|
904 | + 'PMD_ID' => $this->_current_txn->payment_method_ID(), |
|
905 | + ) |
|
906 | + ); |
|
907 | + $payment_method = $this->_current_txn->payment_method(); |
|
908 | + if ($payment_method instanceof EE_Payment_Method && $payment_method->type_obj() instanceof EE_PMT_Base) { |
|
909 | + $template_args['gateway_content'] = $payment_method->type_obj()->payment_overview_content($payment); |
|
910 | + } else { |
|
911 | + $template_args['gateway_content'] = ''; |
|
912 | + } |
|
913 | + // link to SPCO payment_options |
|
914 | + $template_args['show_try_pay_again_link'] = $this->_show_try_pay_again_link; |
|
915 | + $template_args['SPCO_payment_options_url'] = $this->_SPCO_payment_options_url; |
|
916 | + // verify template arguments |
|
917 | + EEH_Template_Validator::verify_instanceof($template_args['transaction'], '$transaction', 'EE_Transaction'); |
|
918 | + EEH_Template_Validator::verify_isnt_null($template_args['payments'], '$payments'); |
|
919 | + EEH_Template_Validator::verify_isnt_null( |
|
920 | + $template_args['show_try_pay_again_link'], |
|
921 | + '$show_try_pay_again_link' |
|
922 | + ); |
|
923 | + EEH_Template_Validator::verify_isnt_null($template_args['gateway_content'], '$gateway_content'); |
|
924 | + EEH_Template_Validator::verify_isnt_null( |
|
925 | + $template_args['SPCO_payment_options_url'], |
|
926 | + '$SPCO_payment_options_url' |
|
927 | + ); |
|
928 | + return EEH_Template::locate_template( |
|
929 | + THANK_YOU_TEMPLATES_PATH . 'thank-you-page-payment-details.template.php', |
|
930 | + $template_args, |
|
931 | + true, |
|
932 | + true |
|
933 | + ); |
|
934 | + } |
|
935 | + |
|
936 | + |
|
937 | + /** |
|
938 | + * get_payment_details |
|
939 | + * |
|
940 | + * @param array $payments |
|
941 | + * @return string |
|
942 | + * @throws \EE_Error |
|
943 | + */ |
|
944 | + public function get_new_payments($payments = array()) |
|
945 | + { |
|
946 | + $payments_html = ''; |
|
947 | + // prepare variables for displaying |
|
948 | + foreach ($payments as $payment) { |
|
949 | + $payments_html .= $this->get_payment_row_html($payment); |
|
950 | + } |
|
951 | + return $payments_html; |
|
952 | + } |
|
953 | 953 | } |
@@ -134,8 +134,8 @@ discard block |
||
134 | 134 | */ |
135 | 135 | public static function set_definitions() |
136 | 136 | { |
137 | - define('THANK_YOU_ASSETS_URL', plugin_dir_url(__FILE__) . 'assets' . DS); |
|
138 | - define('THANK_YOU_TEMPLATES_PATH', str_replace('\\', DS, plugin_dir_path(__FILE__)) . 'templates' . DS); |
|
137 | + define('THANK_YOU_ASSETS_URL', plugin_dir_url(__FILE__).'assets'.DS); |
|
138 | + define('THANK_YOU_TEMPLATES_PATH', str_replace('\\', DS, plugin_dir_path(__FILE__)).'templates'.DS); |
|
139 | 139 | } |
140 | 140 | |
141 | 141 | |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | return $this->_current_txn; |
151 | 151 | } |
152 | 152 | $TXN_model = EE_Registry::instance()->load_model('Transaction'); |
153 | - if (! $TXN_model instanceof EEM_Transaction) { |
|
153 | + if ( ! $TXN_model instanceof EEM_Transaction) { |
|
154 | 154 | EE_Error::add_error( |
155 | 155 | __('The transaction model could not be established.', 'event_espresso'), |
156 | 156 | __FILE__, |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | */ |
188 | 188 | public function get_txn_payments($since = 0) |
189 | 189 | { |
190 | - if (! $this->get_txn()) { |
|
190 | + if ( ! $this->get_txn()) { |
|
191 | 191 | return false; |
192 | 192 | } |
193 | 193 | $args = array('order_by' => array('PAY_timestamp' => 'ASC')); |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | */ |
207 | 207 | private function _get_reg_url_link() |
208 | 208 | { |
209 | - if (! empty($this->_reg_url_link)) { |
|
209 | + if ( ! empty($this->_reg_url_link)) { |
|
210 | 210 | return; |
211 | 211 | } |
212 | 212 | // only do thank you page stuff if we have a REG_url_link in the url |
@@ -318,7 +318,7 @@ discard block |
||
318 | 318 | { |
319 | 319 | wp_register_script( |
320 | 320 | 'thank_you_page', |
321 | - THANK_YOU_ASSETS_URL . 'thank_you_page.js', |
|
321 | + THANK_YOU_ASSETS_URL.'thank_you_page.js', |
|
322 | 322 | array('espresso_core', 'heartbeat'), |
323 | 323 | EVENT_ESPRESSO_VERSION, |
324 | 324 | true |
@@ -337,9 +337,9 @@ discard block |
||
337 | 337 | public function init() |
338 | 338 | { |
339 | 339 | $this->_get_reg_url_link(); |
340 | - if (! $this->get_txn()) { |
|
340 | + if ( ! $this->get_txn()) { |
|
341 | 341 | echo EEH_HTML::div( |
342 | - EEH_HTML::h4(__('We\'re sorry...', 'event_espresso'), '', '') . |
|
342 | + EEH_HTML::h4(__('We\'re sorry...', 'event_espresso'), '', ''). |
|
343 | 343 | sprintf( |
344 | 344 | __( |
345 | 345 | 'This is a system page for displaying transaction information after a purchase.%1$sYou are most likely seeing this notice because you have navigated to this page%1$sthrough some means other than completing a transaction.%1$sSorry for the disappointment, but you will most likely find nothing of interest here.%1$s%1$s', |
@@ -429,12 +429,12 @@ discard block |
||
429 | 429 | public function thank_you_page_results() |
430 | 430 | { |
431 | 431 | $this->init(); |
432 | - if (! $this->_current_txn instanceof EE_Transaction) { |
|
432 | + if ( ! $this->_current_txn instanceof EE_Transaction) { |
|
433 | 433 | return EE_Error::get_notices(); |
434 | 434 | } |
435 | 435 | // link to receipt |
436 | 436 | $template_args['TXN_receipt_url'] = $this->_current_txn->receipt_url('html'); |
437 | - if (! empty($template_args['TXN_receipt_url'])) { |
|
437 | + if ( ! empty($template_args['TXN_receipt_url'])) { |
|
438 | 438 | $template_args['order_conf_desc'] = __( |
439 | 439 | '%1$sCongratulations%2$sYour registration has been successfully processed.%3$sCheck your email for your registration confirmation or click the button below to view / download / print a full description of your purchases and registration information.', |
440 | 440 | 'event_espresso' |
@@ -452,7 +452,7 @@ discard block |
||
452 | 452 | add_action('AHEE__thank_you_page_overview_template__content', array($this, 'get_ajax_content')); |
453 | 453 | } |
454 | 454 | return EEH_Template::locate_template( |
455 | - THANK_YOU_TEMPLATES_PATH . 'thank-you-page-overview.template.php', |
|
455 | + THANK_YOU_TEMPLATES_PATH.'thank-you-page-overview.template.php', |
|
456 | 456 | $template_args, |
457 | 457 | true, |
458 | 458 | true |
@@ -474,11 +474,11 @@ discard block |
||
474 | 474 | public static function thank_you_page_IPN_monitor($response = array(), $data = array()) |
475 | 475 | { |
476 | 476 | // does this heartbeat contain our data ? |
477 | - if (! isset($data['espresso_thank_you_page'])) { |
|
477 | + if ( ! isset($data['espresso_thank_you_page'])) { |
|
478 | 478 | return $response; |
479 | 479 | } |
480 | 480 | // check for reg_url_link in the incoming heartbeat data |
481 | - if (! isset($data['espresso_thank_you_page']['e_reg_url_link'])) { |
|
481 | + if ( ! isset($data['espresso_thank_you_page']['e_reg_url_link'])) { |
|
482 | 482 | $response['espresso_thank_you_page'] = array( |
483 | 483 | 'errors' => ! empty($notices['errors']) |
484 | 484 | ? $notices['errors'] |
@@ -500,7 +500,7 @@ discard block |
||
500 | 500 | // get TXN |
501 | 501 | $TXN = $espresso_thank_you_page->get_txn(); |
502 | 502 | // no TXN? then get out |
503 | - if (! $TXN instanceof EE_Transaction) { |
|
503 | + if ( ! $TXN instanceof EE_Transaction) { |
|
504 | 504 | $notices = EE_Error::get_notices(); |
505 | 505 | $response['espresso_thank_you_page'] = array( |
506 | 506 | 'errors' => ! empty($notices['errors']) |
@@ -552,7 +552,7 @@ discard block |
||
552 | 552 | // then check for payments |
553 | 553 | $payments = $espresso_thank_you_page->get_txn_payments($since); |
554 | 554 | // has a payment been processed ? |
555 | - if (! empty($payments) || $espresso_thank_you_page->_is_offline_payment_method) { |
|
555 | + if ( ! empty($payments) || $espresso_thank_you_page->_is_offline_payment_method) { |
|
556 | 556 | if ($since) { |
557 | 557 | $response['espresso_thank_you_page'] = array( |
558 | 558 | 'new_payments' => $espresso_thank_you_page->get_new_payments($payments), |
@@ -616,7 +616,7 @@ discard block |
||
616 | 616 | '$SPCO_attendee_information_url' |
617 | 617 | ); |
618 | 618 | echo EEH_Template::locate_template( |
619 | - THANK_YOU_TEMPLATES_PATH . 'thank-you-page-registration-details.template.php', |
|
619 | + THANK_YOU_TEMPLATES_PATH.'thank-you-page-registration-details.template.php', |
|
620 | 620 | $template_args, |
621 | 621 | true, |
622 | 622 | true |
@@ -689,7 +689,7 @@ discard block |
||
689 | 689 | */ |
690 | 690 | public function get_ajax_content() |
691 | 691 | { |
692 | - if (! $this->get_txn()) { |
|
692 | + if ( ! $this->get_txn()) { |
|
693 | 693 | return; |
694 | 694 | } |
695 | 695 | // first determine which event(s) require pre-approval or not |
@@ -700,9 +700,9 @@ discard block |
||
700 | 700 | $event = $registration->event(); |
701 | 701 | if ($event instanceof EE_Event) { |
702 | 702 | if ($registration->is_not_approved() && $registration->event() instanceof EE_Event) { |
703 | - $events_requiring_pre_approval[ $event->ID() ] = $event; |
|
703 | + $events_requiring_pre_approval[$event->ID()] = $event; |
|
704 | 704 | } else { |
705 | - $events[ $event->ID() ] = $event; |
|
705 | + $events[$event->ID()] = $event; |
|
706 | 706 | } |
707 | 707 | } |
708 | 708 | } |
@@ -720,7 +720,7 @@ discard block |
||
720 | 720 | */ |
721 | 721 | public function display_details_for_events($events = array()) |
722 | 722 | { |
723 | - if (! empty($events)) { |
|
723 | + if ( ! empty($events)) { |
|
724 | 724 | ?> |
725 | 725 | <div id="espresso-thank-you-page-ajax-content-dv"> |
726 | 726 | <div id="espresso-thank-you-page-ajax-transaction-dv"></div> |
@@ -733,7 +733,7 @@ discard block |
||
733 | 733 | 'event_espresso' |
734 | 734 | ); ?></span> |
735 | 735 | </div> |
736 | - <?php if (! $this->_is_offline_payment_method && ! $this->_payments_closed) : ?> |
|
736 | + <?php if ( ! $this->_is_offline_payment_method && ! $this->_payments_closed) : ?> |
|
737 | 737 | <p id="ee-ajax-loading-pg" class="highlight-bg small-text clear"> |
738 | 738 | <?php echo apply_filters( |
739 | 739 | 'EED_Thank_You_Page__get_ajax_content__waiting_for_IPN_msg', |
@@ -764,7 +764,7 @@ discard block |
||
764 | 764 | */ |
765 | 765 | public function display_details_for_events_requiring_pre_approval($events = array()) |
766 | 766 | { |
767 | - if (! empty($events)) { |
|
767 | + if ( ! empty($events)) { |
|
768 | 768 | ?> |
769 | 769 | <div id="espresso-thank-you-page-not-approved-message-dv"> |
770 | 770 | <h4 class="orange-text"><?php _e('Important Notice:', 'event_espresso'); ?></h4> |
@@ -821,7 +821,7 @@ discard block |
||
821 | 821 | '$SPCO_payment_options_url' |
822 | 822 | ); |
823 | 823 | return EEH_Template::locate_template( |
824 | - THANK_YOU_TEMPLATES_PATH . 'thank-you-page-transaction-details.template.php', |
|
824 | + THANK_YOU_TEMPLATES_PATH.'thank-you-page-transaction-details.template.php', |
|
825 | 825 | $template_args, |
826 | 826 | true, |
827 | 827 | true |
@@ -850,25 +850,25 @@ discard block |
||
850 | 850 | $payment->set_status(EEM_Payment::status_id_pending); |
851 | 851 | } |
852 | 852 | $payment_declined_msg = $payment->STS_ID() === EEM_Payment::status_id_declined |
853 | - ? '<br /><span class="small-text">' . $payment->gateway_response() . '</span>' |
|
853 | + ? '<br /><span class="small-text">'.$payment->gateway_response().'</span>' |
|
854 | 854 | : ''; |
855 | 855 | $html .= ' |
856 | 856 | <tr> |
857 | 857 | <td> |
858 | - ' . $payment->timestamp() . ' |
|
858 | + ' . $payment->timestamp().' |
|
859 | 859 | </td> |
860 | 860 | <td> |
861 | 861 | ' . ( |
862 | 862 | $payment->payment_method() instanceof EE_Payment_Method |
863 | 863 | ? $payment->payment_method()->name() |
864 | 864 | : __('Unknown', 'event_espresso') |
865 | - ) . ' |
|
865 | + ).' |
|
866 | 866 | </td> |
867 | 867 | <td class="jst-rght"> |
868 | - ' . EEH_Template::format_currency($payment->amount()) . ' |
|
868 | + ' . EEH_Template::format_currency($payment->amount()).' |
|
869 | 869 | </td> |
870 | 870 | <td class="jst-rght" style="line-height:1;"> |
871 | - ' . $payment->pretty_status(true) . $payment_declined_msg . ' |
|
871 | + ' . $payment->pretty_status(true).$payment_declined_msg.' |
|
872 | 872 | </td> |
873 | 873 | </tr>'; |
874 | 874 | do_action('AHEE__thank_you_page_payment_details_template__after_each_payment', $payment); |
@@ -926,7 +926,7 @@ discard block |
||
926 | 926 | '$SPCO_payment_options_url' |
927 | 927 | ); |
928 | 928 | return EEH_Template::locate_template( |
929 | - THANK_YOU_TEMPLATES_PATH . 'thank-you-page-payment-details.template.php', |
|
929 | + THANK_YOU_TEMPLATES_PATH.'thank-you-page-payment-details.template.php', |
|
930 | 930 | $template_args, |
931 | 931 | true, |
932 | 932 | true |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | <label><?php _e('Amount Owing: ', 'event_espresso'); ?></label> |
18 | 18 | </td> |
19 | 19 | <td class="<?php echo ($transaction->paid() == $transaction->total()) ? 'ee-transaction-paid' |
20 | - : 'ee-transaction-unpaid' ?>"> |
|
20 | + : 'ee-transaction-unpaid' ?>"> |
|
21 | 21 | <?php echo EEH_Template::format_currency($transaction->remaining()); ?> |
22 | 22 | </td> |
23 | 23 | </tr> |
@@ -27,12 +27,12 @@ discard block |
||
27 | 27 | </td> |
28 | 28 | <td> |
29 | 29 | <?php $transaction->e_pretty_status(true); |
30 | - if ($show_try_pay_again_link && ! $transaction->is_completed()) { ?> |
|
30 | + if ($show_try_pay_again_link && ! $transaction->is_completed()) { ?> |
|
31 | 31 | <span class="small-text"><a href='<?php echo $SPCO_payment_options_url ?>'> |
32 | 32 | <?php _e( |
33 | - 'View Payment Options', |
|
34 | - 'event_espresso' |
|
35 | - ); ?></a></span> |
|
33 | + 'View Payment Options', |
|
34 | + 'event_espresso' |
|
35 | + ); ?></a></span> |
|
36 | 36 | <?php } ?> |
37 | 37 | </td> |
38 | 38 | </tr> |
@@ -45,9 +45,9 @@ discard block |
||
45 | 45 | </td> |
46 | 46 | </tr> |
47 | 47 | <?php do_action( |
48 | - 'AHEE__thank_you_page_transaction_details_template__after_transaction_table_row', |
|
49 | - $transaction |
|
50 | - ); ?> |
|
48 | + 'AHEE__thank_you_page_transaction_details_template__after_transaction_table_row', |
|
49 | + $transaction |
|
50 | + ); ?> |
|
51 | 51 | </tbody> |
52 | 52 | </table> |
53 | 53 | |
@@ -55,9 +55,9 @@ discard block |
||
55 | 55 | <p class="small-text jst-rght"> |
56 | 56 | <a href='<?php echo $SPCO_payment_options_url ?>'> |
57 | 57 | <?php _e( |
58 | - "Click here to view Payment Options", |
|
59 | - 'event_espresso' |
|
60 | - ); ?></a> |
|
58 | + "Click here to view Payment Options", |
|
59 | + 'event_espresso' |
|
60 | + ); ?></a> |
|
61 | 61 | </p> |
62 | 62 | <br/> |
63 | 63 |
@@ -13,24 +13,24 @@ |
||
13 | 13 | <div class="ee-attention"> |
14 | 14 | <div class="extra-padding-sides"> |
15 | 15 | <?php echo apply_filters( |
16 | - 'FHEE__thank_you_page_overview_template__order_conf_desc', |
|
17 | - sprintf( |
|
18 | - $order_conf_desc, |
|
19 | - '<h3 class="">', |
|
20 | - '</h3>', |
|
21 | - '<br />' |
|
22 | - ) |
|
23 | - ); |
|
24 | - if (! empty($TXN_receipt_url)) : ?> |
|
16 | + 'FHEE__thank_you_page_overview_template__order_conf_desc', |
|
17 | + sprintf( |
|
18 | + $order_conf_desc, |
|
19 | + '<h3 class="">', |
|
20 | + '</h3>', |
|
21 | + '<br />' |
|
22 | + ) |
|
23 | + ); |
|
24 | + if (! empty($TXN_receipt_url)) : ?> |
|
25 | 25 | <br/> |
26 | 26 | <div class="jst-rght"> |
27 | 27 | <a class="ee-button ee-roundish indented-text big-text" |
28 | 28 | href="<?php echo $TXN_receipt_url; ?>"><span |
29 | 29 | class="ee-icon ee-icon-PDF-file-type"></span> |
30 | 30 | <?php echo apply_filters( |
31 | - 'FHEE__thank_you_page_overview_template__order_conf_button_text', |
|
32 | - __('View Full Order Confirmation Receipt', 'event_espresso') |
|
33 | - ); ?></a> |
|
31 | + 'FHEE__thank_you_page_overview_template__order_conf_button_text', |
|
32 | + __('View Full Order Confirmation Receipt', 'event_espresso') |
|
33 | + ); ?></a> |
|
34 | 34 | </div> |
35 | 35 | <?php endif; ?> |
36 | 36 | </div> |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | |
10 | 10 | <div id="espresso-thank-you-page-overview-dv" class="width-100"> |
11 | 11 | |
12 | - <?php if (! $revisit) : ?> |
|
12 | + <?php if ( ! $revisit) : ?> |
|
13 | 13 | <div class="ee-attention"> |
14 | 14 | <div class="extra-padding-sides"> |
15 | 15 | <?php echo apply_filters( |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | '<br />' |
22 | 22 | ) |
23 | 23 | ); |
24 | - if (! empty($TXN_receipt_url)) : ?> |
|
24 | + if ( ! empty($TXN_receipt_url)) : ?> |
|
25 | 25 | <br/> |
26 | 26 | <div class="jst-rght"> |
27 | 27 | <a class="ee-button ee-roundish indented-text big-text" |
@@ -9,22 +9,22 @@ discard block |
||
9 | 9 | |
10 | 10 | <div class="ee-registration-details-dv"> |
11 | 11 | <?php |
12 | - $registrations = $transaction->registrations(); |
|
13 | - $registrations = is_array($registrations) ? $registrations : array(); |
|
14 | - $reg_count = count($registrations); |
|
15 | - $reg_cntr = 0; |
|
16 | - $event_name = ''; |
|
17 | - $wait_list = false; |
|
18 | - foreach ($registrations as $registration) { |
|
19 | - if ($registration instanceof EE_Registration) { |
|
20 | - if ($event_name != $registration->event_name() && ! empty($event_name)) { ?> |
|
12 | + $registrations = $transaction->registrations(); |
|
13 | + $registrations = is_array($registrations) ? $registrations : array(); |
|
14 | + $reg_count = count($registrations); |
|
15 | + $reg_cntr = 0; |
|
16 | + $event_name = ''; |
|
17 | + $wait_list = false; |
|
18 | + foreach ($registrations as $registration) { |
|
19 | + if ($registration instanceof EE_Registration) { |
|
20 | + if ($event_name != $registration->event_name() && ! empty($event_name)) { ?> |
|
21 | 21 | </tbody> |
22 | 22 | </table> |
23 | 23 | <?php |
24 | - } |
|
25 | - $reg_cntr++; |
|
26 | - if ($event_name != $registration->event_name()) { |
|
27 | - ?> |
|
24 | + } |
|
25 | + $reg_cntr++; |
|
26 | + if ($event_name != $registration->event_name()) { |
|
27 | + ?> |
|
28 | 28 | <h5> |
29 | 29 | <span class="smaller-text grey-text"><?php _e('for', 'event_espresso'); ?> |
30 | 30 | : </span> <?php echo htmlentities($registration->event_name(), ENT_QUOTES, 'UTF-8'); ?> |
@@ -45,46 +45,46 @@ discard block |
||
45 | 45 | </thead> |
46 | 46 | <tbody> |
47 | 47 | <?php |
48 | - } |
|
49 | - if ($is_primary || (! $is_primary && $reg_url_link == $registration->reg_url_link())) { ?> |
|
48 | + } |
|
49 | + if ($is_primary || (! $is_primary && $reg_url_link == $registration->reg_url_link())) { ?> |
|
50 | 50 | <tr> |
51 | 51 | <td width="40%"> |
52 | 52 | <?php |
53 | - if ($registration->attendee() instanceof EE_Attendee) { |
|
54 | - echo $registration->attendee()->full_name(true); |
|
55 | - } |
|
56 | - ?> |
|
53 | + if ($registration->attendee() instanceof EE_Attendee) { |
|
54 | + echo $registration->attendee()->full_name(true); |
|
55 | + } |
|
56 | + ?> |
|
57 | 57 | <p class="tiny-text" style="margin: .75em 0 0;"> |
58 | 58 | <?php |
59 | - if ($registration->count_question_groups()) { |
|
60 | - ?> |
|
59 | + if ($registration->count_question_groups()) { |
|
60 | + ?> |
|
61 | 61 | <a class="ee-icon-only-lnk" |
62 | 62 | href="<?php echo $registration->edit_attendee_information_url(); ?>" |
63 | 63 | title="<?php |
64 | - esc_attr_e( |
|
65 | - 'Click here to edit Attendee Information', |
|
66 | - 'event_espresso' |
|
67 | - ); ?>"><span class="ee-icon ee-icon-user-edit"></span> |
|
64 | + esc_attr_e( |
|
65 | + 'Click here to edit Attendee Information', |
|
66 | + 'event_espresso' |
|
67 | + ); ?>"><span class="ee-icon ee-icon-user-edit"></span> |
|
68 | 68 | <?php _e( |
69 | - 'edit info', |
|
70 | - 'event_espresso' |
|
71 | - ); ?></a> |
|
69 | + 'edit info', |
|
70 | + 'event_espresso' |
|
71 | + ); ?></a> |
|
72 | 72 | <?php } ?> |
73 | 73 | <a class="ee-resend-reg-confirmation-email ee-icon-only-lnk" |
74 | 74 | href="<?php |
75 | - echo add_query_arg( |
|
76 | - array('token' => $registration->reg_url_link(), 'resend_reg_confirmation' => 'true'), |
|
77 | - EE_Registry::instance()->CFG->core->thank_you_page_url() |
|
78 | - ); ?>" title="<?php |
|
79 | - esc_attr_e( |
|
80 | - 'Click here to resend the Registration Confirmation email', |
|
81 | - 'event_espresso' |
|
82 | - ); ?>" rel="<?php echo $registration->reg_url_link(); ?>"><span |
|
75 | + echo add_query_arg( |
|
76 | + array('token' => $registration->reg_url_link(), 'resend_reg_confirmation' => 'true'), |
|
77 | + EE_Registry::instance()->CFG->core->thank_you_page_url() |
|
78 | + ); ?>" title="<?php |
|
79 | + esc_attr_e( |
|
80 | + 'Click here to resend the Registration Confirmation email', |
|
81 | + 'event_espresso' |
|
82 | + ); ?>" rel="<?php echo $registration->reg_url_link(); ?>"><span |
|
83 | 83 | class="dashicons dashicons-email-alt"></span> |
84 | 84 | <?php _e( |
85 | - 'resend email', |
|
86 | - 'event_espresso' |
|
87 | - ); ?></a> |
|
85 | + 'resend email', |
|
86 | + 'event_espresso' |
|
87 | + ); ?></a> |
|
88 | 88 | </p> |
89 | 89 | </td> |
90 | 90 | <td width="25%" class="jst-left"> |
@@ -93,53 +93,53 @@ discard block |
||
93 | 93 | <td width="35%" class="jst-left"> |
94 | 94 | <?php $registration->e_pretty_status(true) ?> |
95 | 95 | <?php |
96 | - if ($registration->status_ID() === EEM_Registration::status_id_wait_list) { |
|
97 | - $wait_list = true; |
|
98 | - } |
|
99 | - ?> |
|
96 | + if ($registration->status_ID() === EEM_Registration::status_id_wait_list) { |
|
97 | + $wait_list = true; |
|
98 | + } |
|
99 | + ?> |
|
100 | 100 | </td> |
101 | 101 | </tr> |
102 | 102 | <?php do_action( |
103 | - 'AHEE__thank_you_page_registration_details_template__after_registration_table_row', |
|
104 | - $registration |
|
105 | - ); ?> |
|
103 | + 'AHEE__thank_you_page_registration_details_template__after_registration_table_row', |
|
104 | + $registration |
|
105 | + ); ?> |
|
106 | 106 | <?php |
107 | - $event_name = $registration->event_name(); |
|
108 | - } |
|
109 | - if ($reg_cntr >= $reg_count) { |
|
110 | - ?> |
|
107 | + $event_name = $registration->event_name(); |
|
108 | + } |
|
109 | + if ($reg_cntr >= $reg_count) { |
|
110 | + ?> |
|
111 | 111 | </tbody> |
112 | 112 | </table> |
113 | 113 | <?php |
114 | - } |
|
115 | - } |
|
116 | - } |
|
117 | - ?> |
|
114 | + } |
|
115 | + } |
|
116 | + } |
|
117 | + ?> |
|
118 | 118 | <?php if ($is_primary && $SPCO_attendee_information_url) { ?> |
119 | 119 | <p class="small-text jst-rght"> |
120 | 120 | <a href='<?php echo $SPCO_attendee_information_url ?>'> |
121 | 121 | <?php _e( |
122 | - "Click here to edit All Attendee Information", |
|
123 | - 'event_espresso' |
|
124 | - ); ?></a> |
|
122 | + "Click here to edit All Attendee Information", |
|
123 | + 'event_espresso' |
|
124 | + ); ?></a> |
|
125 | 125 | </p> |
126 | 126 | <?php } ?> |
127 | 127 | <?php |
128 | - if ($wait_list) { ?> |
|
128 | + if ($wait_list) { ?> |
|
129 | 129 | <?php |
130 | - echo apply_filters( |
|
131 | - 'AFEE__thank_you_page_registration_details_template__wait_list_notice', |
|
132 | - sprintf( |
|
133 | - __( |
|
134 | - '%1$sre: Wait List Registrations%2$sPlease note that the total cost listed below in the Transaction Details is for ALL registrations, including those that are on the wait list, even though they can not be currently paid for. If any spaces become available however, you may be notified by the Event admin and have the opportunity to secure the remaining tickets by making a payment for them.%3$s', |
|
135 | - 'event_espresso' |
|
136 | - ), |
|
137 | - '<h6 class="" style="margin-bottom:.25em;"><span class="dashicons dashicons-clipboard ee-icon-size-16 purple-text"></span>', |
|
138 | - '</h6 ><p class="ee-wait-list-notice">', |
|
139 | - '</p ><br />' |
|
140 | - ) |
|
141 | - ); |
|
142 | - ?> |
|
130 | + echo apply_filters( |
|
131 | + 'AFEE__thank_you_page_registration_details_template__wait_list_notice', |
|
132 | + sprintf( |
|
133 | + __( |
|
134 | + '%1$sre: Wait List Registrations%2$sPlease note that the total cost listed below in the Transaction Details is for ALL registrations, including those that are on the wait list, even though they can not be currently paid for. If any spaces become available however, you may be notified by the Event admin and have the opportunity to secure the remaining tickets by making a payment for them.%3$s', |
|
135 | + 'event_espresso' |
|
136 | + ), |
|
137 | + '<h6 class="" style="margin-bottom:.25em;"><span class="dashicons dashicons-clipboard ee-icon-size-16 purple-text"></span>', |
|
138 | + '</h6 ><p class="ee-wait-list-notice">', |
|
139 | + '</p ><br />' |
|
140 | + ) |
|
141 | + ); |
|
142 | + ?> |
|
143 | 143 | |
144 | 144 | <?php } ?> |
145 | 145 |
@@ -46,7 +46,7 @@ |
||
46 | 46 | <tbody> |
47 | 47 | <?php |
48 | 48 | } |
49 | - if ($is_primary || (! $is_primary && $reg_url_link == $registration->reg_url_link())) { ?> |
|
49 | + if ($is_primary || ( ! $is_primary && $reg_url_link == $registration->reg_url_link())) { ?> |
|
50 | 50 | <tr> |
51 | 51 | <td width="40%"> |
52 | 52 | <?php |
@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | |
6 | 6 | <div id="espresso-thank-you-page-payment-details-dv"> |
7 | 7 | <?php |
8 | - if (! empty($payments)) { ?> |
|
8 | + if (! empty($payments)) { ?> |
|
9 | 9 | <table class="ee-table"> |
10 | 10 | <thead> |
11 | 11 | <tr> |
@@ -25,40 +25,40 @@ discard block |
||
25 | 25 | </thead> |
26 | 26 | <tbody> |
27 | 27 | <?php |
28 | - foreach ($payments as $payment) { |
|
29 | - echo $payment; |
|
30 | - } |
|
31 | - ?> |
|
28 | + foreach ($payments as $payment) { |
|
29 | + echo $payment; |
|
30 | + } |
|
31 | + ?> |
|
32 | 32 | </tbody> |
33 | 33 | </table> |
34 | 34 | <?php |
35 | - } else { |
|
36 | - if ($transaction->total()) { |
|
37 | - echo apply_filters( |
|
38 | - 'FHEE__payment_overview_template__no_payments_made', |
|
39 | - sprintf( |
|
40 | - __('%sNo payments towards this transaction have been received.%s', 'event_espresso'), |
|
41 | - '<p class="important-notice">', |
|
42 | - '</p>' |
|
43 | - ) |
|
44 | - ); |
|
45 | - do_action('AHEE__thank_you_page_payment_details_template__no_payments_made', $transaction); |
|
46 | - } else { |
|
47 | - echo apply_filters( |
|
48 | - 'FHEE__payment_overview_template__no_payment_required', |
|
49 | - sprintf( |
|
50 | - __('%sNo payment is required for this transaction.%s', 'event_espresso'), |
|
51 | - '<p>', |
|
52 | - '</p>' |
|
53 | - ) |
|
54 | - ); |
|
55 | - do_action('AHEE__thank_you_page_payment_details_template__no_payment_required'); |
|
56 | - } |
|
57 | - } |
|
58 | - echo $gateway_content; |
|
59 | - do_action('AHEE__thank_you_page_payment_details_template__after_gateway_content', $gateway_content); |
|
35 | + } else { |
|
36 | + if ($transaction->total()) { |
|
37 | + echo apply_filters( |
|
38 | + 'FHEE__payment_overview_template__no_payments_made', |
|
39 | + sprintf( |
|
40 | + __('%sNo payments towards this transaction have been received.%s', 'event_espresso'), |
|
41 | + '<p class="important-notice">', |
|
42 | + '</p>' |
|
43 | + ) |
|
44 | + ); |
|
45 | + do_action('AHEE__thank_you_page_payment_details_template__no_payments_made', $transaction); |
|
46 | + } else { |
|
47 | + echo apply_filters( |
|
48 | + 'FHEE__payment_overview_template__no_payment_required', |
|
49 | + sprintf( |
|
50 | + __('%sNo payment is required for this transaction.%s', 'event_espresso'), |
|
51 | + '<p>', |
|
52 | + '</p>' |
|
53 | + ) |
|
54 | + ); |
|
55 | + do_action('AHEE__thank_you_page_payment_details_template__no_payment_required'); |
|
56 | + } |
|
57 | + } |
|
58 | + echo $gateway_content; |
|
59 | + do_action('AHEE__thank_you_page_payment_details_template__after_gateway_content', $gateway_content); |
|
60 | 60 | |
61 | - ?> |
|
61 | + ?> |
|
62 | 62 | |
63 | 63 | <br/> |
64 | 64 | <?php do_action('AHEE__thank_you_page_payment_details_template__after_payment_details'); |
@@ -5,7 +5,7 @@ |
||
5 | 5 | |
6 | 6 | <div id="espresso-thank-you-page-payment-details-dv"> |
7 | 7 | <?php |
8 | - if (! empty($payments)) { ?> |
|
8 | + if ( ! empty($payments)) { ?> |
|
9 | 9 | <table class="ee-table"> |
10 | 10 | <thead> |
11 | 11 | <tr> |
@@ -2,36 +2,36 @@ |
||
2 | 2 | /** @type array $registrations_for_free_events */ |
3 | 3 | |
4 | 4 | if (is_array($registrations_for_free_events) && ! empty($registrations_for_free_events)) { |
5 | - echo apply_filters( |
|
6 | - 'FHEE__registration_page_payment_options__no_payment_required_hdr', |
|
7 | - sprintf( |
|
8 | - __('%1$sNo Payment Required%2$s', 'event_espresso'), |
|
9 | - '<h6>', |
|
10 | - '</h6>' |
|
11 | - ) |
|
12 | - ); |
|
13 | - foreach ($registrations_for_free_events as $registration_for_free_event) { |
|
14 | - if ($registration_for_free_event instanceof EE_Registration |
|
15 | - && $registration_for_free_event->ticket()->is_free() |
|
16 | - ) { |
|
17 | - if ($registration_for_free_event->event() instanceof EE_Event) { |
|
18 | - ?> |
|
5 | + echo apply_filters( |
|
6 | + 'FHEE__registration_page_payment_options__no_payment_required_hdr', |
|
7 | + sprintf( |
|
8 | + __('%1$sNo Payment Required%2$s', 'event_espresso'), |
|
9 | + '<h6>', |
|
10 | + '</h6>' |
|
11 | + ) |
|
12 | + ); |
|
13 | + foreach ($registrations_for_free_events as $registration_for_free_event) { |
|
14 | + if ($registration_for_free_event instanceof EE_Registration |
|
15 | + && $registration_for_free_event->ticket()->is_free() |
|
16 | + ) { |
|
17 | + if ($registration_for_free_event->event() instanceof EE_Event) { |
|
18 | + ?> |
|
19 | 19 | <p> |
20 | 20 | <?php echo apply_filters( |
21 | - 'FHEE__registration_page_payment_options__no_payment_required_pg', |
|
22 | - sprintf( |
|
23 | - __( |
|
24 | - '"%1$s" for "%2$s" is free, so no payment is required and no billing will occur.', |
|
25 | - 'event_espresso' |
|
26 | - ), |
|
27 | - $registration_for_free_event->ticket()->name(), |
|
28 | - $registration_for_free_event->event()->name() |
|
29 | - ) |
|
30 | - ); ?> |
|
21 | + 'FHEE__registration_page_payment_options__no_payment_required_pg', |
|
22 | + sprintf( |
|
23 | + __( |
|
24 | + '"%1$s" for "%2$s" is free, so no payment is required and no billing will occur.', |
|
25 | + 'event_espresso' |
|
26 | + ), |
|
27 | + $registration_for_free_event->ticket()->name(), |
|
28 | + $registration_for_free_event->event()->name() |
|
29 | + ) |
|
30 | + ); ?> |
|
31 | 31 | </p> |
32 | 32 | <?php |
33 | - } |
|
34 | - } |
|
35 | - } |
|
33 | + } |
|
34 | + } |
|
35 | + } |
|
36 | 36 | } |
37 | 37 | ?> |