@@ -6,12 +6,12 @@ |
||
6 | 6 | * @subpackage |
7 | 7 | * @author Mike Nelson |
8 | 8 | */ |
9 | -class EE_Submit_Input extends EE_Form_Input_Base{ |
|
9 | +class EE_Submit_Input extends EE_Form_Input_Base { |
|
10 | 10 | |
11 | 11 | /** |
12 | 12 | * @param array $options |
13 | 13 | */ |
14 | - function __construct($options = array()){ |
|
14 | + function __construct($options = array()) { |
|
15 | 15 | $this->_set_display_strategy(new EE_Submit_Input_Display_Strategy()); |
16 | 16 | $this->_set_normalization_strategy(new EE_Text_Normalization()); |
17 | 17 | parent::__construct($options); |
@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | * @subpackage |
7 | 7 | * @author Mike Nelson |
8 | 8 | */ |
9 | -class EE_Text_Area_Input extends EE_Form_Input_Base{ |
|
9 | +class EE_Text_Area_Input extends EE_Form_Input_Base { |
|
10 | 10 | |
11 | 11 | |
12 | 12 | protected $_rows = 2; |
@@ -16,28 +16,28 @@ discard block |
||
16 | 16 | * sets the rows property on this input |
17 | 17 | * @param int $rows |
18 | 18 | */ |
19 | - public function set_rows( $rows ) { |
|
19 | + public function set_rows($rows) { |
|
20 | 20 | $this->_rows = $rows; |
21 | 21 | } |
22 | 22 | /** |
23 | 23 | * sets the cols html property on this input |
24 | 24 | * @param int $cols |
25 | 25 | */ |
26 | - public function set_cols( $cols ) { |
|
26 | + public function set_cols($cols) { |
|
27 | 27 | $this->_cols = $cols; |
28 | 28 | } |
29 | 29 | /** |
30 | 30 | * |
31 | 31 | * @return int |
32 | 32 | */ |
33 | - public function get_rows(){ |
|
33 | + public function get_rows() { |
|
34 | 34 | return $this->_rows; |
35 | 35 | } |
36 | 36 | /** |
37 | 37 | * |
38 | 38 | * @return int |
39 | 39 | */ |
40 | - public function get_cols(){ |
|
40 | + public function get_cols() { |
|
41 | 41 | return $this->_cols; |
42 | 42 | } |
43 | 43 |
@@ -6,13 +6,13 @@ |
||
6 | 6 | * @subpackage |
7 | 7 | * @author Mike Nelson |
8 | 8 | */ |
9 | -class EE_Text_Input extends EE_Form_Input_Base{ |
|
9 | +class EE_Text_Input extends EE_Form_Input_Base { |
|
10 | 10 | |
11 | 11 | |
12 | 12 | /** |
13 | 13 | * @param array $options |
14 | 14 | */ |
15 | - function __construct($options = array()){ |
|
15 | + function __construct($options = array()) { |
|
16 | 16 | $this->_set_display_strategy(new EE_Text_Input_Display_Strategy()); |
17 | 17 | $this->_set_normalization_strategy(new EE_Text_Normalization()); |
18 | 18 | parent::__construct($options); |
@@ -1,16 +1,16 @@ |
||
1 | 1 | <?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { exit('No direct script access allowed'); } |
2 | 2 | /** |
3 | - * |
|
4 | - * Class EE_Question_Answer_Form_Section |
|
5 | - * |
|
6 | - * Description |
|
7 | - * |
|
8 | - * @package Event Espresso |
|
9 | - * @subpackage core |
|
10 | - * @author Brent Christensen |
|
11 | - * @since $VID:$ |
|
12 | - * |
|
13 | - */ |
|
3 | + * |
|
4 | + * Class EE_Question_Answer_Form_Section |
|
5 | + * |
|
6 | + * Description |
|
7 | + * |
|
8 | + * @package Event Espresso |
|
9 | + * @subpackage core |
|
10 | + * @author Brent Christensen |
|
11 | + * @since $VID:$ |
|
12 | + * |
|
13 | + */ |
|
14 | 14 | |
15 | 15 | class EE_Question_Answer_Form_Section extends EE_Form_Section_Proper { |
16 | 16 |
@@ -19,13 +19,13 @@ discard block |
||
19 | 19 | * @param EE_Question $question |
20 | 20 | * @param EE_Answer $answer |
21 | 21 | */ |
22 | - public function __construct( EE_Registration $registration, EE_Question $question, EE_Answer $answer ){ |
|
22 | + public function __construct(EE_Registration $registration, EE_Question $question, EE_Answer $answer) { |
|
23 | 23 | // array of params to pass to parent constructor |
24 | 24 | $form_args = array( |
25 | 25 | 'name' => $registration->reg_url_link(), |
26 | 26 | 'subsections' => array(), |
27 | 27 | 'layout_strategy' => new EE_Div_Per_Section_Layout(), |
28 | - 'html_name' => '[' . $registration->reg_url_link() . ']', |
|
28 | + 'html_name' => '['.$registration->reg_url_link().']', |
|
29 | 29 | 'html_id' => $registration->reg_url_link(), |
30 | 30 | 'html_class' => 'ee-reg-page-questions' |
31 | 31 | ); |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | 'default'=>$model_field->get_default_value(), |
36 | 36 | )); |
37 | 37 | |
38 | - switch ( $question->type() ) { |
|
38 | + switch ($question->type()) { |
|
39 | 39 | // Text |
40 | 40 | case EEM_Question::QST_type_text : |
41 | 41 | $input_class = 'EE_Text_Input'; |
@@ -61,9 +61,9 @@ discard block |
||
61 | 61 | $input_class = 'EE_Text_Input'; |
62 | 62 | break; |
63 | 63 | } |
64 | - $reflection = new ReflectionClass( $input_class ); |
|
65 | - $form_args['subsections'][] = $reflection->newInstanceArgs( $input_constructor_args ); |
|
66 | - parent::__construct( $form_args ); |
|
64 | + $reflection = new ReflectionClass($input_class); |
|
65 | + $form_args['subsections'][] = $reflection->newInstanceArgs($input_constructor_args); |
|
66 | + parent::__construct($form_args); |
|
67 | 67 | |
68 | 68 | } |
69 | 69 |
@@ -1,16 +1,16 @@ |
||
1 | 1 | <?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { exit('No direct script access allowed'); } |
2 | 2 | /** |
3 | - * |
|
4 | - * Class EE_Reg_Form_Question_Form |
|
5 | - * |
|
6 | - * For auto-generating form sections for an EE_Transaction |
|
7 | - * |
|
8 | - * @package Event Espresso |
|
9 | - * @subpackage core |
|
10 | - * @author Brent Christensen |
|
11 | - * @since 4.5.0 |
|
12 | - * |
|
13 | - */ |
|
3 | + * |
|
4 | + * Class EE_Reg_Form_Question_Form |
|
5 | + * |
|
6 | + * For auto-generating form sections for an EE_Transaction |
|
7 | + * |
|
8 | + * @package Event Espresso |
|
9 | + * @subpackage core |
|
10 | + * @author Brent Christensen |
|
11 | + * @since 4.5.0 |
|
12 | + * |
|
13 | + */ |
|
14 | 14 | |
15 | 15 | class EE_Reg_Form_Question_Form extends EE_Model_Form_Section { |
16 | 16 |
@@ -20,41 +20,41 @@ |
||
20 | 20 | * @param EE_Question $question |
21 | 21 | * @return EE_Reg_Form_Question_Form |
22 | 22 | */ |
23 | - public function __construct( EE_Registration $registration, EE_Question $question ){ |
|
23 | + public function __construct(EE_Registration $registration, EE_Question $question) { |
|
24 | 24 | |
25 | - if( $question instanceof EE_Question ){ |
|
25 | + if ($question instanceof EE_Question) { |
|
26 | 26 | // array of params to pass to parent constructor |
27 | 27 | $form_args = array( |
28 | 28 | 'name' => $registration->reg_url_link(), |
29 | 29 | 'subsections' => array(), |
30 | 30 | 'layout_strategy' => new EE_Div_Per_Section_Layout(), |
31 | - 'html_name' => '[' . $registration->reg_url_link() . ']', |
|
31 | + 'html_name' => '['.$registration->reg_url_link().']', |
|
32 | 32 | 'html_id' => $registration->reg_url_link(), |
33 | 33 | 'html_class' => 'ee-reg-page-questions' |
34 | 34 | ); |
35 | 35 | |
36 | 36 | // if this question was for an attendee detail, then check for that answer |
37 | - $answer_value = EEM_Answer::instance()->get_attendee_property_answer_value( $registration, $question->ID() ); |
|
38 | - $answer = $registration->reg_url_link() || ! $answer_value ? EEM_Answer::instance()->get_one( array( array( 'QST_ID'=>$question->ID(), 'REG_ID'=>$registration->ID() ))) : NULL; |
|
37 | + $answer_value = EEM_Answer::instance()->get_attendee_property_answer_value($registration, $question->ID()); |
|
38 | + $answer = $registration->reg_url_link() || ! $answer_value ? EEM_Answer::instance()->get_one(array(array('QST_ID'=>$question->ID(), 'REG_ID'=>$registration->ID()))) : NULL; |
|
39 | 39 | // if NOT returning to edit an existing registration OR if this question is for an attendee property OR we still don't have an EE_Answer object |
40 | - if( ! $registration->reg_url_link() || $answer_value || ! $answer instanceof EE_Answer ) { |
|
40 | + if ( ! $registration->reg_url_link() || $answer_value || ! $answer instanceof EE_Answer) { |
|
41 | 41 | // create an EE_Answer object for storing everything in |
42 | - $answer = EE_Answer::new_instance ( array( |
|
42 | + $answer = EE_Answer::new_instance(array( |
|
43 | 43 | 'QST_ID'=> $question->ID(), |
44 | 44 | 'REG_ID'=> $registration->ID() |
45 | 45 | )); |
46 | 46 | } |
47 | 47 | // verify instance |
48 | - if( $answer instanceof EE_Answer ){ |
|
49 | - if ( ! empty( $answer_value )) { |
|
50 | - $answer->set( 'ANS_value', $answer_value ); |
|
48 | + if ($answer instanceof EE_Answer) { |
|
49 | + if ( ! empty($answer_value)) { |
|
50 | + $answer->set('ANS_value', $answer_value); |
|
51 | 51 | } |
52 | - $answer->cache( 'Question', $question ); |
|
53 | - $answer_cache_id =$question->system_ID() != NULL ? $question->system_ID() . '-' . $registration->reg_url_link() : $question->ID() . '-' . $registration->reg_url_link(); |
|
54 | - $registration->cache( 'Answer', $answer, $answer_cache_id ); |
|
52 | + $answer->cache('Question', $question); |
|
53 | + $answer_cache_id = $question->system_ID() != NULL ? $question->system_ID().'-'.$registration->reg_url_link() : $question->ID().'-'.$registration->reg_url_link(); |
|
54 | + $registration->cache('Answer', $answer, $answer_cache_id); |
|
55 | 55 | } |
56 | - $form_args['subsections'][] = new EE_Question_Answer_Form_Section( $registration, $question, $answer ); |
|
57 | - parent::__construct( $form_args ); |
|
56 | + $form_args['subsections'][] = new EE_Question_Answer_Form_Section($registration, $question, $answer); |
|
57 | + parent::__construct($form_args); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 |
@@ -1,16 +1,16 @@ |
||
1 | 1 | <?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { exit('No direct script access allowed'); } |
2 | 2 | /** |
3 | - * |
|
4 | - * Class EE_Registration_Reg_Form |
|
5 | - * |
|
6 | - * For auto-generating form sections for an EE_Transaction |
|
7 | - * |
|
8 | - * @package Event Espresso |
|
9 | - * @subpackage core |
|
10 | - * @author Brent Christensen |
|
11 | - * @since 4.5.0 |
|
12 | - * |
|
13 | - */ |
|
3 | + * |
|
4 | + * Class EE_Registration_Reg_Form |
|
5 | + * |
|
6 | + * For auto-generating form sections for an EE_Transaction |
|
7 | + * |
|
8 | + * @package Event Espresso |
|
9 | + * @subpackage core |
|
10 | + * @author Brent Christensen |
|
11 | + * @since 4.5.0 |
|
12 | + * |
|
13 | + */ |
|
14 | 14 | |
15 | 15 | class EE_Registration_Reg_Form extends EE_Form_Section_Proper { |
16 | 16 |
@@ -20,35 +20,35 @@ |
||
20 | 20 | * @param EE_SPCO_Reg_Step $reg_step |
21 | 21 | * @return EE_Registration_Reg_Form |
22 | 22 | */ |
23 | - public function __construct( EE_Registration $registration, EE_SPCO_Reg_Step $reg_step ){ |
|
23 | + public function __construct(EE_Registration $registration, EE_SPCO_Reg_Step $reg_step) { |
|
24 | 24 | // array of params to pass to parent constructor |
25 | 25 | $form_args = array( |
26 | 26 | 'layout_strategy' => new EE_Div_Per_Section_Layout(), |
27 | 27 | 'subsections' => array(), |
28 | 28 | 'name' => $registration->reg_url_link(), |
29 | - 'html_id' => 'ee-registration-' . $registration->reg_url_link() |
|
29 | + 'html_id' => 'ee-registration-'.$registration->reg_url_link() |
|
30 | 30 | ); |
31 | 31 | |
32 | 32 | // verify that registration has valid event |
33 | - if ( $registration->event() instanceof EE_Event ) { |
|
33 | + if ($registration->event() instanceof EE_Event) { |
|
34 | 34 | $query_params = array( |
35 | 35 | array( |
36 | 36 | 'Event.EVT_ID' => $registration->event()->ID(), |
37 | 37 | 'Event_Question_Group.EQG_primary' => $registration->count() == 1 ? TRUE : FALSE |
38 | 38 | ), |
39 | - 'order_by'=>array( 'QSG_order'=>'ASC' ) |
|
39 | + 'order_by'=>array('QSG_order'=>'ASC') |
|
40 | 40 | ); |
41 | - $question_groups = $registration->event()->question_groups( $query_params ); |
|
42 | - if ( $question_groups ) { |
|
43 | - foreach ( $question_groups as $question_group ) { |
|
44 | - if ( $question_group instanceof EE_Question_Group ) { |
|
45 | - $form_args['subsections'][] = new EE_Registration_Question_Group_Reg_Form( $registration, $question_group ); |
|
41 | + $question_groups = $registration->event()->question_groups($query_params); |
|
42 | + if ($question_groups) { |
|
43 | + foreach ($question_groups as $question_group) { |
|
44 | + if ($question_group instanceof EE_Question_Group) { |
|
45 | + $form_args['subsections'][] = new EE_Registration_Question_Group_Reg_Form($registration, $question_group); |
|
46 | 46 | } |
47 | 47 | } |
48 | 48 | } |
49 | 49 | } |
50 | 50 | // d( $form_args ); |
51 | - parent::__construct( $form_args ); |
|
51 | + parent::__construct($form_args); |
|
52 | 52 | } |
53 | 53 | |
54 | 54 |
@@ -26,31 +26,31 @@ discard block |
||
26 | 26 | * @param EE_Form_Input_Base $input |
27 | 27 | * @return string |
28 | 28 | */ |
29 | - public function layout_input( $input ) { |
|
29 | + public function layout_input($input) { |
|
30 | 30 | $html = ''; |
31 | - if ( $input instanceof EE_Hidden_Input ) { |
|
32 | - $html .= EEH_HTML::nl() . $input->get_html_for_input(); |
|
33 | - } else if ( $input instanceof EE_Submit_Input ) { |
|
31 | + if ($input instanceof EE_Hidden_Input) { |
|
32 | + $html .= EEH_HTML::nl().$input->get_html_for_input(); |
|
33 | + } else if ($input instanceof EE_Submit_Input) { |
|
34 | 34 | $html .= EEH_HTML::br(); |
35 | 35 | $html .= $input->get_html_for_input(); |
36 | - } else if ( $input instanceof EE_Select_Input ) { |
|
36 | + } else if ($input instanceof EE_Select_Input) { |
|
37 | 37 | $html .= EEH_HTML::br(); |
38 | - $html .= EEH_HTML::nl(1) . $input->get_html_for_label(); |
|
39 | - $html .= EEH_HTML::nl() . $input->get_html_for_errors(); |
|
40 | - $html .= EEH_HTML::nl() . $input->get_html_for_input(); |
|
41 | - $html .= EEH_HTML::nl() . $input->get_html_for_help(); |
|
38 | + $html .= EEH_HTML::nl(1).$input->get_html_for_label(); |
|
39 | + $html .= EEH_HTML::nl().$input->get_html_for_errors(); |
|
40 | + $html .= EEH_HTML::nl().$input->get_html_for_input(); |
|
41 | + $html .= EEH_HTML::nl().$input->get_html_for_help(); |
|
42 | 42 | $html .= EEH_HTML::br(); |
43 | - } else if ( $input instanceof EE_Form_Input_With_Options_Base ) { |
|
43 | + } else if ($input instanceof EE_Form_Input_With_Options_Base) { |
|
44 | 44 | $html .= EEH_HTML::br(); |
45 | - $html .= EEH_HTML::nl() . $input->get_html_for_errors(); |
|
46 | - $html .= EEH_HTML::nl() . $input->get_html_for_input(); |
|
47 | - $html .= EEH_HTML::nl() . $input->get_html_for_help(); |
|
45 | + $html .= EEH_HTML::nl().$input->get_html_for_errors(); |
|
46 | + $html .= EEH_HTML::nl().$input->get_html_for_input(); |
|
47 | + $html .= EEH_HTML::nl().$input->get_html_for_help(); |
|
48 | 48 | } else { |
49 | 49 | $html .= EEH_HTML::br(); |
50 | - $html .= EEH_HTML::nl(1) . $input->get_html_for_label(); |
|
51 | - $html .= EEH_HTML::nl() . $input->get_html_for_errors(); |
|
52 | - $html .= EEH_HTML::nl() . $input->get_html_for_input(); |
|
53 | - $html .= EEH_HTML::nl() . $input->get_html_for_help(); |
|
50 | + $html .= EEH_HTML::nl(1).$input->get_html_for_label(); |
|
51 | + $html .= EEH_HTML::nl().$input->get_html_for_errors(); |
|
52 | + $html .= EEH_HTML::nl().$input->get_html_for_input(); |
|
53 | + $html .= EEH_HTML::nl().$input->get_html_for_help(); |
|
54 | 54 | } |
55 | 55 | return $html; |
56 | 56 | } |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | * closing div tag for a form |
59 | 59 | * @return string |
60 | 60 | */ |
61 | - public function layout_form_end(){ |
|
61 | + public function layout_form_end() { |
|
62 | 62 | return ''; |
63 | 63 | } |
64 | 64 | } |
65 | 65 | \ No newline at end of file |
@@ -1,16 +1,16 @@ discard block |
||
1 | 1 | <?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { exit('No direct script access allowed'); } |
2 | 2 | /** |
3 | - * |
|
4 | - * Class EE_SPCO_Reg_Step_Payment_Options |
|
5 | - * |
|
6 | - * Description |
|
7 | - * |
|
8 | - * @package Event Espresso |
|
9 | - * @subpackage core |
|
10 | - * @author Brent Christensen |
|
11 | - * @since 4.5.0 |
|
12 | - * |
|
13 | - */ |
|
3 | + * |
|
4 | + * Class EE_SPCO_Reg_Step_Payment_Options |
|
5 | + * |
|
6 | + * Description |
|
7 | + * |
|
8 | + * @package Event Espresso |
|
9 | + * @subpackage core |
|
10 | + * @author Brent Christensen |
|
11 | + * @since 4.5.0 |
|
12 | + * |
|
13 | + */ |
|
14 | 14 | class EE_SPCO_Reg_Step_Payment_Options extends EE_SPCO_Reg_Step { |
15 | 15 | |
16 | 16 | /** |
@@ -740,13 +740,13 @@ discard block |
||
740 | 740 | return FALSE; |
741 | 741 | } |
742 | 742 | if ( apply_filters( 'FHEE__EE_SPCO_Reg_Step_Payment_Options__registration_checkout__selected_payment_method__display_success', false ) ) { |
743 | - EE_Error::add_success( |
|
744 | - apply_filters( |
|
745 | - 'FHEE__Single_Page_Checkout__registration_checkout__selected_payment_method', |
|
746 | - sprintf(__('You have selected "%s" as your method of payment. Please note the important payment information below.', 'event_espresso'), $this->checkout->payment_method->name()) |
|
747 | - ) |
|
748 | - ); |
|
749 | - } |
|
743 | + EE_Error::add_success( |
|
744 | + apply_filters( |
|
745 | + 'FHEE__Single_Page_Checkout__registration_checkout__selected_payment_method', |
|
746 | + sprintf(__('You have selected "%s" as your method of payment. Please note the important payment information below.', 'event_espresso'), $this->checkout->payment_method->name()) |
|
747 | + ) |
|
748 | + ); |
|
749 | + } |
|
750 | 750 | // now generate billing form for selected method of payment |
751 | 751 | $payment_method_billing_form = $this->_get_billing_form_for_payment_method( $this->checkout->payment_method, FALSE ); |
752 | 752 | // fill form with attendee info if applicable |
@@ -778,14 +778,14 @@ discard block |
||
778 | 778 | $billing_form = $payment_method->type_obj()->billing_form( $this->checkout->transaction, array( 'amount_owing' => $this->checkout->amount_owing ) ); |
779 | 779 | if ( $billing_form instanceof EE_Billing_Info_Form ) { |
780 | 780 | if ( EE_Registry::instance()->REQ->is_set( 'payment_method' )) { |
781 | - if ( apply_filters('FHEE__EE_SPCO_Reg_Step_Payment_Options__registration_checkout__selected_payment_method__display_success', false )) { |
|
782 | - EE_Error::add_success( |
|
783 | - apply_filters( |
|
784 | - 'FHEE__Single_Page_Checkout__registration_checkout__selected_payment_method', |
|
785 | - sprintf( __( 'You have selected "%s" as your method of payment. Please note the important payment information below.', 'event_espresso' ), $payment_method->name() ) |
|
786 | - ) |
|
787 | - ); |
|
788 | - } |
|
781 | + if ( apply_filters('FHEE__EE_SPCO_Reg_Step_Payment_Options__registration_checkout__selected_payment_method__display_success', false )) { |
|
782 | + EE_Error::add_success( |
|
783 | + apply_filters( |
|
784 | + 'FHEE__Single_Page_Checkout__registration_checkout__selected_payment_method', |
|
785 | + sprintf( __( 'You have selected "%s" as your method of payment. Please note the important payment information below.', 'event_espresso' ), $payment_method->name() ) |
|
786 | + ) |
|
787 | + ); |
|
788 | + } |
|
789 | 789 | } |
790 | 790 | return apply_filters( |
791 | 791 | 'FHEE__EE_SPCO_Reg_Step_Payment_Options___get_billing_form_for_payment_method__billing_form', |
@@ -1214,9 +1214,9 @@ |
||
1214 | 1214 | $form_section = $validation_error->get_form_section(); |
1215 | 1215 | if( $form_section instanceof EE_Form_Input_Base ){ |
1216 | 1216 | $label = $form_section->html_label_text(); |
1217 | - }elseif( $form_section instanceof EE_Form_Section_Base ){ |
|
1217 | + } elseif( $form_section instanceof EE_Form_Section_Base ){ |
|
1218 | 1218 | $label = $form_section->name(); |
1219 | - }else{ |
|
1219 | + } else{ |
|
1220 | 1220 | $label = __( 'Validation Error', 'event_espresso' ); |
1221 | 1221 | } |
1222 | 1222 | $error_strings[] = sprintf('%1$s: %2$s', $label, $validation_error->getMessage() ); |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | |
127 | 127 | |
128 | 128 | /** |
129 | - * @return bool |
|
129 | + * @return EE_Form_Section_Proper |
|
130 | 130 | */ |
131 | 131 | public function generate_reg_form() { |
132 | 132 | EE_Registry::instance()->load_helper( 'HTML' ); |
@@ -591,7 +591,7 @@ discard block |
||
591 | 591 | * get_billing_form_html_for_payment_method |
592 | 592 | * |
593 | 593 | * @access public |
594 | - * @return string |
|
594 | + * @return boolean |
|
595 | 595 | */ |
596 | 596 | public function get_billing_form_html_for_payment_method() { |
597 | 597 | // how have they chosen to pay? |
@@ -712,7 +712,7 @@ discard block |
||
712 | 712 | |
713 | 713 | /** |
714 | 714 | * process_reg_step |
715 | - * @return boolean |
|
715 | + * @return null|boolean |
|
716 | 716 | */ |
717 | 717 | public function process_reg_step() { |
718 | 718 | // how have they chosen to pay? |
@@ -788,7 +788,7 @@ discard block |
||
788 | 788 | * update_reg_step |
789 | 789 | * this is the final step after a user revisits the site to retry a payment |
790 | 790 | * |
791 | - * @return boolean |
|
791 | + * @return null|boolean |
|
792 | 792 | */ |
793 | 793 | public function update_reg_step() { |
794 | 794 | $success = TRUE; |
@@ -1062,7 +1062,7 @@ discard block |
||
1062 | 1062 | * |
1063 | 1063 | * @access private |
1064 | 1064 | * @type EE_Payment_Method $payment_method |
1065 | - * @return mixed EE_Payment | boolean |
|
1065 | + * @return EE_Payment|null EE_Payment | boolean |
|
1066 | 1066 | */ |
1067 | 1067 | private function _attempt_payment( EE_Payment_Method $payment_method ) { |
1068 | 1068 | $payment =NULL; |
@@ -1154,7 +1154,7 @@ discard block |
||
1154 | 1154 | * or present the payment options again |
1155 | 1155 | * |
1156 | 1156 | * @access private |
1157 | - * @return EE_Payment | FALSE |
|
1157 | + * @return boolean | FALSE |
|
1158 | 1158 | */ |
1159 | 1159 | public function process_gateway_response() { |
1160 | 1160 | $payment = null; |
@@ -1212,7 +1212,7 @@ discard block |
||
1212 | 1212 | * _validate_return |
1213 | 1213 | * |
1214 | 1214 | * @access private |
1215 | - * @return bool |
|
1215 | + * @return boolean|null |
|
1216 | 1216 | */ |
1217 | 1217 | private function _validate_offsite_return() { |
1218 | 1218 | $TXN_ID = (int)EE_Registry::instance()->REQ->get( 'spco_txn', 0 ); |
@@ -1279,7 +1279,7 @@ discard block |
||
1279 | 1279 | * |
1280 | 1280 | * @access private |
1281 | 1281 | * @param \EE_Registration $primary_registrant |
1282 | - * @return bool |
|
1282 | + * @return false|null |
|
1283 | 1283 | */ |
1284 | 1284 | private function _redirect_wayward_request( EE_Registration $primary_registrant ) { |
1285 | 1285 | if ( ! $primary_registrant instanceof EE_Registration ) { |
@@ -1485,6 +1485,7 @@ discard block |
||
1485 | 1485 | * @access private |
1486 | 1486 | * @type EE_Payment $payment |
1487 | 1487 | * @param string $payment_occurs |
1488 | + * @param EE_Payment|null $payment |
|
1488 | 1489 | * @return bool |
1489 | 1490 | * @throws \EE_Error |
1490 | 1491 | */ |
@@ -23,11 +23,11 @@ discard block |
||
23 | 23 | * @return void |
24 | 24 | */ |
25 | 25 | public static function set_hooks() { |
26 | - add_action( 'wp_ajax_spco_billing_form', array( 'EE_SPCO_Reg_Step_Payment_Options', 'spco_billing_form' )); |
|
27 | - add_action( 'wp_ajax_nopriv_spco_billing_form', array( 'EE_SPCO_Reg_Step_Payment_Options', 'spco_billing_form' )); |
|
28 | - add_action( 'wp_ajax_get_transaction_details_for_gateways', array( 'EE_SPCO_Reg_Step_Payment_Options', 'get_transaction_details' ) ); |
|
29 | - add_action( 'wp_ajax_nopriv_get_transaction_details_for_gateways', array( 'EE_SPCO_Reg_Step_Payment_Options', 'get_transaction_details' ) ); |
|
30 | - add_filter( 'FHEE__EED_Recaptcha___bypass_recaptcha__bypass_request_params_array', array( 'EE_SPCO_Reg_Step_Payment_Options', 'bypass_recaptcha_for_load_payment_method' ), 10, 1 ); |
|
26 | + add_action('wp_ajax_spco_billing_form', array('EE_SPCO_Reg_Step_Payment_Options', 'spco_billing_form')); |
|
27 | + add_action('wp_ajax_nopriv_spco_billing_form', array('EE_SPCO_Reg_Step_Payment_Options', 'spco_billing_form')); |
|
28 | + add_action('wp_ajax_get_transaction_details_for_gateways', array('EE_SPCO_Reg_Step_Payment_Options', 'get_transaction_details')); |
|
29 | + add_action('wp_ajax_nopriv_get_transaction_details_for_gateways', array('EE_SPCO_Reg_Step_Payment_Options', 'get_transaction_details')); |
|
30 | + add_filter('FHEE__EED_Recaptcha___bypass_recaptcha__bypass_request_params_array', array('EE_SPCO_Reg_Step_Payment_Options', 'bypass_recaptcha_for_load_payment_method'), 10, 1); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | * ajax spco_billing_form |
38 | 38 | */ |
39 | 39 | public static function spco_billing_form() { |
40 | - EED_Single_Page_Checkout::process_ajax_request( 'get_billing_form_html_for_payment_method' ); |
|
40 | + EED_Single_Page_Checkout::process_ajax_request('get_billing_form_html_for_payment_method'); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | * ajax get_transaction_details |
48 | 48 | */ |
49 | 49 | public static function get_transaction_details() { |
50 | - EED_Single_Page_Checkout::process_ajax_request( 'get_transaction_details_for_gateways' ); |
|
50 | + EED_Single_Page_Checkout::process_ajax_request('get_transaction_details_for_gateways'); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | |
@@ -61,13 +61,13 @@ discard block |
||
61 | 61 | * @param EE_Checkout $checkout |
62 | 62 | * @return \EE_SPCO_Reg_Step_Payment_Options |
63 | 63 | */ |
64 | - public function __construct( EE_Checkout $checkout ) { |
|
64 | + public function __construct(EE_Checkout $checkout) { |
|
65 | 65 | $this->_slug = 'payment_options'; |
66 | 66 | $this->_name = __('Payment Options', 'event_espresso'); |
67 | - $this->_template = SPCO_TEMPLATES_PATH . 'payment_options_main.template.php'; |
|
67 | + $this->_template = SPCO_TEMPLATES_PATH.'payment_options_main.template.php'; |
|
68 | 68 | $this->checkout = $checkout; |
69 | 69 | $this->_reset_success_message(); |
70 | - $this->set_instructions( __('Please select a method of payment and provide any necessary billing information before proceeding.', 'event_espresso')); |
|
70 | + $this->set_instructions(__('Please select a method of payment and provide any necessary billing information before proceeding.', 'event_espresso')); |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | |
@@ -77,9 +77,9 @@ discard block |
||
77 | 77 | * @return void |
78 | 78 | */ |
79 | 79 | public function translate_js_strings() { |
80 | - EE_Registry::$i18n_js_strings['no_payment_method'] = __( 'Please select a method of payment in order to continue.', 'event_espresso' ); |
|
81 | - EE_Registry::$i18n_js_strings['invalid_payment_method'] = __( 'A valid method of payment could not be determined. Please refresh the page and try again.', 'event_espresso' ); |
|
82 | - EE_Registry::$i18n_js_strings['forwarding_to_offsite'] = __( 'Forwarding to Secure Payment Provider.', 'event_espresso' ); |
|
80 | + EE_Registry::$i18n_js_strings['no_payment_method'] = __('Please select a method of payment in order to continue.', 'event_espresso'); |
|
81 | + EE_Registry::$i18n_js_strings['invalid_payment_method'] = __('A valid method of payment could not be determined. Please refresh the page and try again.', 'event_espresso'); |
|
82 | + EE_Registry::$i18n_js_strings['forwarding_to_offsite'] = __('Forwarding to Secure Payment Provider.', 'event_espresso'); |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | |
@@ -108,19 +108,19 @@ discard block |
||
108 | 108 | // $ 0.00 transactions (no payment required) |
109 | 109 | ! $this->checkout->payment_required() |
110 | 110 | // but do NOT remove if current action being called belongs to this reg step |
111 | - && ! is_callable( array( $this, $this->checkout->action ) ) |
|
111 | + && ! is_callable(array($this, $this->checkout->action)) |
|
112 | 112 | ) { |
113 | 113 | // and if so, then we no longer need the Payment Options step |
114 | - $this->checkout->remove_reg_step( $this->_slug ); |
|
114 | + $this->checkout->remove_reg_step($this->_slug); |
|
115 | 115 | $this->checkout->reset_reg_steps(); |
116 | 116 | // DEBUG LOG |
117 | 117 | //$this->checkout->log( __CLASS__, __FUNCTION__, __LINE__ ); |
118 | 118 | return; |
119 | 119 | } |
120 | 120 | // load EEM_Payment_Method |
121 | - EE_Registry::instance()->load_model( 'Payment_Method' ); |
|
121 | + EE_Registry::instance()->load_model('Payment_Method'); |
|
122 | 122 | // get all active payment methods |
123 | - $this->checkout->available_payment_methods = EE_Registry::instance()->LIB->EEM_Payment_Method->get_all_for_transaction( $this->checkout->transaction, EEM_Payment_Method::scope_cart ); |
|
123 | + $this->checkout->available_payment_methods = EE_Registry::instance()->LIB->EEM_Payment_Method->get_all_for_transaction($this->checkout->transaction, EEM_Payment_Method::scope_cart); |
|
124 | 124 | } |
125 | 125 | |
126 | 126 | |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | * @return bool |
130 | 130 | */ |
131 | 131 | public function generate_reg_form() { |
132 | - EE_Registry::instance()->load_helper( 'HTML' ); |
|
132 | + EE_Registry::instance()->load_helper('HTML'); |
|
133 | 133 | // set some defaults |
134 | 134 | $this->checkout->selected_method_of_payment = 'payments_closed'; |
135 | 135 | $payment_required = array(); |
@@ -143,14 +143,14 @@ discard block |
||
143 | 143 | EEM_Registration::status_id_approved |
144 | 144 | ); |
145 | 145 | // loop thru registrations to gather info |
146 | - foreach ( $this->checkout->transaction->registrations( $this->checkout->reg_cache_where_params ) as $registration ) { |
|
146 | + foreach ($this->checkout->transaction->registrations($this->checkout->reg_cache_where_params) as $registration) { |
|
147 | 147 | /** @var $registration EE_Registration */ |
148 | 148 | $reg_count++; |
149 | 149 | // if returning registrant is Approved then do NOT do this |
150 | - if ( ! ( $this->checkout->revisit && $registration->status_ID() == EEM_Registration::status_id_approved )) { |
|
151 | - if ( $registration->event()->is_sold_out() || $registration->event()->is_sold_out( true )) { |
|
150 | + if ( ! ($this->checkout->revisit && $registration->status_ID() == EEM_Registration::status_id_approved)) { |
|
151 | + if ($registration->event()->is_sold_out() || $registration->event()->is_sold_out(true)) { |
|
152 | 152 | // add event to list of events that are sold out |
153 | - $sold_out_events[ $registration->event()->ID() ] = $registration->event(); |
|
153 | + $sold_out_events[$registration->event()->ID()] = $registration->event(); |
|
154 | 154 | do_action( |
155 | 155 | 'AHEE__EE_SPCO_Reg_Step_Payment_Options__generate_reg_form__sold_out_event', |
156 | 156 | $registration->event(), |
@@ -158,9 +158,9 @@ discard block |
||
158 | 158 | ); |
159 | 159 | } |
160 | 160 | // event requires admin approval |
161 | - if ( $registration->status_ID() == EEM_Registration::status_id_not_approved ) { |
|
161 | + if ($registration->status_ID() == EEM_Registration::status_id_not_approved) { |
|
162 | 162 | // add event to list of events with pre-approval reg status |
163 | - $events_requiring_pre_approval[ $registration->event()->ID() ] = $registration->event(); |
|
163 | + $events_requiring_pre_approval[$registration->event()->ID()] = $registration->event(); |
|
164 | 164 | do_action( |
165 | 165 | 'AHEE__EE_SPCO_Reg_Step_Payment_Options__generate_reg_form__event_requires_pre_approval', |
166 | 166 | $registration->event(), |
@@ -168,29 +168,29 @@ discard block |
||
168 | 168 | ); |
169 | 169 | } |
170 | 170 | } |
171 | - if ( in_array( $registration->status_ID(), $requires_payment ) && ! $registration->ticket()->is_free() ) { |
|
172 | - $payment_required[ $registration->event()->ID() ] = $registration->event(); |
|
171 | + if (in_array($registration->status_ID(), $requires_payment) && ! $registration->ticket()->is_free()) { |
|
172 | + $payment_required[$registration->event()->ID()] = $registration->event(); |
|
173 | 173 | do_action( |
174 | 174 | 'AHEE__EE_SPCO_Reg_Step_Payment_Options__generate_reg_form__event_requires_payment', |
175 | 175 | $registration->event(), |
176 | 176 | $this |
177 | 177 | ); |
178 | - } else if ( $registration->status_ID() != EEM_Registration::status_id_not_approved ) { |
|
179 | - $registrations_for_free_events[ $registration->event()->ID() ] = $registration; |
|
178 | + } else if ($registration->status_ID() != EEM_Registration::status_id_not_approved) { |
|
179 | + $registrations_for_free_events[$registration->event()->ID()] = $registration; |
|
180 | 180 | } |
181 | 181 | } |
182 | 182 | $subsections = array(); |
183 | 183 | // now decide which template to load |
184 | - if ( ! empty( $sold_out_events )) { |
|
185 | - $subsections['events_requiring_pre_approval'] = $this->_sold_out_events( $sold_out_events ); |
|
184 | + if ( ! empty($sold_out_events)) { |
|
185 | + $subsections['events_requiring_pre_approval'] = $this->_sold_out_events($sold_out_events); |
|
186 | 186 | } |
187 | - if ( ! empty( $events_requiring_pre_approval )) { |
|
188 | - $subsections['events_requiring_pre_approval'] = $this->_events_requiring_pre_approval( $events_requiring_pre_approval ); |
|
187 | + if ( ! empty($events_requiring_pre_approval)) { |
|
188 | + $subsections['events_requiring_pre_approval'] = $this->_events_requiring_pre_approval($events_requiring_pre_approval); |
|
189 | 189 | } |
190 | - if ( ! empty( $payment_required )) { |
|
191 | - $subsections[ 'payment_options' ] = $this->_display_payment_options( $reg_count ); |
|
190 | + if ( ! empty($payment_required)) { |
|
191 | + $subsections['payment_options'] = $this->_display_payment_options($reg_count); |
|
192 | 192 | } else { |
193 | - $subsections[ 'no_payment_required' ] = $this->_no_payment_required( $registrations_for_free_events ); |
|
193 | + $subsections['no_payment_required'] = $this->_no_payment_required($registrations_for_free_events); |
|
194 | 194 | } |
195 | 195 | return new EE_Form_Section_Proper( |
196 | 196 | array( |
@@ -210,13 +210,13 @@ discard block |
||
210 | 210 | * @param \EE_Event[] $sold_out_events_array |
211 | 211 | * @return \EE_Form_Section_Proper |
212 | 212 | */ |
213 | - private function _sold_out_events( $sold_out_events_array = array() ) { |
|
213 | + private function _sold_out_events($sold_out_events_array = array()) { |
|
214 | 214 | // set some defaults |
215 | 215 | $this->checkout->selected_method_of_payment = 'events_sold_out'; |
216 | 216 | |
217 | 217 | $sold_out_events = ''; |
218 | - foreach ( $sold_out_events_array as $sold_out_event ) { |
|
219 | - $sold_out_events .= EEH_HTML::li( EEH_HTML::span( $sold_out_event->name(), '', 'dashicons dashicons-marker ee-icon-size-16 pink-text' )); |
|
218 | + foreach ($sold_out_events_array as $sold_out_event) { |
|
219 | + $sold_out_events .= EEH_HTML::li(EEH_HTML::span($sold_out_event->name(), '', 'dashicons dashicons-marker ee-icon-size-16 pink-text')); |
|
220 | 220 | } |
221 | 221 | return new EE_Form_Section_Proper( |
222 | 222 | array( |
@@ -228,14 +228,14 @@ discard block |
||
228 | 228 | ), |
229 | 229 | 'layout_strategy' => new EE_Template_Layout( |
230 | 230 | array( |
231 | - 'layout_template_file' => SPCO_TEMPLATES_PATH . $this->slug() . DS . 'sold_out_events.template.php', // layout_template |
|
231 | + 'layout_template_file' => SPCO_TEMPLATES_PATH.$this->slug().DS.'sold_out_events.template.php', // layout_template |
|
232 | 232 | 'template_args' => apply_filters( |
233 | 233 | 'FHEE__EE_SPCO_Reg_Step_Payment_Options___sold_out_events__template_args', |
234 | 234 | array( |
235 | 235 | 'sold_out_events' => $sold_out_events, |
236 | 236 | 'sold_out_events_msg' => apply_filters( |
237 | 237 | 'FHEE__EE_SPCO_Reg_Step_Payment_Options___sold_out_events__sold_out_events_msg', |
238 | - __( 'It appears that the event you were about to make a payment for has sold out since you first registered. If you have already made a partial payment towards this event, please contact the event administrator for a refund.', 'event_espresso' ) |
|
238 | + __('It appears that the event you were about to make a payment for has sold out since you first registered. If you have already made a partial payment towards this event, please contact the event administrator for a refund.', 'event_espresso') |
|
239 | 239 | ) |
240 | 240 | ) |
241 | 241 | ) |
@@ -252,13 +252,13 @@ discard block |
||
252 | 252 | * @param \EE_Event[] $events_requiring_pre_approval_array |
253 | 253 | * @return \EE_Form_Section_Proper |
254 | 254 | */ |
255 | - private function _events_requiring_pre_approval( $events_requiring_pre_approval_array = array()) { |
|
255 | + private function _events_requiring_pre_approval($events_requiring_pre_approval_array = array()) { |
|
256 | 256 | |
257 | 257 | $events_requiring_pre_approval = ''; |
258 | - foreach ( $events_requiring_pre_approval_array as $event_requiring_pre_approval ) { |
|
258 | + foreach ($events_requiring_pre_approval_array as $event_requiring_pre_approval) { |
|
259 | 259 | $events_requiring_pre_approval .= EEH_HTML::li( |
260 | 260 | EEH_HTML::span( |
261 | - EEH_HTML::nbsp(1) . $event_requiring_pre_approval->name(), |
|
261 | + EEH_HTML::nbsp(1).$event_requiring_pre_approval->name(), |
|
262 | 262 | '', 'dashicons dashicons-marker ee-icon-size-16 orange-text' |
263 | 263 | ) |
264 | 264 | ); |
@@ -273,14 +273,14 @@ discard block |
||
273 | 273 | ), |
274 | 274 | 'layout_strategy' => new EE_Template_Layout( |
275 | 275 | array( |
276 | - 'layout_template_file' => SPCO_TEMPLATES_PATH . $this->slug() . DS . 'events_requiring_pre_approval.template.php', // layout_template |
|
276 | + 'layout_template_file' => SPCO_TEMPLATES_PATH.$this->slug().DS.'events_requiring_pre_approval.template.php', // layout_template |
|
277 | 277 | 'template_args' => apply_filters( |
278 | 278 | 'FHEE__EE_SPCO_Reg_Step_Payment_Options___sold_out_events__template_args', |
279 | 279 | array( |
280 | 280 | 'events_requiring_pre_approval' => $events_requiring_pre_approval, |
281 | 281 | 'events_requiring_pre_approval_msg' => apply_filters( |
282 | 282 | 'FHEE__EE_SPCO_Reg_Step_Payment_Options___events_requiring_pre_approval__events_requiring_pre_approval_msg', |
283 | - __( 'The following events do not require payment at this time and will not be billed during this transaction. Billing will only occur after the attendee has 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.', 'event_espresso' ) |
|
283 | + __('The following events do not require payment at this time and will not be billed during this transaction. Billing will only occur after the attendee has 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.', 'event_espresso') |
|
284 | 284 | ) |
285 | 285 | ) |
286 | 286 | ), |
@@ -298,7 +298,7 @@ discard block |
||
298 | 298 | * @param \EE_Event[] $registrations_for_free_events |
299 | 299 | * @return \EE_Form_Section_Proper |
300 | 300 | */ |
301 | - private function _no_payment_required( $registrations_for_free_events = array() ) { |
|
301 | + private function _no_payment_required($registrations_for_free_events = array()) { |
|
302 | 302 | // set some defaults |
303 | 303 | $this->checkout->selected_method_of_payment = 'no_payment_required'; |
304 | 304 | // generate no_payment_required form |
@@ -310,7 +310,7 @@ discard block |
||
310 | 310 | ), |
311 | 311 | 'layout_strategy' => new EE_Template_Layout( |
312 | 312 | array( |
313 | - 'layout_template_file' => SPCO_TEMPLATES_PATH . $this->slug() . DS . 'no_payment_required.template.php', // layout_template |
|
313 | + 'layout_template_file' => SPCO_TEMPLATES_PATH.$this->slug().DS.'no_payment_required.template.php', // layout_template |
|
314 | 314 | 'template_args' => apply_filters( |
315 | 315 | 'FHEE__EE_SPCO_Reg_Step_Payment_Options___no_payment_required__template_args', |
316 | 316 | array( |
@@ -318,7 +318,7 @@ discard block |
||
318 | 318 | 'registrations' => array(), |
319 | 319 | 'ticket_count' => array(), |
320 | 320 | 'registrations_for_free_events' => $registrations_for_free_events, |
321 | - 'no_payment_required_msg' => EEH_HTML::p( __( 'This is a free event, so no billing will occur.', 'event_espresso' )) |
|
321 | + 'no_payment_required_msg' => EEH_HTML::p(__('This is a free event, so no billing will occur.', 'event_espresso')) |
|
322 | 322 | ) |
323 | 323 | ), |
324 | 324 | ) |
@@ -334,14 +334,14 @@ discard block |
||
334 | 334 | * @param int $reg_count |
335 | 335 | * @return \EE_Form_Section_Proper |
336 | 336 | */ |
337 | - private function _display_payment_options( $reg_count = 0 ) { |
|
337 | + private function _display_payment_options($reg_count = 0) { |
|
338 | 338 | // reset in case someone changes their mind |
339 | 339 | $this->_reset_selected_method_of_payment(); |
340 | 340 | // has method_of_payment been set by no-js user? |
341 | 341 | $this->checkout->selected_method_of_payment = $this->_get_selected_method_of_payment(); |
342 | 342 | // autoload Line_Item_Display classes |
343 | 343 | EEH_Autoloader::register_line_item_display_autoloaders(); |
344 | - $Line_Item_Display = new EE_Line_Item_Display( 'spco' ); |
|
344 | + $Line_Item_Display = new EE_Line_Item_Display('spco'); |
|
345 | 345 | // build payment options form |
346 | 346 | return new EE_Form_Section_Proper( |
347 | 347 | array( |
@@ -350,15 +350,15 @@ discard block |
||
350 | 350 | 'subsections' => array( |
351 | 351 | 'payment_options' => $this->_setup_payment_options(), |
352 | 352 | 'default_hidden_inputs' => $this->reg_step_hidden_inputs(), |
353 | - 'extra_hidden_inputs' => $this->_extra_hidden_inputs( FALSE ) |
|
353 | + 'extra_hidden_inputs' => $this->_extra_hidden_inputs(FALSE) |
|
354 | 354 | ), |
355 | - 'layout_strategy' => new EE_Template_Layout( array( |
|
356 | - 'layout_template_file' => SPCO_TEMPLATES_PATH . $this->slug() . DS . 'payment_options_main.template.php', // layout_template |
|
355 | + 'layout_strategy' => new EE_Template_Layout(array( |
|
356 | + 'layout_template_file' => SPCO_TEMPLATES_PATH.$this->slug().DS.'payment_options_main.template.php', // layout_template |
|
357 | 357 | 'template_args' => apply_filters( |
358 | 358 | 'FHEE__EE_SPCO_Reg_Step_Payment_Options___payment_options__template_args', |
359 | 359 | array( |
360 | 360 | 'reg_count' => $reg_count, |
361 | - 'transaction_details' => $Line_Item_Display->display_line_item( $this->checkout->cart->get_grand_total() ), |
|
361 | + 'transaction_details' => $Line_Item_Display->display_line_item($this->checkout->cart->get_grand_total()), |
|
362 | 362 | 'available_payment_methods' => array() |
363 | 363 | ) |
364 | 364 | ), |
@@ -375,11 +375,11 @@ discard block |
||
375 | 375 | * @param bool $no_payment_required |
376 | 376 | * @return \EE_Form_Section_Proper |
377 | 377 | */ |
378 | - private function _extra_hidden_inputs( $no_payment_required = TRUE ) { |
|
378 | + private function _extra_hidden_inputs($no_payment_required = TRUE) { |
|
379 | 379 | |
380 | 380 | return new EE_Form_Section_Proper( |
381 | 381 | array( |
382 | - 'html_id' => 'ee-' . $this->slug() . '-hidden-inputs', |
|
382 | + 'html_id' => 'ee-'.$this->slug().'-hidden-inputs', |
|
383 | 383 | 'layout_strategy' => new EE_Div_Per_Section_Layout(), |
384 | 384 | 'subsections' => array( |
385 | 385 | 'selected_method_of_payment_input' => new EE_Hidden_Input( |
@@ -413,9 +413,9 @@ discard block |
||
413 | 413 | * @param bool $force_reset |
414 | 414 | * @return void |
415 | 415 | */ |
416 | - private function _reset_selected_method_of_payment( $force_reset = FALSE ) { |
|
417 | - $reset_payment_method = $force_reset ? TRUE : sanitize_text_field( EE_Registry::instance()->REQ->get( 'reset_payment_method', FALSE )); |
|
418 | - if ( $reset_payment_method ) { |
|
416 | + private function _reset_selected_method_of_payment($force_reset = FALSE) { |
|
417 | + $reset_payment_method = $force_reset ? TRUE : sanitize_text_field(EE_Registry::instance()->REQ->get('reset_payment_method', FALSE)); |
|
418 | + if ($reset_payment_method) { |
|
419 | 419 | $this->checkout->selected_method_of_payment = NULL; |
420 | 420 | $this->_save_selected_method_of_payment(); |
421 | 421 | } |
@@ -432,9 +432,9 @@ discard block |
||
432 | 432 | * @param string $selected_method_of_payment |
433 | 433 | * @return EE_Billing_Info_Form |
434 | 434 | */ |
435 | - private function _save_selected_method_of_payment( $selected_method_of_payment = '' ) { |
|
436 | - $selected_method_of_payment = ! empty( $selected_method_of_payment ) ? $selected_method_of_payment : $this->checkout->selected_method_of_payment; |
|
437 | - EE_Registry::instance()->SSN->set_session_data( array( 'selected_method_of_payment' => $selected_method_of_payment )); |
|
435 | + private function _save_selected_method_of_payment($selected_method_of_payment = '') { |
|
436 | + $selected_method_of_payment = ! empty($selected_method_of_payment) ? $selected_method_of_payment : $this->checkout->selected_method_of_payment; |
|
437 | + EE_Registry::instance()->SSN->set_session_data(array('selected_method_of_payment' => $selected_method_of_payment)); |
|
438 | 438 | } |
439 | 439 | |
440 | 440 | |
@@ -445,41 +445,41 @@ discard block |
||
445 | 445 | */ |
446 | 446 | public function _setup_payment_options() { |
447 | 447 | // switch up header depending on number of available payment methods |
448 | - $payment_method_header = count( $this->checkout->available_payment_methods ) > 1 |
|
449 | - ? apply_filters( 'FHEE__registration_page_payment_options__method_of_payment_hdr', __( 'Please Select Your Method of Payment', 'event_espresso' )) |
|
450 | - : apply_filters( 'FHEE__registration_page_payment_options__method_of_payment_hdr', __( 'Method of Payment', 'event_espresso' )); |
|
448 | + $payment_method_header = count($this->checkout->available_payment_methods) > 1 |
|
449 | + ? apply_filters('FHEE__registration_page_payment_options__method_of_payment_hdr', __('Please Select Your Method of Payment', 'event_espresso')) |
|
450 | + : apply_filters('FHEE__registration_page_payment_options__method_of_payment_hdr', __('Method of Payment', 'event_espresso')); |
|
451 | 451 | $available_payment_methods = array( |
452 | 452 | // display the "Payment Method" header |
453 | 453 | 'payment_method_header' => new EE_Form_Section_HTML( |
454 | - EEH_HTML::h4 ( $payment_method_header, 'method-of-payment-hdr' ) |
|
454 | + EEH_HTML::h4($payment_method_header, 'method-of-payment-hdr') |
|
455 | 455 | ) |
456 | 456 | ); |
457 | 457 | // the list of actual payment methods ( invoice, paypal, etc ) in a ( slug => HTML ) format |
458 | 458 | $available_payment_method_options = array(); |
459 | 459 | $default_payment_method_option = array(); |
460 | 460 | // additional instructions to be displayed and hidden below payment methods (adding a clearing div to start) |
461 | - $payment_methods_billing_info = array( new EE_Form_Section_HTML( EEH_HTML::div ( '<br />', '', '', 'clear:both;' ))); |
|
461 | + $payment_methods_billing_info = array(new EE_Form_Section_HTML(EEH_HTML::div('<br />', '', '', 'clear:both;'))); |
|
462 | 462 | // loop through payment methods |
463 | - foreach( $this->checkout->available_payment_methods as $payment_method ) { |
|
464 | - if ( $payment_method instanceof EE_Payment_Method ) { |
|
463 | + foreach ($this->checkout->available_payment_methods as $payment_method) { |
|
464 | + if ($payment_method instanceof EE_Payment_Method) { |
|
465 | 465 | |
466 | - $payment_method_button = EEH_HTML::img( $payment_method->button_url(), $payment_method->name(), 'spco-payment-method-' . $payment_method->slug() . '-btn-img', 'spco-payment-method-btn-img' ); |
|
466 | + $payment_method_button = EEH_HTML::img($payment_method->button_url(), $payment_method->name(), 'spco-payment-method-'.$payment_method->slug().'-btn-img', 'spco-payment-method-btn-img'); |
|
467 | 467 | // check if any payment methods are set as default |
468 | 468 | // if payment method is already selected OR nothing is selected and this payment method should be open_by_default |
469 | - if (( $this->checkout->selected_method_of_payment == $payment_method->slug() ) || ( ! $this->checkout->selected_method_of_payment && $payment_method->open_by_default() )) { |
|
469 | + if (($this->checkout->selected_method_of_payment == $payment_method->slug()) || ( ! $this->checkout->selected_method_of_payment && $payment_method->open_by_default())) { |
|
470 | 470 | $this->checkout->selected_method_of_payment = $payment_method->slug(); |
471 | 471 | $this->_save_selected_method_of_payment(); |
472 | - $default_payment_method_option[ $payment_method->slug() ] = $payment_method_button; |
|
472 | + $default_payment_method_option[$payment_method->slug()] = $payment_method_button; |
|
473 | 473 | } else { |
474 | - $available_payment_method_options[ $payment_method->slug() ] = $payment_method_button; |
|
474 | + $available_payment_method_options[$payment_method->slug()] = $payment_method_button; |
|
475 | 475 | } |
476 | - $payment_methods_billing_info[ $payment_method->slug() . '-info' ] = $this->_payment_method_billing_info( $payment_method ); |
|
476 | + $payment_methods_billing_info[$payment_method->slug().'-info'] = $this->_payment_method_billing_info($payment_method); |
|
477 | 477 | } |
478 | 478 | } |
479 | 479 | // prepend available_payment_method_options with default_payment_method_option so that it appears first in list of PMs |
480 | 480 | $available_payment_method_options = $default_payment_method_option + $available_payment_method_options; |
481 | 481 | // now generate the actual form inputs |
482 | - $available_payment_methods['available_payment_methods'] = $this->_available_payment_method_inputs( $available_payment_method_options ); |
|
482 | + $available_payment_methods['available_payment_methods'] = $this->_available_payment_method_inputs($available_payment_method_options); |
|
483 | 483 | $available_payment_methods = $available_payment_methods + $payment_methods_billing_info; |
484 | 484 | |
485 | 485 | // build the available payment methods form |
@@ -502,14 +502,14 @@ discard block |
||
502 | 502 | * @param array $available_payment_method_options |
503 | 503 | * @return \EE_Form_Section_Proper |
504 | 504 | */ |
505 | - private function _available_payment_method_inputs( $available_payment_method_options = array() ) { |
|
505 | + private function _available_payment_method_inputs($available_payment_method_options = array()) { |
|
506 | 506 | // generate inputs |
507 | 507 | return new EE_Form_Section_Proper( |
508 | 508 | array( |
509 | 509 | 'html_id' => 'ee-available-payment-method-inputs', |
510 | 510 | 'layout_strategy' => new EE_Div_Per_Section_Layout(), |
511 | 511 | 'subsections' => array( |
512 | - '' => new EE_Radio_Button_Input ( |
|
512 | + '' => new EE_Radio_Button_Input( |
|
513 | 513 | $available_payment_method_options, |
514 | 514 | array( |
515 | 515 | 'html_name' => 'selected_method_of_payment', |
@@ -533,35 +533,35 @@ discard block |
||
533 | 533 | * @param EE_Payment_Method $payment_method |
534 | 534 | * @return \EE_Form_Section_Proper |
535 | 535 | */ |
536 | - private function _payment_method_billing_info( EE_Payment_Method $payment_method ) { |
|
536 | + private function _payment_method_billing_info(EE_Payment_Method $payment_method) { |
|
537 | 537 | $currently_selected = $this->checkout->selected_method_of_payment == $payment_method->slug() ? TRUE : FALSE; |
538 | 538 | // generate the billing form for payment method |
539 | - $billing_form = $this->_get_billing_form_for_payment_method( $payment_method, $currently_selected ); |
|
539 | + $billing_form = $this->_get_billing_form_for_payment_method($payment_method, $currently_selected); |
|
540 | 540 | // it's all in the details |
541 | - $info_html = EEH_HTML::h3 ( __( 'Important information regarding your payment', 'event_espresso' ), '', 'spco-payment-method-hdr' ); |
|
541 | + $info_html = EEH_HTML::h3(__('Important information regarding your payment', 'event_espresso'), '', 'spco-payment-method-hdr'); |
|
542 | 542 | // add some info regarding the step, either from what's saved in the admin, or a default string depending on whether the PM has a billing form or not |
543 | - if ( $payment_method->description() ) { |
|
543 | + if ($payment_method->description()) { |
|
544 | 544 | $payment_method_info = $payment_method->description(); |
545 | - } elseif ( $billing_form instanceof EE_Billing_Info_Form ) { |
|
546 | - $payment_method_info = sprintf( __( 'Please provide the following billing information, then click the "%1$s" button below in order to proceed.', 'event_espresso' ), $this->submit_button_text() ); |
|
545 | + } elseif ($billing_form instanceof EE_Billing_Info_Form) { |
|
546 | + $payment_method_info = sprintf(__('Please provide the following billing information, then click the "%1$s" button below in order to proceed.', 'event_espresso'), $this->submit_button_text()); |
|
547 | 547 | } else { |
548 | - $payment_method_info = sprintf( __( 'Please click the "%1$s" button below in order to proceed.', 'event_espresso' ), $this->submit_button_text() ); |
|
548 | + $payment_method_info = sprintf(__('Please click the "%1$s" button below in order to proceed.', 'event_espresso'), $this->submit_button_text()); |
|
549 | 549 | } |
550 | - $info_html .= EEH_HTML::p ( |
|
551 | - apply_filters( 'FHEE__EE_SPCO_Reg_Step_Payment_Options___payment_method_billing_info__payment_method_info', $payment_method_info ), |
|
550 | + $info_html .= EEH_HTML::p( |
|
551 | + apply_filters('FHEE__EE_SPCO_Reg_Step_Payment_Options___payment_method_billing_info__payment_method_info', $payment_method_info), |
|
552 | 552 | '', |
553 | 553 | 'spco-payment-method-desc ee-attention' |
554 | 554 | ); |
555 | 555 | |
556 | 556 | return new EE_Form_Section_Proper( |
557 | 557 | array( |
558 | - 'html_id' => 'spco-payment-method-info-' . $payment_method->slug(), |
|
558 | + 'html_id' => 'spco-payment-method-info-'.$payment_method->slug(), |
|
559 | 559 | 'html_class' => 'spco-payment-method-info-dv', |
560 | 560 | // only display the selected or default PM |
561 | 561 | 'html_style' => $this->checkout->selected_method_of_payment == $payment_method->slug() ? '' : 'display:none;', |
562 | 562 | 'layout_strategy' => new EE_Div_Per_Section_Layout(), |
563 | 563 | 'subsections' => array( |
564 | - 'info' => new EE_Form_Section_HTML( $info_html ), |
|
564 | + 'info' => new EE_Form_Section_HTML($info_html), |
|
565 | 565 | 'billing_form' => $this->checkout->selected_method_of_payment == $payment_method->slug() ? $billing_form : new EE_Form_Section_HTML() |
566 | 566 | ) |
567 | 567 | ) |
@@ -595,12 +595,12 @@ discard block |
||
595 | 595 | */ |
596 | 596 | public function get_billing_form_html_for_payment_method() { |
597 | 597 | // how have they chosen to pay? |
598 | - $this->checkout->selected_method_of_payment = $this->_get_selected_method_of_payment( TRUE ); |
|
598 | + $this->checkout->selected_method_of_payment = $this->_get_selected_method_of_payment(TRUE); |
|
599 | 599 | $this->checkout->payment_method = $this->_get_payment_method_for_selected_method_of_payment(); |
600 | - if ( ! $this->checkout->payment_method instanceof EE_Payment_Method ) { |
|
600 | + if ( ! $this->checkout->payment_method instanceof EE_Payment_Method) { |
|
601 | 601 | return FALSE; |
602 | 602 | } |
603 | - if ( apply_filters( 'FHEE__EE_SPCO_Reg_Step_Payment_Options__registration_checkout__selected_payment_method__display_success', false ) ) { |
|
603 | + if (apply_filters('FHEE__EE_SPCO_Reg_Step_Payment_Options__registration_checkout__selected_payment_method__display_success', false)) { |
|
604 | 604 | EE_Error::add_success( |
605 | 605 | apply_filters( |
606 | 606 | 'FHEE__Single_Page_Checkout__registration_checkout__selected_payment_method', |
@@ -609,20 +609,20 @@ discard block |
||
609 | 609 | ); |
610 | 610 | } |
611 | 611 | // now generate billing form for selected method of payment |
612 | - $payment_method_billing_form = $this->_get_billing_form_for_payment_method( $this->checkout->payment_method, FALSE ); |
|
612 | + $payment_method_billing_form = $this->_get_billing_form_for_payment_method($this->checkout->payment_method, FALSE); |
|
613 | 613 | // fill form with attendee info if applicable |
614 | - if ( $payment_method_billing_form instanceof EE_Billing_Attendee_Info_Form && $this->checkout->transaction_has_primary_registrant() ) { |
|
615 | - $payment_method_billing_form->populate_from_attendee( $this->checkout->transaction->primary_registration()->attendee() ); |
|
614 | + if ($payment_method_billing_form instanceof EE_Billing_Attendee_Info_Form && $this->checkout->transaction_has_primary_registrant()) { |
|
615 | + $payment_method_billing_form->populate_from_attendee($this->checkout->transaction->primary_registration()->attendee()); |
|
616 | 616 | } |
617 | 617 | // and debug content |
618 | - if ( $payment_method_billing_form instanceof EE_Billing_Info_Form && $this->checkout->payment_method->type_obj() instanceof EE_PMT_Base ) { |
|
619 | - $payment_method_billing_form = $this->checkout->payment_method->type_obj()->apply_billing_form_debug_settings( $payment_method_billing_form ); |
|
618 | + if ($payment_method_billing_form instanceof EE_Billing_Info_Form && $this->checkout->payment_method->type_obj() instanceof EE_PMT_Base) { |
|
619 | + $payment_method_billing_form = $this->checkout->payment_method->type_obj()->apply_billing_form_debug_settings($payment_method_billing_form); |
|
620 | 620 | } |
621 | 621 | $billing_info = $payment_method_billing_form instanceof EE_Form_Section_Proper ? $payment_method_billing_form->get_html() : ''; |
622 | - $this->checkout->json_response->set_return_data( array( 'payment_method_info' => $billing_info )); |
|
622 | + $this->checkout->json_response->set_return_data(array('payment_method_info' => $billing_info)); |
|
623 | 623 | // localize validation rules for main form |
624 | 624 | $this->checkout->current_step->reg_form->localize_validation_rules(); |
625 | - $this->checkout->json_response->add_validation_rules( EE_Form_Section_Proper::js_localization() ); |
|
625 | + $this->checkout->json_response->add_validation_rules(EE_Form_Section_Proper::js_localization()); |
|
626 | 626 | return TRUE; |
627 | 627 | } |
628 | 628 | |
@@ -635,15 +635,15 @@ discard block |
||
635 | 635 | * @param EE_Payment_Method $payment_method |
636 | 636 | * @return \EE_Billing_Info_Form |
637 | 637 | */ |
638 | - private function _get_billing_form_for_payment_method( EE_Payment_Method $payment_method ) { |
|
639 | - $billing_form = $payment_method->type_obj()->billing_form( $this->checkout->transaction ); |
|
640 | - if ( $billing_form instanceof EE_Billing_Info_Form ) { |
|
641 | - if ( EE_Registry::instance()->REQ->is_set( 'payment_method' )) { |
|
642 | - if ( apply_filters('FHEE__EE_SPCO_Reg_Step_Payment_Options__registration_checkout__selected_payment_method__display_success', false )) { |
|
638 | + private function _get_billing_form_for_payment_method(EE_Payment_Method $payment_method) { |
|
639 | + $billing_form = $payment_method->type_obj()->billing_form($this->checkout->transaction); |
|
640 | + if ($billing_form instanceof EE_Billing_Info_Form) { |
|
641 | + if (EE_Registry::instance()->REQ->is_set('payment_method')) { |
|
642 | + if (apply_filters('FHEE__EE_SPCO_Reg_Step_Payment_Options__registration_checkout__selected_payment_method__display_success', false)) { |
|
643 | 643 | EE_Error::add_success( |
644 | 644 | apply_filters( |
645 | 645 | 'FHEE__Single_Page_Checkout__registration_checkout__selected_payment_method', |
646 | - sprintf( __( 'You have selected "%s" as your method of payment. Please note the important payment information below.', 'event_espresso' ), $payment_method->name() ) |
|
646 | + sprintf(__('You have selected "%s" as your method of payment. Please note the important payment information below.', 'event_espresso'), $payment_method->name()) |
|
647 | 647 | ) |
648 | 648 | ); |
649 | 649 | } |
@@ -667,27 +667,27 @@ discard block |
||
667 | 667 | * @param string $request_param |
668 | 668 | * @return NULL|string |
669 | 669 | */ |
670 | - private function _get_selected_method_of_payment( $required = FALSE, $request_param = 'selected_method_of_payment' ) { |
|
670 | + private function _get_selected_method_of_payment($required = FALSE, $request_param = 'selected_method_of_payment') { |
|
671 | 671 | // is selected_method_of_payment set in the request ? |
672 | - $selected_method_of_payment = EE_Registry::instance()->REQ->get( $request_param, FALSE ); |
|
673 | - if ( $selected_method_of_payment ) { |
|
672 | + $selected_method_of_payment = EE_Registry::instance()->REQ->get($request_param, FALSE); |
|
673 | + if ($selected_method_of_payment) { |
|
674 | 674 | // sanitize it |
675 | - $selected_method_of_payment = is_array( $selected_method_of_payment ) ? array_shift( $selected_method_of_payment ) : $selected_method_of_payment; |
|
676 | - $selected_method_of_payment = sanitize_text_field( $selected_method_of_payment ); |
|
675 | + $selected_method_of_payment = is_array($selected_method_of_payment) ? array_shift($selected_method_of_payment) : $selected_method_of_payment; |
|
676 | + $selected_method_of_payment = sanitize_text_field($selected_method_of_payment); |
|
677 | 677 | // store it in the session so that it's available for all subsequent requests including AJAX |
678 | - $this->_save_selected_method_of_payment( $selected_method_of_payment ); |
|
678 | + $this->_save_selected_method_of_payment($selected_method_of_payment); |
|
679 | 679 | } else { |
680 | 680 | // or is is set in the session ? |
681 | - $selected_method_of_payment = EE_Registry::instance()->SSN->get_session_data( 'selected_method_of_payment' ); |
|
681 | + $selected_method_of_payment = EE_Registry::instance()->SSN->get_session_data('selected_method_of_payment'); |
|
682 | 682 | } |
683 | 683 | // do ya really really gotta have it? |
684 | - if ( empty( $selected_method_of_payment ) && $required ) { |
|
684 | + if (empty($selected_method_of_payment) && $required) { |
|
685 | 685 | EE_Error::add_error( |
686 | 686 | sprintf( |
687 | - __( 'The selected method of payment could not be determined.%sPlease ensure that you have selected one before proceeding.%sIf you continue to experience difficulties, then refresh your browser and try again, or contact %s for assistance.', 'event_espresso' ), |
|
687 | + __('The selected method of payment could not be determined.%sPlease ensure that you have selected one before proceeding.%sIf you continue to experience difficulties, then refresh your browser and try again, or contact %s for assistance.', 'event_espresso'), |
|
688 | 688 | '<br/>', |
689 | 689 | '<br/>', |
690 | - EE_Registry::instance()->CFG->organization->get_pretty( 'email' ) |
|
690 | + EE_Registry::instance()->CFG->organization->get_pretty('email') |
|
691 | 691 | ), |
692 | 692 | __FILE__, __FUNCTION__, __LINE__ |
693 | 693 | ); |
@@ -716,22 +716,22 @@ discard block |
||
716 | 716 | */ |
717 | 717 | public function process_reg_step() { |
718 | 718 | // how have they chosen to pay? |
719 | - $this->checkout->selected_method_of_payment = $this->_get_selected_method_of_payment( TRUE ); |
|
719 | + $this->checkout->selected_method_of_payment = $this->_get_selected_method_of_payment(TRUE); |
|
720 | 720 | // choose your own adventure based on method_of_payment |
721 | - switch( $this->checkout->selected_method_of_payment ) { |
|
721 | + switch ($this->checkout->selected_method_of_payment) { |
|
722 | 722 | |
723 | 723 | case 'events_sold_out' : |
724 | 724 | $this->checkout->redirect = TRUE; |
725 | 725 | $this->checkout->redirect_url = $this->checkout->cancel_page_url; |
726 | - $this->checkout->json_response->set_redirect_url( $this->checkout->redirect_url ); |
|
726 | + $this->checkout->json_response->set_redirect_url($this->checkout->redirect_url); |
|
727 | 727 | // mark this reg step as completed |
728 | 728 | $this->checkout->current_step->set_completed(); |
729 | 729 | return FALSE; |
730 | 730 | break; |
731 | 731 | |
732 | 732 | case 'payments_closed' : |
733 | - if ( apply_filters( 'FHEE__EE_SPCO_Reg_Step_Payment_Options__process_reg_step__payments_closed__display_success', false ) ) { |
|
734 | - EE_Error::add_success( __( 'no payment required at this time.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ ); |
|
733 | + if (apply_filters('FHEE__EE_SPCO_Reg_Step_Payment_Options__process_reg_step__payments_closed__display_success', false)) { |
|
734 | + EE_Error::add_success(__('no payment required at this time.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
735 | 735 | } |
736 | 736 | // mark this reg step as completed |
737 | 737 | $this->checkout->current_step->set_completed(); |
@@ -739,8 +739,8 @@ discard block |
||
739 | 739 | break; |
740 | 740 | |
741 | 741 | case 'no_payment_required' : |
742 | - if ( apply_filters( 'FHEE__EE_SPCO_Reg_Step_Payment_Options__process_reg_step__no_payment_required__display_success', false ) ) { |
|
743 | - EE_Error::add_success( __( 'no payment required.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ ); |
|
742 | + if (apply_filters('FHEE__EE_SPCO_Reg_Step_Payment_Options__process_reg_step__no_payment_required__display_success', false)) { |
|
743 | + EE_Error::add_success(__('no payment required.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
744 | 744 | } |
745 | 745 | // mark this reg step as completed |
746 | 746 | $this->checkout->current_step->set_completed(); |
@@ -749,9 +749,9 @@ discard block |
||
749 | 749 | |
750 | 750 | default: |
751 | 751 | $payment_successful = $this->_process_payment(); |
752 | - if ( $payment_successful ) { |
|
752 | + if ($payment_successful) { |
|
753 | 753 | $this->checkout->continue_reg = true; |
754 | - $this->_maybe_set_completed( $this->checkout->payment_method ); |
|
754 | + $this->_maybe_set_completed($this->checkout->payment_method); |
|
755 | 755 | } else { |
756 | 756 | $this->checkout->continue_reg = false; |
757 | 757 | } |
@@ -769,8 +769,8 @@ discard block |
||
769 | 769 | * @param \EE_Payment_Method $payment_method |
770 | 770 | * @return void |
771 | 771 | */ |
772 | - protected function _maybe_set_completed( EE_Payment_Method $payment_method ) { |
|
773 | - switch ( $payment_method->type_obj()->payment_occurs() ) { |
|
772 | + protected function _maybe_set_completed(EE_Payment_Method $payment_method) { |
|
773 | + switch ($payment_method->type_obj()->payment_occurs()) { |
|
774 | 774 | case EE_PMT_Base::offsite : |
775 | 775 | break; |
776 | 776 | case EE_PMT_Base::onsite : |
@@ -793,15 +793,15 @@ discard block |
||
793 | 793 | public function update_reg_step() { |
794 | 794 | $success = TRUE; |
795 | 795 | // if payment required |
796 | - if ( $this->checkout->transaction->total() > 0 ) { |
|
797 | - do_action ('AHEE__EE_Single_Page_Checkout__process_finalize_registration__before_gateway', $this->checkout->transaction ); |
|
796 | + if ($this->checkout->transaction->total() > 0) { |
|
797 | + do_action('AHEE__EE_Single_Page_Checkout__process_finalize_registration__before_gateway', $this->checkout->transaction); |
|
798 | 798 | // attempt payment via payment method |
799 | 799 | $success = $this->process_reg_step(); |
800 | 800 | } |
801 | - if ( $success && ! $this->checkout->redirect ) { |
|
802 | - $this->checkout->cart->get_grand_total()->save_this_and_descendants_to_txn( $this->checkout->transaction->ID() ); |
|
801 | + if ($success && ! $this->checkout->redirect) { |
|
802 | + $this->checkout->cart->get_grand_total()->save_this_and_descendants_to_txn($this->checkout->transaction->ID()); |
|
803 | 803 | // set return URL |
804 | - $this->checkout->redirect_url = add_query_arg( array( 'e_reg_url_link' => $this->checkout->reg_url_link ), $this->checkout->thank_you_page_url ); |
|
804 | + $this->checkout->redirect_url = add_query_arg(array('e_reg_url_link' => $this->checkout->reg_url_link), $this->checkout->thank_you_page_url); |
|
805 | 805 | } |
806 | 806 | return $success; |
807 | 807 | } |
@@ -821,24 +821,24 @@ discard block |
||
821 | 821 | // clear any previous errors related to not selecting a payment method |
822 | 822 | // EE_Error::overwrite_errors(); |
823 | 823 | // ya gotta make a choice man |
824 | - if ( empty( $this->checkout->selected_method_of_payment )) { |
|
825 | - $this->checkout->json_response->set_plz_select_method_of_payment( __( 'Please select a method of payment before proceeding.', 'event_espresso' )); |
|
824 | + if (empty($this->checkout->selected_method_of_payment)) { |
|
825 | + $this->checkout->json_response->set_plz_select_method_of_payment(__('Please select a method of payment before proceeding.', 'event_espresso')); |
|
826 | 826 | return FALSE; |
827 | 827 | } |
828 | 828 | // get EE_Payment_Method object |
829 | - if ( ! $this->checkout->payment_method = $this->_get_payment_method_for_selected_method_of_payment() ) { |
|
829 | + if ( ! $this->checkout->payment_method = $this->_get_payment_method_for_selected_method_of_payment()) { |
|
830 | 830 | return FALSE; |
831 | 831 | } |
832 | 832 | // setup billing form |
833 | - if ( $this->checkout->payment_method->is_on_site() ) { |
|
834 | - $this->checkout->billing_form = $this->_get_billing_form_for_payment_method( $this->checkout->payment_method ); |
|
833 | + if ($this->checkout->payment_method->is_on_site()) { |
|
834 | + $this->checkout->billing_form = $this->_get_billing_form_for_payment_method($this->checkout->payment_method); |
|
835 | 835 | // bad billing form ? |
836 | - if ( ! $this->_billing_form_is_valid() ) { |
|
836 | + if ( ! $this->_billing_form_is_valid()) { |
|
837 | 837 | return FALSE; |
838 | 838 | } |
839 | 839 | } |
840 | 840 | // ensure primary registrant has been fully processed |
841 | - if ( ! $this->_setup_primary_registrant_prior_to_payment() ) { |
|
841 | + if ( ! $this->_setup_primary_registrant_prior_to_payment()) { |
|
842 | 842 | return FALSE; |
843 | 843 | } |
844 | 844 | /** @type EE_Transaction_Processor $transaction_processor */ |
@@ -846,20 +846,20 @@ discard block |
||
846 | 846 | // in case a registrant leaves to an Off-Site Gateway and never returns, we want to approve any registrations for events with a default reg status of Approved |
847 | 847 | //$transaction_processor->toggle_registration_statuses_for_default_approved_events( $this->checkout->transaction, $this->checkout->reg_cache_where_params ); |
848 | 848 | // attempt payment |
849 | - $payment = $this->_attempt_payment( $this->checkout->payment_method ); |
|
849 | + $payment = $this->_attempt_payment($this->checkout->payment_method); |
|
850 | 850 | // process results |
851 | - $payment = $this->_validate_payment( $payment ); |
|
852 | - $payment = $this->_post_payment_processing( $payment ); |
|
851 | + $payment = $this->_validate_payment($payment); |
|
852 | + $payment = $this->_post_payment_processing($payment); |
|
853 | 853 | // verify payment |
854 | - if ( $payment instanceof EE_Payment ) { |
|
854 | + if ($payment instanceof EE_Payment) { |
|
855 | 855 | // store that for later |
856 | 856 | $this->checkout->payment = $payment; |
857 | 857 | /** @type EE_Transaction_Processor $transaction_processor */ |
858 | - $transaction_processor = EE_Registry::instance()->load_class( 'Transaction_Processor' ); |
|
858 | + $transaction_processor = EE_Registry::instance()->load_class('Transaction_Processor'); |
|
859 | 859 | // we can also consider the TXN to not have been failed, so temporarily upgrade it's status to abandoned |
860 | - $transaction_processor->toggle_failed_transaction_status( $this->checkout->transaction ); |
|
860 | + $transaction_processor->toggle_failed_transaction_status($this->checkout->transaction); |
|
861 | 861 | return true; |
862 | - } else if ( $payment === true ) { |
|
862 | + } else if ($payment === true) { |
|
863 | 863 | // please note that offline payment methods will NOT make a payment, |
864 | 864 | // but instead just mark themselves as the PMD_ID on the transaction, and return true |
865 | 865 | $this->checkout->payment = $payment; |
@@ -878,10 +878,10 @@ discard block |
||
878 | 878 | * @return bool |
879 | 879 | */ |
880 | 880 | public function redirect_form() { |
881 | - $payment_method_billing_info = $this->_payment_method_billing_info( $this->_get_payment_method_for_selected_method_of_payment() ); |
|
881 | + $payment_method_billing_info = $this->_payment_method_billing_info($this->_get_payment_method_for_selected_method_of_payment()); |
|
882 | 882 | $html = $payment_method_billing_info->get_html_and_js(); |
883 | 883 | $html .= $this->checkout->redirect_form; |
884 | - EE_Registry::instance()->REQ->add_output( $html ); |
|
884 | + EE_Registry::instance()->REQ->add_output($html); |
|
885 | 885 | return TRUE; |
886 | 886 | } |
887 | 887 | |
@@ -894,33 +894,33 @@ discard block |
||
894 | 894 | * @return bool |
895 | 895 | */ |
896 | 896 | private function _billing_form_is_valid() { |
897 | - if ( $this->checkout->billing_form instanceof EE_Billing_Info_Form ) { |
|
898 | - if ( $this->checkout->billing_form->was_submitted() ) { |
|
897 | + if ($this->checkout->billing_form instanceof EE_Billing_Info_Form) { |
|
898 | + if ($this->checkout->billing_form->was_submitted()) { |
|
899 | 899 | $this->checkout->billing_form->receive_form_submission(); |
900 | - if ( $this->checkout->billing_form->is_valid() ) { |
|
900 | + if ($this->checkout->billing_form->is_valid()) { |
|
901 | 901 | return TRUE; |
902 | 902 | } |
903 | 903 | $validation_errors = $this->checkout->billing_form->get_validation_errors_accumulated(); |
904 | 904 | $error_strings = array(); |
905 | - foreach( $validation_errors as $validation_error ){ |
|
906 | - if( $validation_error instanceof EE_Validation_Error ){ |
|
905 | + foreach ($validation_errors as $validation_error) { |
|
906 | + if ($validation_error instanceof EE_Validation_Error) { |
|
907 | 907 | $form_section = $validation_error->get_form_section(); |
908 | - if( $form_section instanceof EE_Form_Input_Base ){ |
|
908 | + if ($form_section instanceof EE_Form_Input_Base) { |
|
909 | 909 | $label = $form_section->html_label_text(); |
910 | - }elseif( $form_section instanceof EE_Form_Section_Base ){ |
|
910 | + }elseif ($form_section instanceof EE_Form_Section_Base) { |
|
911 | 911 | $label = $form_section->name(); |
912 | - }else{ |
|
913 | - $label = __( 'Validation Error', 'event_espresso' ); |
|
912 | + } else { |
|
913 | + $label = __('Validation Error', 'event_espresso'); |
|
914 | 914 | } |
915 | - $error_strings[] = sprintf('%1$s: %2$s', $label, $validation_error->getMessage() ); |
|
915 | + $error_strings[] = sprintf('%1$s: %2$s', $label, $validation_error->getMessage()); |
|
916 | 916 | } |
917 | 917 | } |
918 | - EE_Error::add_error( sprintf( __( 'One or more billing form inputs are invalid and require correction before proceeding. %1$s %2$s', 'event_espresso' ), '<br/>', implode( '<br/>', $error_strings ) ), __FILE__, __FUNCTION__, __LINE__ ); |
|
918 | + EE_Error::add_error(sprintf(__('One or more billing form inputs are invalid and require correction before proceeding. %1$s %2$s', 'event_espresso'), '<br/>', implode('<br/>', $error_strings)), __FILE__, __FUNCTION__, __LINE__); |
|
919 | 919 | } else { |
920 | - EE_Error::add_error( __( 'The billing form was not submitted or something prevented it\'s submission.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ ); |
|
920 | + EE_Error::add_error(__('The billing form was not submitted or something prevented it\'s submission.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
921 | 921 | } |
922 | 922 | } else { |
923 | - EE_Error::add_error( __( 'The submitted billing form is invalid possibly due to a technical reason.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ ); |
|
923 | + EE_Error::add_error(__('The submitted billing form is invalid possibly due to a technical reason.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
924 | 924 | } |
925 | 925 | return FALSE; |
926 | 926 | } |
@@ -938,9 +938,9 @@ discard block |
||
938 | 938 | */ |
939 | 939 | private function _setup_primary_registrant_prior_to_payment() { |
940 | 940 | // check if transaction has a primary registrant and that it has a related Attendee object |
941 | - if ( ! $this->checkout->transaction_has_primary_registrant() ) { |
|
941 | + if ( ! $this->checkout->transaction_has_primary_registrant()) { |
|
942 | 942 | // need to at least gather some primary registrant data before attempting payment |
943 | - if ( $this->checkout->billing_form instanceof EE_Billing_Attendee_Info_Form && ! $this->_capture_primary_registration_data_from_billing_form() ) { |
|
943 | + if ($this->checkout->billing_form instanceof EE_Billing_Attendee_Info_Form && ! $this->_capture_primary_registration_data_from_billing_form()) { |
|
944 | 944 | return FALSE; |
945 | 945 | } |
946 | 946 | } |
@@ -948,13 +948,13 @@ discard block |
||
948 | 948 | // grab the primary_registration object |
949 | 949 | $primary_registration = $this->checkout->transaction->primary_registration(); |
950 | 950 | /** @type EE_Transaction_Processor $transaction_processor */ |
951 | - $transaction_processor = EE_Registry::instance()->load_class( 'Transaction_Processor' ); |
|
951 | + $transaction_processor = EE_Registry::instance()->load_class('Transaction_Processor'); |
|
952 | 952 | // at this point we'll consider a TXN to not have been failed |
953 | - $transaction_processor->toggle_failed_transaction_status( $this->checkout->transaction ); |
|
953 | + $transaction_processor->toggle_failed_transaction_status($this->checkout->transaction); |
|
954 | 954 | // save the TXN ( which clears cached copy of primary_registration) |
955 | 955 | $this->checkout->transaction->save(); |
956 | 956 | // grab TXN ID and save it to the primary_registration |
957 | - $primary_registration->set_transaction_id( $this->checkout->transaction->ID() ); |
|
957 | + $primary_registration->set_transaction_id($this->checkout->transaction->ID()); |
|
958 | 958 | // save what we have so far |
959 | 959 | $primary_registration->save(); |
960 | 960 | return TRUE; |
@@ -971,41 +971,41 @@ discard block |
||
971 | 971 | private function _capture_primary_registration_data_from_billing_form() { |
972 | 972 | // convert billing form data into an attendee |
973 | 973 | $this->checkout->primary_attendee_obj = $this->checkout->billing_form->create_attendee_from_billing_form_data(); |
974 | - if ( ! $this->checkout->primary_attendee_obj instanceof EE_Attendee ) { |
|
974 | + if ( ! $this->checkout->primary_attendee_obj instanceof EE_Attendee) { |
|
975 | 975 | EE_Error::add_error( |
976 | 976 | sprintf( |
977 | - __( 'The billing form details could not be used for attendee details due to a technical issue.%sPlease try again or contact %s for assistance.', 'event_espresso' ), |
|
977 | + __('The billing form details could not be used for attendee details due to a technical issue.%sPlease try again or contact %s for assistance.', 'event_espresso'), |
|
978 | 978 | '<br/>', |
979 | - EE_Registry::instance()->CFG->organization->get_pretty( 'email' ) |
|
979 | + EE_Registry::instance()->CFG->organization->get_pretty('email') |
|
980 | 980 | ), __FILE__, __FUNCTION__, __LINE__ |
981 | 981 | ); |
982 | 982 | return FALSE; |
983 | 983 | } |
984 | 984 | $primary_registration = $this->checkout->transaction->primary_registration(); |
985 | - if ( ! $primary_registration instanceof EE_Registration ) { |
|
985 | + if ( ! $primary_registration instanceof EE_Registration) { |
|
986 | 986 | EE_Error::add_error( |
987 | 987 | sprintf( |
988 | - __( 'The primary registrant for this transaction could not be determined due to a technical issue.%sPlease try again or contact %s for assistance.', 'event_espresso' ), |
|
988 | + __('The primary registrant for this transaction could not be determined due to a technical issue.%sPlease try again or contact %s for assistance.', 'event_espresso'), |
|
989 | 989 | '<br/>', |
990 | - EE_Registry::instance()->CFG->organization->get_pretty( 'email' ) |
|
990 | + EE_Registry::instance()->CFG->organization->get_pretty('email') |
|
991 | 991 | ), __FILE__, __FUNCTION__, __LINE__ |
992 | 992 | ); |
993 | 993 | return FALSE; |
994 | 994 | } |
995 | - if ( ! $primary_registration->_add_relation_to( $this->checkout->primary_attendee_obj, 'Attendee' ) instanceof EE_Attendee ) { |
|
995 | + if ( ! $primary_registration->_add_relation_to($this->checkout->primary_attendee_obj, 'Attendee') instanceof EE_Attendee) { |
|
996 | 996 | EE_Error::add_error( |
997 | 997 | sprintf( |
998 | - __( 'The primary registrant could not be associated with this transaction due to a technical issue.%sPlease try again or contact %s for assistance.', 'event_espresso' ), |
|
998 | + __('The primary registrant could not be associated with this transaction due to a technical issue.%sPlease try again or contact %s for assistance.', 'event_espresso'), |
|
999 | 999 | '<br/>', |
1000 | - EE_Registry::instance()->CFG->organization->get_pretty( 'email' ) |
|
1000 | + EE_Registry::instance()->CFG->organization->get_pretty('email') |
|
1001 | 1001 | ), __FILE__, __FUNCTION__, __LINE__ |
1002 | 1002 | ); |
1003 | 1003 | return FALSE; |
1004 | 1004 | } |
1005 | 1005 | /** @type EE_Registration_Processor $registration_processor */ |
1006 | - $registration_processor = EE_Registry::instance()->load_class( 'Registration_Processor' ); |
|
1006 | + $registration_processor = EE_Registry::instance()->load_class('Registration_Processor'); |
|
1007 | 1007 | // at this point, we should have enough details about the registrant to consider the registration NOT incomplete |
1008 | - $registration_processor->toggle_incomplete_registration_status_to_default( $primary_registration ); |
|
1008 | + $registration_processor->toggle_incomplete_registration_status_to_default($primary_registration); |
|
1009 | 1009 | |
1010 | 1010 | return TRUE; |
1011 | 1011 | } |
@@ -1021,27 +1021,27 @@ discard block |
||
1021 | 1021 | */ |
1022 | 1022 | private function _get_payment_method_for_selected_method_of_payment() { |
1023 | 1023 | // get EE_Payment_Method object |
1024 | - $payment_method = EE_Registry::instance()->LIB->EEM_Payment_Method->get_one_by_slug( $this->checkout->selected_method_of_payment ); |
|
1024 | + $payment_method = EE_Registry::instance()->LIB->EEM_Payment_Method->get_one_by_slug($this->checkout->selected_method_of_payment); |
|
1025 | 1025 | // verify $payment_method |
1026 | - if ( ! $payment_method instanceof EE_Payment_Method ) { |
|
1026 | + if ( ! $payment_method instanceof EE_Payment_Method) { |
|
1027 | 1027 | // not a payment |
1028 | 1028 | EE_Error::add_error( |
1029 | 1029 | sprintf( |
1030 | - __( 'The selected method of payment could not be determined due to a technical issue.%sPlease try again or contact %s for assistance.', 'event_espresso' ), |
|
1030 | + __('The selected method of payment could not be determined due to a technical issue.%sPlease try again or contact %s for assistance.', 'event_espresso'), |
|
1031 | 1031 | '<br/>', |
1032 | - EE_Registry::instance()->CFG->organization->get_pretty( 'email' ) |
|
1032 | + EE_Registry::instance()->CFG->organization->get_pretty('email') |
|
1033 | 1033 | ), __FILE__, __FUNCTION__, __LINE__ |
1034 | 1034 | ); |
1035 | 1035 | return NULL; |
1036 | 1036 | } |
1037 | 1037 | // and verify it has a valid Payment_Method Type object |
1038 | - if ( ! $payment_method->type_obj() instanceof EE_PMT_Base ) { |
|
1038 | + if ( ! $payment_method->type_obj() instanceof EE_PMT_Base) { |
|
1039 | 1039 | // not a payment |
1040 | 1040 | EE_Error::add_error( |
1041 | 1041 | sprintf( |
1042 | - __( 'A valid payment method could not be determined due to a technical issue.%sPlease try again or contact %s for assistance.', 'event_espresso' ), |
|
1042 | + __('A valid payment method could not be determined due to a technical issue.%sPlease try again or contact %s for assistance.', 'event_espresso'), |
|
1043 | 1043 | '<br/>', |
1044 | - EE_Registry::instance()->CFG->organization->get_pretty( 'email' ) |
|
1044 | + EE_Registry::instance()->CFG->organization->get_pretty('email') |
|
1045 | 1045 | ), __FILE__, __FUNCTION__, __LINE__ |
1046 | 1046 | ); |
1047 | 1047 | return NULL; |
@@ -1060,25 +1060,25 @@ discard block |
||
1060 | 1060 | * @type EE_Payment_Method $payment_method |
1061 | 1061 | * @return mixed EE_Payment | boolean |
1062 | 1062 | */ |
1063 | - private function _attempt_payment( EE_Payment_Method $payment_method ) { |
|
1064 | - $payment =NULL; |
|
1063 | + private function _attempt_payment(EE_Payment_Method $payment_method) { |
|
1064 | + $payment = NULL; |
|
1065 | 1065 | $this->checkout->transaction->save(); |
1066 | - $payment_processor = EE_Registry::instance()->load_core( 'Payment_Processor' ); |
|
1067 | - if ( ! $payment_processor instanceof EE_Payment_Processor ) { |
|
1066 | + $payment_processor = EE_Registry::instance()->load_core('Payment_Processor'); |
|
1067 | + if ( ! $payment_processor instanceof EE_Payment_Processor) { |
|
1068 | 1068 | return FALSE; |
1069 | 1069 | } |
1070 | 1070 | try { |
1071 | - $payment_processor->set_revisit( $this->checkout->revisit ); |
|
1071 | + $payment_processor->set_revisit($this->checkout->revisit); |
|
1072 | 1072 | // generate payment object |
1073 | 1073 | $payment = $payment_processor->process_payment( |
1074 | 1074 | $payment_method, |
1075 | 1075 | $this->checkout->transaction, |
1076 | 1076 | $this->checkout->amount_owing, |
1077 | 1077 | $this->checkout->billing_form, |
1078 | - $this->_get_return_url( $payment_method ) |
|
1078 | + $this->_get_return_url($payment_method) |
|
1079 | 1079 | ); |
1080 | - } catch( Exception $e ) { |
|
1081 | - $this->_handle_payment_processor_exception( $e ); |
|
1080 | + } catch (Exception $e) { |
|
1081 | + $this->_handle_payment_processor_exception($e); |
|
1082 | 1082 | } |
1083 | 1083 | return $payment; |
1084 | 1084 | } |
@@ -1092,12 +1092,12 @@ discard block |
||
1092 | 1092 | * @param \Exception $e |
1093 | 1093 | * @return void |
1094 | 1094 | */ |
1095 | - protected function _handle_payment_processor_exception( Exception $e ) { |
|
1095 | + protected function _handle_payment_processor_exception(Exception $e) { |
|
1096 | 1096 | EE_Error::add_error( |
1097 | 1097 | sprintf( |
1098 | - __( 'The payment could not br processed due to a technical issue.%1$sPlease try again or contact %2$s for assistance.||The following Exception was thrown in %4$s on line %5$s:%1$s%3$s', 'event_espresso' ), |
|
1098 | + __('The payment could not br processed due to a technical issue.%1$sPlease try again or contact %2$s for assistance.||The following Exception was thrown in %4$s on line %5$s:%1$s%3$s', 'event_espresso'), |
|
1099 | 1099 | '<br/>', |
1100 | - EE_Registry::instance()->CFG->organization->get_pretty( 'email' ), |
|
1100 | + EE_Registry::instance()->CFG->organization->get_pretty('email'), |
|
1101 | 1101 | $e->getMessage(), |
1102 | 1102 | $e->getFile(), |
1103 | 1103 | $e->getLine() |
@@ -1114,9 +1114,9 @@ discard block |
||
1114 | 1114 | * @param \EE_Payment_Method $payment_method |
1115 | 1115 | * @return string |
1116 | 1116 | */ |
1117 | - protected function _get_return_url( EE_Payment_Method $payment_method ) { |
|
1117 | + protected function _get_return_url(EE_Payment_Method $payment_method) { |
|
1118 | 1118 | $return_url = ''; |
1119 | - switch ( $payment_method->type_obj()->payment_occurs() ) { |
|
1119 | + switch ($payment_method->type_obj()->payment_occurs()) { |
|
1120 | 1120 | |
1121 | 1121 | case EE_PMT_Base::offsite : |
1122 | 1122 | $return_url = add_query_arg( |
@@ -1155,13 +1155,13 @@ discard block |
||
1155 | 1155 | public function process_gateway_response() { |
1156 | 1156 | $payment = null; |
1157 | 1157 | // how have they chosen to pay? |
1158 | - $this->checkout->selected_method_of_payment = $this->_get_selected_method_of_payment( true ); |
|
1158 | + $this->checkout->selected_method_of_payment = $this->_get_selected_method_of_payment(true); |
|
1159 | 1159 | // get EE_Payment_Method object |
1160 | - if ( ! $this->checkout->payment_method = $this->_get_payment_method_for_selected_method_of_payment() ) { |
|
1160 | + if ( ! $this->checkout->payment_method = $this->_get_payment_method_for_selected_method_of_payment()) { |
|
1161 | 1161 | $this->checkout->continue_reg = false; |
1162 | 1162 | return false; |
1163 | 1163 | } |
1164 | - if ( ! $this->checkout->payment_method->is_off_site() ) { |
|
1164 | + if ( ! $this->checkout->payment_method->is_off_site()) { |
|
1165 | 1165 | return false; |
1166 | 1166 | } |
1167 | 1167 | $this->_validate_offsite_return(); |
@@ -1175,17 +1175,17 @@ discard block |
||
1175 | 1175 | // true |
1176 | 1176 | //); |
1177 | 1177 | // verify TXN |
1178 | - if ( $this->checkout->transaction instanceof EE_Transaction ) { |
|
1178 | + if ($this->checkout->transaction instanceof EE_Transaction) { |
|
1179 | 1179 | $gateway = $this->checkout->payment_method->type_obj()->get_gateway(); |
1180 | - if ( ! $gateway instanceof EE_Offsite_Gateway ) { |
|
1180 | + if ( ! $gateway instanceof EE_Offsite_Gateway) { |
|
1181 | 1181 | $this->checkout->continue_reg = false; |
1182 | 1182 | return false; |
1183 | 1183 | } |
1184 | - $payment = $this->_process_off_site_payment( $gateway ); |
|
1185 | - $payment = $this->_process_cancelled_payments( $payment ); |
|
1186 | - $payment = $this->_validate_payment( $payment ); |
|
1184 | + $payment = $this->_process_off_site_payment($gateway); |
|
1185 | + $payment = $this->_process_cancelled_payments($payment); |
|
1186 | + $payment = $this->_validate_payment($payment); |
|
1187 | 1187 | // if payment was not declined by the payment gateway or cancelled by the registrant |
1188 | - if ( $this->_process_payment_status( $payment, EE_PMT_Base::offsite ) ) { |
|
1188 | + if ($this->_process_payment_status($payment, EE_PMT_Base::offsite)) { |
|
1189 | 1189 | //$this->_setup_redirect_for_next_step(); |
1190 | 1190 | // store that for later |
1191 | 1191 | $this->checkout->payment = $payment; |
@@ -1211,19 +1211,19 @@ discard block |
||
1211 | 1211 | * @return bool |
1212 | 1212 | */ |
1213 | 1213 | private function _validate_offsite_return() { |
1214 | - $TXN_ID = (int)EE_Registry::instance()->REQ->get( 'spco_txn', 0 ); |
|
1215 | - if ( $TXN_ID != $this->checkout->transaction->ID() ) { |
|
1214 | + $TXN_ID = (int) EE_Registry::instance()->REQ->get('spco_txn', 0); |
|
1215 | + if ($TXN_ID != $this->checkout->transaction->ID()) { |
|
1216 | 1216 | // Houston... we might have a problem |
1217 | 1217 | $invalid_TXN = false; |
1218 | 1218 | // first gather some info |
1219 | - $valid_TXN = EEM_Transaction::instance()->get_one_by_ID( $TXN_ID ); |
|
1219 | + $valid_TXN = EEM_Transaction::instance()->get_one_by_ID($TXN_ID); |
|
1220 | 1220 | $primary_registrant = $valid_TXN instanceof EE_Transaction ? $valid_TXN->primary_registration() : null; |
1221 | 1221 | // let's start by retrieving the cart for this TXN |
1222 | - $cart = EE_Cart::get_cart_from_txn( $this->checkout->transaction ); |
|
1223 | - if ( $cart instanceof EE_Cart ) { |
|
1222 | + $cart = EE_Cart::get_cart_from_txn($this->checkout->transaction); |
|
1223 | + if ($cart instanceof EE_Cart) { |
|
1224 | 1224 | // verify that the current cart has tickets |
1225 | 1225 | $tickets = $cart->get_tickets(); |
1226 | - if ( empty( $tickets ) ) { |
|
1226 | + if (empty($tickets)) { |
|
1227 | 1227 | $invalid_TXN = true; |
1228 | 1228 | } |
1229 | 1229 | } else { |
@@ -1231,39 +1231,39 @@ discard block |
||
1231 | 1231 | } |
1232 | 1232 | $valid_TXN_SID = $primary_registrant instanceof EE_Registration ? $primary_registrant->session_ID() : null; |
1233 | 1233 | // validate current Session ID and compare against valid TXN session ID |
1234 | - if ( EE_Session::instance()->id() === null ) { |
|
1234 | + if (EE_Session::instance()->id() === null) { |
|
1235 | 1235 | $invalid_TXN = true; |
1236 | - } else if ( EE_Session::instance()->id() === $valid_TXN_SID ) { |
|
1236 | + } else if (EE_Session::instance()->id() === $valid_TXN_SID) { |
|
1237 | 1237 | // WARNING !!! |
1238 | 1238 | // this could be PayPal sending back duplicate requests (ya they do that) |
1239 | 1239 | // or it **could** mean someone is simply registering AGAIN after having just done so |
1240 | 1240 | // so now we need to determine if this current TXN looks valid or not |
1241 | 1241 | /** @type EE_Transaction_Processor $transaction_processor */ |
1242 | - $transaction_processor = EE_Registry::instance()->load_class( 'Transaction_Processor' ); |
|
1242 | + $transaction_processor = EE_Registry::instance()->load_class('Transaction_Processor'); |
|
1243 | 1243 | // has this step even been started ? |
1244 | - if ( $transaction_processor->reg_step_completed( $this->checkout->transaction, $this->slug() === false ) |
|
1244 | + if ($transaction_processor->reg_step_completed($this->checkout->transaction, $this->slug() === false) |
|
1245 | 1245 | ) { |
1246 | 1246 | // really? you're half way through this reg step, but you never started it ? |
1247 | 1247 | $invalid_TXN = true; |
1248 | 1248 | } |
1249 | 1249 | } |
1250 | - if ( $invalid_TXN ) { |
|
1250 | + if ($invalid_TXN) { |
|
1251 | 1251 | // is the valid TXN completed ? |
1252 | - if ( $valid_TXN instanceof EE_Transaction ) { |
|
1252 | + if ($valid_TXN instanceof EE_Transaction) { |
|
1253 | 1253 | /** @type EE_Transaction_Processor $transaction_processor */ |
1254 | - $transaction_processor = EE_Registry::instance()->load_class( 'Transaction_Processor' ); |
|
1254 | + $transaction_processor = EE_Registry::instance()->load_class('Transaction_Processor'); |
|
1255 | 1255 | // has this step even been started ? |
1256 | - $reg_step_completed = $transaction_processor->reg_step_completed( $valid_TXN, $this->slug() ); |
|
1257 | - if ( $reg_step_completed !== false && $reg_step_completed !== true ) { |
|
1256 | + $reg_step_completed = $transaction_processor->reg_step_completed($valid_TXN, $this->slug()); |
|
1257 | + if ($reg_step_completed !== false && $reg_step_completed !== true) { |
|
1258 | 1258 | // so it **looks** like this is a double request from PayPal |
1259 | 1259 | // so let's try to pick up where we left off |
1260 | 1260 | $this->checkout->transaction = $valid_TXN; |
1261 | - $this->checkout->refresh_all_entities( true ); |
|
1261 | + $this->checkout->refresh_all_entities(true); |
|
1262 | 1262 | return; |
1263 | 1263 | } |
1264 | 1264 | } |
1265 | 1265 | // you appear to be lost? |
1266 | - $this->_redirect_wayward_request( $primary_registrant ); |
|
1266 | + $this->_redirect_wayward_request($primary_registrant); |
|
1267 | 1267 | } |
1268 | 1268 | } |
1269 | 1269 | } |
@@ -1277,18 +1277,18 @@ discard block |
||
1277 | 1277 | * @param \EE_Registration $primary_registrant |
1278 | 1278 | * @return bool |
1279 | 1279 | */ |
1280 | - private function _redirect_wayward_request( EE_Registration $primary_registrant ) { |
|
1281 | - if ( ! $primary_registrant instanceof EE_Registration ) { |
|
1280 | + private function _redirect_wayward_request(EE_Registration $primary_registrant) { |
|
1281 | + if ( ! $primary_registrant instanceof EE_Registration) { |
|
1282 | 1282 | // try redirecting based on the current TXN |
1283 | 1283 | $primary_registrant = $this->checkout->transaction instanceof EE_Transaction ? $this->checkout->transaction->primary_registration() : null; |
1284 | - if ( ! $primary_registrant instanceof EE_Registration ) { |
|
1284 | + if ( ! $primary_registrant instanceof EE_Registration) { |
|
1285 | 1285 | EE_Error::add_error( |
1286 | 1286 | sprintf( |
1287 | - __( 'Invalid information was received from the Off-Site Payment Processor and your |
|
1287 | + __('Invalid information was received from the Off-Site Payment Processor and your |
|
1288 | 1288 | Transaction details could not be retrieved from the database.%1$sPlease try again or contact |
1289 | - %2$s for assistance.', 'event_espresso' ), |
|
1289 | + %2$s for assistance.', 'event_espresso'), |
|
1290 | 1290 | '<br/>', |
1291 | - EE_Registry::instance()->CFG->organization->get_pretty( 'email' ) |
|
1291 | + EE_Registry::instance()->CFG->organization->get_pretty('email') |
|
1292 | 1292 | ), |
1293 | 1293 | __FILE__, __FUNCTION__, __LINE__ |
1294 | 1294 | ); |
@@ -1316,16 +1316,16 @@ discard block |
||
1316 | 1316 | * @param \EE_Offsite_Gateway $gateway |
1317 | 1317 | * @return \EE_Payment |
1318 | 1318 | */ |
1319 | - private function _process_off_site_payment( EE_Offsite_Gateway $gateway ) { |
|
1319 | + private function _process_off_site_payment(EE_Offsite_Gateway $gateway) { |
|
1320 | 1320 | try { |
1321 | 1321 | // if gateway uses_separate_IPN_request, then we don't have to process the IPN manually |
1322 | - if ( $gateway instanceof EE_Offsite_Gateway && $gateway->uses_separate_IPN_request() ) { |
|
1322 | + if ($gateway instanceof EE_Offsite_Gateway && $gateway->uses_separate_IPN_request()) { |
|
1323 | 1323 | $payment = $this->checkout->transaction->last_payment(); |
1324 | 1324 | //$payment_source = 'last_payment'; |
1325 | 1325 | } else { |
1326 | 1326 | // get payment details and process results |
1327 | 1327 | /** @type EE_Payment_Processor $payment_processor */ |
1328 | - $payment_processor = EE_Registry::instance()->load_core( 'Payment_Processor' ); |
|
1328 | + $payment_processor = EE_Registry::instance()->load_core('Payment_Processor'); |
|
1329 | 1329 | $payment = $payment_processor->process_ipn( |
1330 | 1330 | $_REQUEST, |
1331 | 1331 | $this->checkout->transaction, |
@@ -1335,14 +1335,14 @@ discard block |
||
1335 | 1335 | ); |
1336 | 1336 | //$payment_source = 'process_ipn'; |
1337 | 1337 | } |
1338 | - } catch ( Exception $e ) { |
|
1338 | + } catch (Exception $e) { |
|
1339 | 1339 | // let's just eat the exception and try to move on using any previously set payment info |
1340 | 1340 | $payment = $this->checkout->transaction->last_payment(); |
1341 | 1341 | //$payment_source = 'last_payment after Exception'; |
1342 | 1342 | // but if we STILL don't have a payment object |
1343 | - if ( ! $payment instanceof EE_Payment ) { |
|
1343 | + if ( ! $payment instanceof EE_Payment) { |
|
1344 | 1344 | // then we'll object ! ( not object like a thing... but object like what a lawyer says ! ) |
1345 | - $this->_handle_payment_processor_exception( $e ); |
|
1345 | + $this->_handle_payment_processor_exception($e); |
|
1346 | 1346 | } |
1347 | 1347 | } |
1348 | 1348 | // DEBUG LOG |
@@ -1366,13 +1366,13 @@ discard block |
||
1366 | 1366 | * @param EE_Payment $payment |
1367 | 1367 | * @return EE_Payment | FALSE |
1368 | 1368 | */ |
1369 | - private function _process_cancelled_payments( $payment = NULL ) { |
|
1369 | + private function _process_cancelled_payments($payment = NULL) { |
|
1370 | 1370 | if ( |
1371 | - isset( $_REQUEST[ 'ee_cancel_payment' ] ) |
|
1371 | + isset($_REQUEST['ee_cancel_payment']) |
|
1372 | 1372 | && $payment instanceof EE_Payment |
1373 | 1373 | && $payment->status() == EEM_Payment::status_id_failed |
1374 | 1374 | ) { |
1375 | - $payment->set_status( EEM_Payment::status_id_cancelled ); |
|
1375 | + $payment->set_status(EEM_Payment::status_id_cancelled); |
|
1376 | 1376 | } |
1377 | 1377 | return $payment; |
1378 | 1378 | } |
@@ -1386,27 +1386,27 @@ discard block |
||
1386 | 1386 | * @param EE_Payment $payment |
1387 | 1387 | * @return EE_Payment | FALSE |
1388 | 1388 | */ |
1389 | - private function _validate_payment( $payment = NULL ) { |
|
1390 | - if ( $this->checkout->payment_method->is_off_line() ) { |
|
1389 | + private function _validate_payment($payment = NULL) { |
|
1390 | + if ($this->checkout->payment_method->is_off_line()) { |
|
1391 | 1391 | return TRUE; |
1392 | 1392 | } |
1393 | 1393 | // verify payment object |
1394 | - if ( $payment instanceof EE_Payment ) { |
|
1394 | + if ($payment instanceof EE_Payment) { |
|
1395 | 1395 | if ( |
1396 | 1396 | $payment->status() != EEM_Payment::status_id_approved |
1397 | 1397 | && $payment->status() != EEM_Payment::status_id_pending |
1398 | 1398 | && $payment->status() != EEM_Payment::status_id_cancelled |
1399 | 1399 | && $payment->gateway_response() != '' |
1400 | 1400 | ) { |
1401 | - EE_Error::add_error( $payment->gateway_response(), __FILE__, __FUNCTION__, __LINE__ ); |
|
1401 | + EE_Error::add_error($payment->gateway_response(), __FILE__, __FUNCTION__, __LINE__); |
|
1402 | 1402 | } |
1403 | 1403 | } else { |
1404 | 1404 | // not a payment |
1405 | 1405 | EE_Error::add_error( |
1406 | 1406 | sprintf( |
1407 | - __( 'A valid payment was not generated due to a technical issue.%sPlease try again or contact %s for assistance.', 'event_espresso' ), |
|
1407 | + __('A valid payment was not generated due to a technical issue.%sPlease try again or contact %s for assistance.', 'event_espresso'), |
|
1408 | 1408 | '<br/>', |
1409 | - EE_Registry::instance()->CFG->organization->get_pretty( 'email' ) |
|
1409 | + EE_Registry::instance()->CFG->organization->get_pretty('email') |
|
1410 | 1410 | ), __FILE__, __FUNCTION__, __LINE__ |
1411 | 1411 | ); |
1412 | 1412 | return FALSE; |
@@ -1423,22 +1423,22 @@ discard block |
||
1423 | 1423 | * @param EE_Payment $payment |
1424 | 1424 | * @return bool |
1425 | 1425 | */ |
1426 | - private function _post_payment_processing( $payment = NULL ) { |
|
1426 | + private function _post_payment_processing($payment = NULL) { |
|
1427 | 1427 | // On-Site payment? |
1428 | - if ( $this->checkout->payment_method->is_on_site() ) { |
|
1429 | - if ( ! $this->_process_payment_status( $payment, EE_PMT_Base::onsite )) { |
|
1428 | + if ($this->checkout->payment_method->is_on_site()) { |
|
1429 | + if ( ! $this->_process_payment_status($payment, EE_PMT_Base::onsite)) { |
|
1430 | 1430 | //$this->_setup_redirect_for_next_step(); |
1431 | 1431 | $this->checkout->continue_reg = false; |
1432 | 1432 | } |
1433 | 1433 | // Off-Site payment? |
1434 | - } else if ( $this->checkout->payment_method->is_off_site() ) { |
|
1434 | + } else if ($this->checkout->payment_method->is_off_site()) { |
|
1435 | 1435 | // if a payment object was made and it specifies a redirect url, then we'll setup that redirect info |
1436 | - if ( $payment instanceof EE_Payment && $payment->redirect_url() ){ |
|
1436 | + if ($payment instanceof EE_Payment && $payment->redirect_url()) { |
|
1437 | 1437 | $this->checkout->redirect = TRUE; |
1438 | 1438 | $this->checkout->redirect_form = $payment->redirect_form(); |
1439 | - $this->checkout->redirect_url = $this->reg_step_url( 'redirect_form' ); |
|
1439 | + $this->checkout->redirect_url = $this->reg_step_url('redirect_form'); |
|
1440 | 1440 | // set JSON response |
1441 | - $this->checkout->json_response->set_redirect_form( $this->checkout->redirect_form ); |
|
1441 | + $this->checkout->json_response->set_redirect_form($this->checkout->redirect_form); |
|
1442 | 1442 | // set cron job for finalizing the TXN |
1443 | 1443 | // in case the user does not return from the off-site gateway |
1444 | 1444 | EE_Cron_Tasks::schedule_finalize_abandoned_transactions_check( |
@@ -1450,14 +1450,14 @@ discard block |
||
1450 | 1450 | $this->checkout->continue_reg = false; |
1451 | 1451 | EE_Error::add_error( |
1452 | 1452 | sprintf( |
1453 | - __( 'It appears the Off Site Payment Method was not configured properly.%sPlease try again or contact %s for assistance.', 'event_espresso' ), |
|
1453 | + __('It appears the Off Site Payment Method was not configured properly.%sPlease try again or contact %s for assistance.', 'event_espresso'), |
|
1454 | 1454 | '<br/>', |
1455 | - EE_Registry::instance()->CFG->organization->get_pretty( 'email' ) |
|
1455 | + EE_Registry::instance()->CFG->organization->get_pretty('email') |
|
1456 | 1456 | ), __FILE__, __FUNCTION__, __LINE__ |
1457 | 1457 | ); |
1458 | 1458 | } |
1459 | 1459 | // Off-Line payment? |
1460 | - } else if ( $payment === TRUE ) { |
|
1460 | + } else if ($payment === TRUE) { |
|
1461 | 1461 | //$this->_setup_redirect_for_next_step(); |
1462 | 1462 | return TRUE; |
1463 | 1463 | } else { |
@@ -1493,57 +1493,57 @@ discard block |
||
1493 | 1493 | * @return bool |
1494 | 1494 | * @throws \EE_Error |
1495 | 1495 | */ |
1496 | - private function _process_payment_status( $payment, $payment_occurs = EE_PMT_Base::offline ) { |
|
1496 | + private function _process_payment_status($payment, $payment_occurs = EE_PMT_Base::offline) { |
|
1497 | 1497 | // off-line payment? carry on |
1498 | - if ( $payment_occurs == EE_PMT_Base::offline ) { |
|
1498 | + if ($payment_occurs == EE_PMT_Base::offline) { |
|
1499 | 1499 | return true; |
1500 | 1500 | } |
1501 | 1501 | // verify payment validity |
1502 | - if ( $payment instanceof EE_Payment ) { |
|
1502 | + if ($payment instanceof EE_Payment) { |
|
1503 | 1503 | $msg = $payment->gateway_response(); |
1504 | 1504 | // check results |
1505 | - switch ( $payment->status() ) { |
|
1505 | + switch ($payment->status()) { |
|
1506 | 1506 | |
1507 | 1507 | // good payment |
1508 | 1508 | case EEM_Payment::status_id_approved : |
1509 | - EE_Error::add_success( __( 'Your payment was processed successfully.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ ); |
|
1509 | + EE_Error::add_success(__('Your payment was processed successfully.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
1510 | 1510 | return TRUE; |
1511 | 1511 | break; |
1512 | 1512 | |
1513 | 1513 | // slow payment |
1514 | 1514 | case EEM_Payment::status_id_pending : |
1515 | - if ( empty( $msg )) { |
|
1516 | - $msg = __( 'Your payment appears to have been processed successfully, but the Instant Payment Notification has not yet been received. It should arrive shortly.', 'event_espresso' ); |
|
1515 | + if (empty($msg)) { |
|
1516 | + $msg = __('Your payment appears to have been processed successfully, but the Instant Payment Notification has not yet been received. It should arrive shortly.', 'event_espresso'); |
|
1517 | 1517 | } |
1518 | - EE_Error::add_success( $msg, __FILE__, __FUNCTION__, __LINE__ ); |
|
1518 | + EE_Error::add_success($msg, __FILE__, __FUNCTION__, __LINE__); |
|
1519 | 1519 | return TRUE; |
1520 | 1520 | break; |
1521 | 1521 | |
1522 | 1522 | // don't wanna payment |
1523 | 1523 | case EEM_Payment::status_id_cancelled : |
1524 | - if ( empty( $msg )) { |
|
1524 | + if (empty($msg)) { |
|
1525 | 1525 | $msg = _n( |
1526 | 1526 | 'Payment cancelled. Please try again.', |
1527 | 1527 | 'Payment cancelled. Please try again or select another method of payment.', |
1528 | - count( $this->checkout->available_payment_methods ), |
|
1528 | + count($this->checkout->available_payment_methods), |
|
1529 | 1529 | 'event_espresso' |
1530 | 1530 | ); |
1531 | 1531 | } |
1532 | - EE_Error::add_attention( $msg, __FILE__, __FUNCTION__, __LINE__ ); |
|
1532 | + EE_Error::add_attention($msg, __FILE__, __FUNCTION__, __LINE__); |
|
1533 | 1533 | return FALSE; |
1534 | 1534 | break; |
1535 | 1535 | |
1536 | 1536 | // not enough payment |
1537 | 1537 | case EEM_Payment::status_id_declined : |
1538 | - if ( empty( $msg )) { |
|
1538 | + if (empty($msg)) { |
|
1539 | 1539 | $msg = _n( |
1540 | 1540 | 'We\'re sorry but your payment was declined. Please try again.', |
1541 | 1541 | 'We\'re sorry but your payment was declined. Please try again or select another method of payment.', |
1542 | - count( $this->checkout->available_payment_methods ), |
|
1542 | + count($this->checkout->available_payment_methods), |
|
1543 | 1543 | 'event_espresso' |
1544 | 1544 | ); |
1545 | 1545 | } |
1546 | - EE_Error::add_attention( $msg, __FILE__, __FUNCTION__, __LINE__ ); |
|
1546 | + EE_Error::add_attention($msg, __FILE__, __FUNCTION__, __LINE__); |
|
1547 | 1547 | return FALSE; |
1548 | 1548 | break; |
1549 | 1549 | |
@@ -1556,14 +1556,14 @@ discard block |
||
1556 | 1556 | } |
1557 | 1557 | // off-site payment gateway responses are too unreliable, so let's just assume that |
1558 | 1558 | // the payment processing is just running slower than the registrant's request |
1559 | - if ( $payment_occurs == EE_PMT_Base::offsite ) { |
|
1559 | + if ($payment_occurs == EE_PMT_Base::offsite) { |
|
1560 | 1560 | return true; |
1561 | 1561 | } |
1562 | 1562 | EE_Error::add_error( |
1563 | 1563 | sprintf( |
1564 | - __( 'Your payment could not be processed successfully due to a technical issue.%sPlease try again or contact %s for assistance.', 'event_espresso' ), |
|
1564 | + __('Your payment could not be processed successfully due to a technical issue.%sPlease try again or contact %s for assistance.', 'event_espresso'), |
|
1565 | 1565 | '<br/>', |
1566 | - EE_Registry::instance()->CFG->organization->get_pretty( 'email' ) |
|
1566 | + EE_Registry::instance()->CFG->organization->get_pretty('email') |
|
1567 | 1567 | ), |
1568 | 1568 | __FILE__, __FUNCTION__, __LINE__ |
1569 | 1569 | ); |
@@ -1581,23 +1581,23 @@ discard block |
||
1581 | 1581 | public function get_transaction_details_for_gateways() { |
1582 | 1582 | $txn_details = array(); |
1583 | 1583 | // ya gotta make a choice man |
1584 | - if ( empty( $this->checkout->selected_method_of_payment ) ) { |
|
1584 | + if (empty($this->checkout->selected_method_of_payment)) { |
|
1585 | 1585 | $txn_details = array( |
1586 | - 'error' => __( 'Please select a method of payment before proceeding.', 'event_espresso' ) |
|
1586 | + 'error' => __('Please select a method of payment before proceeding.', 'event_espresso') |
|
1587 | 1587 | ); |
1588 | 1588 | } |
1589 | 1589 | // get EE_Payment_Method object |
1590 | 1590 | if ( |
1591 | - empty( $txn_details ) && |
|
1591 | + empty($txn_details) && |
|
1592 | 1592 | ! $this->checkout->payment_method = $this->_get_payment_method_for_selected_method_of_payment() |
1593 | 1593 | ) { |
1594 | 1594 | $txn_details = array( |
1595 | 1595 | 'selected_method_of_payment' => $this->checkout->selected_method_of_payment, |
1596 | - 'error' => __( 'A valid Payment Method could not be determined.', 'event_espresso' ) |
|
1596 | + 'error' => __('A valid Payment Method could not be determined.', 'event_espresso') |
|
1597 | 1597 | ); |
1598 | 1598 | } |
1599 | - if ( empty( $txn_details ) && $this->checkout->transaction instanceof EE_Transaction ) { |
|
1600 | - $return_url = $this->_get_return_url( $this->checkout->payment_method ); |
|
1599 | + if (empty($txn_details) && $this->checkout->transaction instanceof EE_Transaction) { |
|
1600 | + $return_url = $this->_get_return_url($this->checkout->payment_method); |
|
1601 | 1601 | $txn_details = array( |
1602 | 1602 | 'TXN_ID' => $this->checkout->transaction->ID(), |
1603 | 1603 | 'TXN_timestamp' => $this->checkout->transaction->datetime(), |
@@ -1607,7 +1607,7 @@ discard block |
||
1607 | 1607 | 'STS_ID' => $this->checkout->transaction->status_ID(), |
1608 | 1608 | 'PMD_ID' => $this->checkout->transaction->payment_method_ID(), |
1609 | 1609 | 'return_url' => $return_url, |
1610 | - 'cancel_url' => add_query_arg( array( 'ee_cancel_payment' => true ), $return_url ), |
|
1610 | + 'cancel_url' => add_query_arg(array('ee_cancel_payment' => true), $return_url), |
|
1611 | 1611 | 'notify_url' => EE_Config::instance()->core->txn_page_url( |
1612 | 1612 | array( |
1613 | 1613 | 'e_reg_url_link' => $this->checkout->transaction->primary_registration()->reg_url_link(), |
@@ -1616,7 +1616,7 @@ discard block |
||
1616 | 1616 | ) |
1617 | 1617 | ); |
1618 | 1618 | } |
1619 | - echo json_encode( $txn_details ); |
|
1619 | + echo json_encode($txn_details); |
|
1620 | 1620 | exit(); |
1621 | 1621 | } |
1622 | 1622 |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <p id="spco-attendee_information-pg" class="spco-steps-pg small-text drk-grey-text"> |
2 | - <?php echo apply_filters( 'FHEE__registration_page_attendee_information__attendee_information_pg', sprintf( __('In order to process your registration, we ask you to provide the following information.%1$sPlease note that all fields marked with an asterisk (%2$s) are required.', 'event_espresso'), '<br />', '<span class="asterisk">*</span>' )); ?> |
|
2 | + <?php echo apply_filters('FHEE__registration_page_attendee_information__attendee_information_pg', sprintf(__('In order to process your registration, we ask you to provide the following information.%1$sPlease note that all fields marked with an asterisk (%2$s) are required.', 'event_espresso'), '<br />', '<span class="asterisk">*</span>')); ?> |
|
3 | 3 | </p> |
4 | 4 | |
5 | 5 | <?php |
@@ -7,40 +7,40 @@ discard block |
||
7 | 7 | $prev_event = ''; |
8 | 8 | $prev_ticket = ''; |
9 | 9 | |
10 | -if ( count( $registrations ) > 0 ) { |
|
11 | - foreach ( $registrations as $registration ) { |
|
12 | - if ( $registration instanceof EE_Registration ) { |
|
10 | +if (count($registrations) > 0) { |
|
11 | + foreach ($registrations as $registration) { |
|
12 | + if ($registration instanceof EE_Registration) { |
|
13 | 13 | $att_nmbr++; |
14 | 14 | ?> |
15 | 15 | |
16 | - <div id="spco-attendee-panel-dv-<?php echo $registration->reg_url_link();?>" class="spco-attendee-panel-dv"> |
|
16 | + <div id="spco-attendee-panel-dv-<?php echo $registration->reg_url_link(); ?>" class="spco-attendee-panel-dv"> |
|
17 | 17 | |
18 | - <?php if ( $registration->event()->ID() != $prev_event ) { ?> |
|
18 | + <?php if ($registration->event()->ID() != $prev_event) { ?> |
|
19 | 19 | <h4 id="event_title-<?php echo $registration->event()->ID() ?>" class="big-event-title-hdr"> |
20 | 20 | <?php echo $registration->event()->name(); ?> |
21 | 21 | </h4> |
22 | 22 | <?php } ?> |
23 | - <?php if ( $registration->ticket()->ID() != $prev_ticket ) { ?> |
|
24 | - <?php if ( ! $revisit ) { ?> |
|
23 | + <?php if ($registration->ticket()->ID() != $prev_ticket) { ?> |
|
24 | + <?php if ( ! $revisit) { ?> |
|
25 | 25 | <div class="spco-ticket-info-dv small-text"> |
26 | - <h5><?php _e('Ticket Details', 'event_espresso');?></h5> |
|
26 | + <h5><?php _e('Ticket Details', 'event_espresso'); ?></h5> |
|
27 | 27 | <table> |
28 | 28 | <tr> |
29 | - <th scope="col" width=""><?php _e('Ticket Name and Description', 'event_espresso');?></th> |
|
30 | - <th scope="col" width="7.5%" class="jst-cntr"><?php _e('Qty', 'event_espresso');?></th> |
|
31 | - <th scope="col" width="17.5%" class="jst-cntr"><?php _e('Price', 'event_espresso');?></th> |
|
32 | - <th scope="col" width="17.5%" class="jst-cntr"><?php _e('Total', 'event_espresso');?></th> |
|
29 | + <th scope="col" width=""><?php _e('Ticket Name and Description', 'event_espresso'); ?></th> |
|
30 | + <th scope="col" width="7.5%" class="jst-cntr"><?php _e('Qty', 'event_espresso'); ?></th> |
|
31 | + <th scope="col" width="17.5%" class="jst-cntr"><?php _e('Price', 'event_espresso'); ?></th> |
|
32 | + <th scope="col" width="17.5%" class="jst-cntr"><?php _e('Total', 'event_espresso'); ?></th> |
|
33 | 33 | </tr> |
34 | 34 | <tr> |
35 | 35 | <td> |
36 | 36 | <?php |
37 | - echo '<span class="spco-ticket-info-name">' . $registration->ticket()->name() . '</span>'; |
|
38 | - echo $registration->ticket()->description() ? '<br/><span class="spco-ticket-info-description">' . $registration->ticket()->description() . '</span>' : ''; |
|
37 | + echo '<span class="spco-ticket-info-name">'.$registration->ticket()->name().'</span>'; |
|
38 | + echo $registration->ticket()->description() ? '<br/><span class="spco-ticket-info-description">'.$registration->ticket()->description().'</span>' : ''; |
|
39 | 39 | ?> |
40 | 40 | </td> |
41 | - <td class="jst-cntr"><?php echo $ticket_count[ $registration->ticket()->ID() ];?></td> |
|
42 | - <td class="jst-rght"><?php echo EEH_Template::format_currency( $registration->ticket()->price() );?></td> |
|
43 | - <td class="jst-rght"><?php echo EEH_Template::format_currency( $registration->ticket()->price() * $ticket_count[ $registration->ticket()->ID() ] );?></td> |
|
41 | + <td class="jst-cntr"><?php echo $ticket_count[$registration->ticket()->ID()]; ?></td> |
|
42 | + <td class="jst-rght"><?php echo EEH_Template::format_currency($registration->ticket()->price()); ?></td> |
|
43 | + <td class="jst-rght"><?php echo EEH_Template::format_currency($registration->ticket()->price() * $ticket_count[$registration->ticket()->ID()]); ?></td> |
|
44 | 44 | </tr> |
45 | 45 | </table> |
46 | 46 | </div> |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | |
50 | 50 | <?php |
51 | 51 | // ATTENDEE QUESTIONS |
52 | - $reg_form = EE_Template_Layout::get_subform_name( $registration->reg_url_link() ); |
|
52 | + $reg_form = EE_Template_Layout::get_subform_name($registration->reg_url_link()); |
|
53 | 53 | echo ${$reg_form}; |
54 | 54 | ?> |
55 | 55 |