@@ -1,10 +1,10 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | add_filter('FHEE__EEH_Form_Fields__label_html', '__return_empty_string'); |
| 3 | 3 | $values = EEH_Form_Fields::prep_answer_options( |
| 4 | - array( |
|
| 5 | - array('id' => 1, 'text' => __('Yes', 'event_espresso')), |
|
| 6 | - array('id' => 0, 'text' => __('No', 'event_espresso')), |
|
| 7 | - ) |
|
| 4 | + array( |
|
| 5 | + array('id' => 1, 'text' => __('Yes', 'event_espresso')), |
|
| 6 | + array('id' => 0, 'text' => __('No', 'event_espresso')), |
|
| 7 | + ) |
|
| 8 | 8 | ); |
| 9 | 9 | ?> |
| 10 | 10 | |
@@ -12,9 +12,9 @@ discard block |
||
| 12 | 12 | |
| 13 | 13 | <h2 class="ee-admin-settings-hdr"> |
| 14 | 14 | <?php _e( |
| 15 | - 'Single Event Pages', |
|
| 16 | - 'event_espresso' |
|
| 17 | - ); ?><?php // echo EEH_Template::get_help_tab_link('event_single_settings_info');?> |
|
| 15 | + 'Single Event Pages', |
|
| 16 | + 'event_espresso' |
|
| 17 | + ); ?><?php // echo EEH_Template::get_help_tab_link('event_single_settings_info');?> |
|
| 18 | 18 | </h2> |
| 19 | 19 | <table class="form-table"> |
| 20 | 20 | <tbody> |
@@ -26,17 +26,17 @@ discard block |
||
| 26 | 26 | </th> |
| 27 | 27 | <td> |
| 28 | 28 | <?php echo EEH_Form_Fields::select( |
| 29 | - 'display_status_banner_single', |
|
| 30 | - $display_status_banner_single, |
|
| 31 | - $values, |
|
| 32 | - 'display_status_banner_single', |
|
| 33 | - 'display_status_banner_single' |
|
| 34 | - ); ?> |
|
| 29 | + 'display_status_banner_single', |
|
| 30 | + $display_status_banner_single, |
|
| 31 | + $values, |
|
| 32 | + 'display_status_banner_single', |
|
| 33 | + 'display_status_banner_single' |
|
| 34 | + ); ?> |
|
| 35 | 35 | <p class="description"><?php |
| 36 | - _e( |
|
| 37 | - 'Selecting "Yes" will inject an Event Status banner with the title whenever Events are displaying on the single event page.', |
|
| 38 | - 'event_espresso' |
|
| 39 | - ); ?></p> |
|
| 36 | + _e( |
|
| 37 | + 'Selecting "Yes" will inject an Event Status banner with the title whenever Events are displaying on the single event page.', |
|
| 38 | + 'event_espresso' |
|
| 39 | + ); ?></p> |
|
| 40 | 40 | </td> |
| 41 | 41 | </tr> |
| 42 | 42 | |
@@ -44,23 +44,23 @@ discard block |
||
| 44 | 44 | <th> |
| 45 | 45 | <label for="display_venue"> |
| 46 | 46 | <?php _e('Display Venue Details', 'event_espresso'); ?><?php echo EEH_Template::get_help_tab_link( |
| 47 | - 'display_addresses_in_reg_form_info' |
|
| 48 | - ); ?> |
|
| 47 | + 'display_addresses_in_reg_form_info' |
|
| 48 | + ); ?> |
|
| 49 | 49 | </label> |
| 50 | 50 | </th> |
| 51 | 51 | <td> |
| 52 | 52 | <?php echo EEH_Form_Fields::select( |
| 53 | - 'display_venue', |
|
| 54 | - $display_venue, |
|
| 55 | - $values, |
|
| 56 | - 'display_venue', |
|
| 57 | - 'display_venue' |
|
| 58 | - ); ?> |
|
| 53 | + 'display_venue', |
|
| 54 | + $display_venue, |
|
| 55 | + $values, |
|
| 56 | + 'display_venue', |
|
| 57 | + 'display_venue' |
|
| 58 | + ); ?> |
|
| 59 | 59 | <p class="description"><?php |
| 60 | - _e( |
|
| 61 | - 'Do not use this if you are using the venue shortcodes in your event description.', |
|
| 62 | - 'event_espresso' |
|
| 63 | - ); ?></p> |
|
| 60 | + _e( |
|
| 61 | + 'Do not use this if you are using the venue shortcodes in your event description.', |
|
| 62 | + 'event_espresso' |
|
| 63 | + ); ?></p> |
|
| 64 | 64 | </td> |
| 65 | 65 | </tr> |
| 66 | 66 | |
@@ -72,26 +72,26 @@ discard block |
||
| 72 | 72 | </th> |
| 73 | 73 | <td> |
| 74 | 74 | <?php |
| 75 | - echo EEH_Form_Fields::select( |
|
| 76 | - 'use_sortable_display_order', |
|
| 77 | - $use_sortable_display_order, |
|
| 78 | - $values, |
|
| 79 | - 'EED_Events_Single_use_sortable_display_order', |
|
| 80 | - 'EED_Events_Single_use_sortable_display_order' |
|
| 81 | - ); |
|
| 82 | - ?> |
|
| 75 | + echo EEH_Form_Fields::select( |
|
| 76 | + 'use_sortable_display_order', |
|
| 77 | + $use_sortable_display_order, |
|
| 78 | + $values, |
|
| 79 | + 'EED_Events_Single_use_sortable_display_order', |
|
| 80 | + 'EED_Events_Single_use_sortable_display_order' |
|
| 81 | + ); |
|
| 82 | + ?> |
|
| 83 | 83 | <p class="description "> |
| 84 | 84 | <?php |
| 85 | - echo sprintf( |
|
| 86 | - __( |
|
| 87 | - '%1$sPlease Note:%2$s%3$sIf you are currently using filters to customize the display order for elements within the Event Single page display, then you do NOT activate this feature until those filters have been removed or disabled. If this feature is activated while still using such filters, duplicate event content such as the ticket selector, datetimes, or venue information could be displayed on the frontend of the site. Please verify that this is not the case after activating this feature.', |
|
| 88 | - 'event_espresso' |
|
| 89 | - ), |
|
| 90 | - '<span class="important-notice">', |
|
| 91 | - '</span>', |
|
| 92 | - '<br />' |
|
| 93 | - ); |
|
| 94 | - ?> |
|
| 85 | + echo sprintf( |
|
| 86 | + __( |
|
| 87 | + '%1$sPlease Note:%2$s%3$sIf you are currently using filters to customize the display order for elements within the Event Single page display, then you do NOT activate this feature until those filters have been removed or disabled. If this feature is activated while still using such filters, duplicate event content such as the ticket selector, datetimes, or venue information could be displayed on the frontend of the site. Please verify that this is not the case after activating this feature.', |
|
| 88 | + 'event_espresso' |
|
| 89 | + ), |
|
| 90 | + '<span class="important-notice">', |
|
| 91 | + '</span>', |
|
| 92 | + '<br />' |
|
| 93 | + ); |
|
| 94 | + ?> |
|
| 95 | 95 | </p> |
| 96 | 96 | </td> |
| 97 | 97 | </tr> |
@@ -99,23 +99,23 @@ discard block |
||
| 99 | 99 | <tr> |
| 100 | 100 | <th> |
| 101 | 101 | <?php _e('Display Order', 'event_espresso'); ?><?php echo EEH_Template::get_help_tab_link( |
| 102 | - 'display_addresses_in_reg_form_info' |
|
| 103 | - ); ?> |
|
| 102 | + 'display_addresses_in_reg_form_info' |
|
| 103 | + ); ?> |
|
| 104 | 104 | </th> |
| 105 | 105 | <td> |
| 106 | 106 | |
| 107 | 107 | <?php wp_nonce_field( |
| 108 | - 'espresso_update_event_single_order', |
|
| 109 | - 'espresso_update_event_single_order_nonce', |
|
| 110 | - false |
|
| 111 | - ); ?> |
|
| 108 | + 'espresso_update_event_single_order', |
|
| 109 | + 'espresso_update_event_single_order_nonce', |
|
| 110 | + false |
|
| 111 | + ); ?> |
|
| 112 | 112 | <?php echo $event_single_display_order; ?> |
| 113 | 113 | |
| 114 | 114 | <p class="description"><?php |
| 115 | - _e( |
|
| 116 | - 'Drag and Drop the above to determine the display order of the Event Description, Date and Times, Ticket Selector, and Venue Information on the single event page.', |
|
| 117 | - 'event_espresso' |
|
| 118 | - ); ?></p> |
|
| 115 | + _e( |
|
| 116 | + 'Drag and Drop the above to determine the display order of the Event Description, Date and Times, Ticket Selector, and Venue Information on the single event page.', |
|
| 117 | + 'event_espresso' |
|
| 118 | + ); ?></p> |
|
| 119 | 119 | |
| 120 | 120 | </td> |
| 121 | 121 | </tr> |
@@ -12,170 +12,170 @@ |
||
| 12 | 12 | class EE_PMT_Paypal_Pro extends EE_PMT_Base |
| 13 | 13 | { |
| 14 | 14 | |
| 15 | - /** |
|
| 16 | - * @param EE_Payment_Method $pm_instance |
|
| 17 | - * @return EE_PMT_Paypal_Pro |
|
| 18 | - */ |
|
| 19 | - public function __construct($pm_instance = null) |
|
| 20 | - { |
|
| 21 | - require_once($this->file_folder().'EEG_Paypal_Pro.gateway.php'); |
|
| 22 | - $this->_gateway = new EEG_Paypal_Pro(); |
|
| 23 | - $this->_pretty_name = __("Paypal Pro", 'event_espresso'); |
|
| 24 | - $this->_default_description = __('Please provide the following billing information.', 'event_espresso'); |
|
| 25 | - $this->_requires_https = true; |
|
| 26 | - parent::__construct($pm_instance); |
|
| 27 | - } |
|
| 28 | - |
|
| 29 | - |
|
| 30 | - |
|
| 31 | - /** |
|
| 32 | - * Gets the form for all the settings related to this payment method type |
|
| 33 | - * @return EE_Payment_Method_Form |
|
| 34 | - */ |
|
| 35 | - public function generate_new_settings_form() |
|
| 36 | - { |
|
| 37 | - return new EE_Payment_Method_Form(array( |
|
| 38 | - 'extra_meta_inputs'=>array( |
|
| 15 | + /** |
|
| 16 | + * @param EE_Payment_Method $pm_instance |
|
| 17 | + * @return EE_PMT_Paypal_Pro |
|
| 18 | + */ |
|
| 19 | + public function __construct($pm_instance = null) |
|
| 20 | + { |
|
| 21 | + require_once($this->file_folder().'EEG_Paypal_Pro.gateway.php'); |
|
| 22 | + $this->_gateway = new EEG_Paypal_Pro(); |
|
| 23 | + $this->_pretty_name = __("Paypal Pro", 'event_espresso'); |
|
| 24 | + $this->_default_description = __('Please provide the following billing information.', 'event_espresso'); |
|
| 25 | + $this->_requires_https = true; |
|
| 26 | + parent::__construct($pm_instance); |
|
| 27 | + } |
|
| 28 | + |
|
| 29 | + |
|
| 30 | + |
|
| 31 | + /** |
|
| 32 | + * Gets the form for all the settings related to this payment method type |
|
| 33 | + * @return EE_Payment_Method_Form |
|
| 34 | + */ |
|
| 35 | + public function generate_new_settings_form() |
|
| 36 | + { |
|
| 37 | + return new EE_Payment_Method_Form(array( |
|
| 38 | + 'extra_meta_inputs'=>array( |
|
| 39 | 39 | // 'paypal_email'=>new EE_Email_Input(), not actually used |
| 40 | - 'username'=>new EE_Text_Input(array( |
|
| 41 | - 'html_label_text'=> sprintf(__("Paypal API Username %s", "event_espresso"), $this->get_help_tab_link()), |
|
| 42 | - 'required' => true |
|
| 43 | - )), |
|
| 44 | - 'password'=>new EE_Text_Input(array( |
|
| 45 | - 'html_label_text'=> sprintf(__("Paypal API Password %s", "event_espresso"), $this->get_help_tab_link()), |
|
| 46 | - 'required' => true |
|
| 47 | - )), |
|
| 48 | - 'signature'=>new EE_Text_Input(array( |
|
| 49 | - 'html_label_text'=> sprintf(__("Paypal API Signature %s", "event_espresso"), $this->get_help_tab_link()), |
|
| 50 | - 'required' => true |
|
| 51 | - )), |
|
| 52 | - 'credit_card_types'=>new EE_Checkbox_Multi_Input( |
|
| 53 | - $this->card_types_supported(), |
|
| 54 | - array( |
|
| 55 | - 'html_label_text' => __('Card Types Supported', 'event_espresso'), |
|
| 56 | - 'required' => true ) |
|
| 57 | - ), |
|
| 58 | - ) |
|
| 59 | - )); |
|
| 60 | - } |
|
| 61 | - |
|
| 62 | - |
|
| 63 | - /** |
|
| 64 | - * Creates the billing form for this payment method type |
|
| 65 | - * @param \EE_Transaction $transaction |
|
| 66 | - * @throws \EE_Error |
|
| 67 | - * @return EE_Billing_Info_Form |
|
| 68 | - */ |
|
| 69 | - public function generate_new_billing_form(EE_Transaction $transaction = null) |
|
| 70 | - { |
|
| 71 | - $allowed_types = $this->_pm_instance->get_extra_meta('credit_card_types', true); |
|
| 72 | - // if allowed types is a string or empty array or null... |
|
| 73 | - if (empty($allowed_types)) { |
|
| 74 | - $allowed_types = array(); |
|
| 75 | - } |
|
| 76 | - |
|
| 77 | - $billing_form = new EE_Billing_Attendee_Info_Form( |
|
| 78 | - $this->_pm_instance, |
|
| 79 | - array( |
|
| 80 | - 'name'=> 'Paypal_Pro_Billing_Form', |
|
| 81 | - // 'html_id'=> 'ee-Paypal_Pro-billing-form', |
|
| 82 | - 'subsections'=>array( |
|
| 83 | - 'credit_card'=>new EE_Credit_Card_Input( |
|
| 84 | - array( 'required'=>true, 'html_class' => 'ee-billing-qstn', 'html_label_text' => __('Card Number', 'event_espresso')) |
|
| 85 | - ), |
|
| 86 | - 'credit_card_type'=>new EE_Select_Input( |
|
| 87 | - // the options are set dynamically |
|
| 88 | - array_intersect_key(EE_PMT_Paypal_Pro::card_types_supported(), array_flip($allowed_types)), |
|
| 89 | - array( 'required'=>true, 'html_class' => 'ee-billing-qstn', 'html_label_text' => __('Card Type', 'event_espresso')) |
|
| 90 | - ), |
|
| 91 | - 'exp_month'=>new EE_Credit_Card_Month_Input( |
|
| 92 | - true, |
|
| 93 | - array( 'required'=>true, 'html_class' => 'ee-billing-qstn', 'html_label_text' => __('Expiry Month', 'event_espresso') ) |
|
| 94 | - ), |
|
| 95 | - 'exp_year'=>new EE_Credit_Card_Year_Input( |
|
| 96 | - array( 'required'=>true, 'html_class' => 'ee-billing-qstn', 'html_label_text' => __('Expiry Year', 'event_espresso') ) |
|
| 97 | - ), |
|
| 98 | - 'cvv'=>new EE_CVV_Input( |
|
| 99 | - array( 'required'=>true, 'html_class' => 'ee-billing-qstn', 'html_label_text' => __('CVV', 'event_espresso') ) |
|
| 100 | - ), |
|
| 101 | - ) |
|
| 102 | - ) |
|
| 103 | - ); |
|
| 104 | - return $this->apply_billing_form_debug_settings($billing_form); |
|
| 105 | - } |
|
| 106 | - |
|
| 107 | - |
|
| 108 | - |
|
| 109 | - /** |
|
| 110 | - * apply_billing_form_debug_settings |
|
| 111 | - * applies debug data to the form |
|
| 112 | - * |
|
| 113 | - * @param \EE_Billing_Info_Form $billing_form |
|
| 114 | - * @return \EE_Billing_Info_Form |
|
| 115 | - */ |
|
| 116 | - public function apply_billing_form_debug_settings(EE_Billing_Info_Form $billing_form) |
|
| 117 | - { |
|
| 118 | - if ($this->_pm_instance->debug_mode()) { |
|
| 119 | - $billing_form->add_subsections( |
|
| 120 | - array( 'fyi_about_autofill' => $billing_form->payment_fields_autofilled_notice_html() ), |
|
| 121 | - 'credit_card' |
|
| 122 | - ); |
|
| 123 | - $billing_form->add_subsections( |
|
| 124 | - array( 'debug_content' => new EE_Form_Section_HTML_From_Template(dirname(__FILE__).DS.'templates'.DS.'paypal_pro_debug_info.template.php')), |
|
| 125 | - 'first_name' |
|
| 126 | - ); |
|
| 127 | - $billing_form->get_input('credit_card_type')->set_default('Visa'); |
|
| 128 | - $billing_form->get_input('exp_year')->set_default(2018); |
|
| 129 | - $billing_form->get_input('cvv')->set_default('115'); |
|
| 130 | - } |
|
| 131 | - return $billing_form; |
|
| 132 | - } |
|
| 133 | - |
|
| 134 | - |
|
| 135 | - |
|
| 136 | - /** |
|
| 137 | - * Returns an array of all the payment cards possibly supported by paypal pro. |
|
| 138 | - * Keys are their values, values are their pretty names. |
|
| 139 | - * @return array |
|
| 140 | - */ |
|
| 141 | - public static function card_types_supported() |
|
| 142 | - { |
|
| 143 | - return array( |
|
| 144 | - 'Visa'=> __("Visa", 'event_espresso'), |
|
| 145 | - 'MasterCard'=> __("MasterCard", 'event_espresso'), |
|
| 146 | - 'Amex'=> __("American Express", 'event_espresso'), |
|
| 147 | - 'Discover'=> __("Discover", 'event_espresso') |
|
| 148 | - ); |
|
| 149 | - } |
|
| 150 | - |
|
| 151 | - |
|
| 152 | - |
|
| 153 | - /** |
|
| 154 | - * Adds the help tab |
|
| 155 | - * @see EE_PMT_Base::help_tabs_config() |
|
| 156 | - * @return array |
|
| 157 | - */ |
|
| 158 | - public function help_tabs_config() |
|
| 159 | - { |
|
| 160 | - return array( |
|
| 161 | - $this->get_help_tab_name() => array( |
|
| 162 | - 'title' => __('PayPal Pro Settings', 'event_espresso'), |
|
| 163 | - 'filename' => 'payment_methods_overview_paypalpro' |
|
| 164 | - ), |
|
| 165 | - ); |
|
| 166 | - } |
|
| 167 | - |
|
| 168 | - /** |
|
| 169 | - * Overrides parent's _get_billing_values_from_form because we want to |
|
| 170 | - * get the country's 2-character ISO code, not the name like most gateways |
|
| 171 | - * @param EE_Billing_Info_Form $billing_form |
|
| 172 | - * @return array |
|
| 173 | - */ |
|
| 174 | - protected function _get_billing_values_from_form($billing_form) |
|
| 175 | - { |
|
| 176 | - $billing_values = parent::_get_billing_values_from_form($billing_form); |
|
| 177 | - $billing_values['country'] = $billing_form->get_input_value('country'); |
|
| 178 | - $billing_values['credit_card_type'] = $billing_form->get_input_value('credit_card_type'); |
|
| 179 | - return $billing_values; |
|
| 180 | - } |
|
| 40 | + 'username'=>new EE_Text_Input(array( |
|
| 41 | + 'html_label_text'=> sprintf(__("Paypal API Username %s", "event_espresso"), $this->get_help_tab_link()), |
|
| 42 | + 'required' => true |
|
| 43 | + )), |
|
| 44 | + 'password'=>new EE_Text_Input(array( |
|
| 45 | + 'html_label_text'=> sprintf(__("Paypal API Password %s", "event_espresso"), $this->get_help_tab_link()), |
|
| 46 | + 'required' => true |
|
| 47 | + )), |
|
| 48 | + 'signature'=>new EE_Text_Input(array( |
|
| 49 | + 'html_label_text'=> sprintf(__("Paypal API Signature %s", "event_espresso"), $this->get_help_tab_link()), |
|
| 50 | + 'required' => true |
|
| 51 | + )), |
|
| 52 | + 'credit_card_types'=>new EE_Checkbox_Multi_Input( |
|
| 53 | + $this->card_types_supported(), |
|
| 54 | + array( |
|
| 55 | + 'html_label_text' => __('Card Types Supported', 'event_espresso'), |
|
| 56 | + 'required' => true ) |
|
| 57 | + ), |
|
| 58 | + ) |
|
| 59 | + )); |
|
| 60 | + } |
|
| 61 | + |
|
| 62 | + |
|
| 63 | + /** |
|
| 64 | + * Creates the billing form for this payment method type |
|
| 65 | + * @param \EE_Transaction $transaction |
|
| 66 | + * @throws \EE_Error |
|
| 67 | + * @return EE_Billing_Info_Form |
|
| 68 | + */ |
|
| 69 | + public function generate_new_billing_form(EE_Transaction $transaction = null) |
|
| 70 | + { |
|
| 71 | + $allowed_types = $this->_pm_instance->get_extra_meta('credit_card_types', true); |
|
| 72 | + // if allowed types is a string or empty array or null... |
|
| 73 | + if (empty($allowed_types)) { |
|
| 74 | + $allowed_types = array(); |
|
| 75 | + } |
|
| 76 | + |
|
| 77 | + $billing_form = new EE_Billing_Attendee_Info_Form( |
|
| 78 | + $this->_pm_instance, |
|
| 79 | + array( |
|
| 80 | + 'name'=> 'Paypal_Pro_Billing_Form', |
|
| 81 | + // 'html_id'=> 'ee-Paypal_Pro-billing-form', |
|
| 82 | + 'subsections'=>array( |
|
| 83 | + 'credit_card'=>new EE_Credit_Card_Input( |
|
| 84 | + array( 'required'=>true, 'html_class' => 'ee-billing-qstn', 'html_label_text' => __('Card Number', 'event_espresso')) |
|
| 85 | + ), |
|
| 86 | + 'credit_card_type'=>new EE_Select_Input( |
|
| 87 | + // the options are set dynamically |
|
| 88 | + array_intersect_key(EE_PMT_Paypal_Pro::card_types_supported(), array_flip($allowed_types)), |
|
| 89 | + array( 'required'=>true, 'html_class' => 'ee-billing-qstn', 'html_label_text' => __('Card Type', 'event_espresso')) |
|
| 90 | + ), |
|
| 91 | + 'exp_month'=>new EE_Credit_Card_Month_Input( |
|
| 92 | + true, |
|
| 93 | + array( 'required'=>true, 'html_class' => 'ee-billing-qstn', 'html_label_text' => __('Expiry Month', 'event_espresso') ) |
|
| 94 | + ), |
|
| 95 | + 'exp_year'=>new EE_Credit_Card_Year_Input( |
|
| 96 | + array( 'required'=>true, 'html_class' => 'ee-billing-qstn', 'html_label_text' => __('Expiry Year', 'event_espresso') ) |
|
| 97 | + ), |
|
| 98 | + 'cvv'=>new EE_CVV_Input( |
|
| 99 | + array( 'required'=>true, 'html_class' => 'ee-billing-qstn', 'html_label_text' => __('CVV', 'event_espresso') ) |
|
| 100 | + ), |
|
| 101 | + ) |
|
| 102 | + ) |
|
| 103 | + ); |
|
| 104 | + return $this->apply_billing_form_debug_settings($billing_form); |
|
| 105 | + } |
|
| 106 | + |
|
| 107 | + |
|
| 108 | + |
|
| 109 | + /** |
|
| 110 | + * apply_billing_form_debug_settings |
|
| 111 | + * applies debug data to the form |
|
| 112 | + * |
|
| 113 | + * @param \EE_Billing_Info_Form $billing_form |
|
| 114 | + * @return \EE_Billing_Info_Form |
|
| 115 | + */ |
|
| 116 | + public function apply_billing_form_debug_settings(EE_Billing_Info_Form $billing_form) |
|
| 117 | + { |
|
| 118 | + if ($this->_pm_instance->debug_mode()) { |
|
| 119 | + $billing_form->add_subsections( |
|
| 120 | + array( 'fyi_about_autofill' => $billing_form->payment_fields_autofilled_notice_html() ), |
|
| 121 | + 'credit_card' |
|
| 122 | + ); |
|
| 123 | + $billing_form->add_subsections( |
|
| 124 | + array( 'debug_content' => new EE_Form_Section_HTML_From_Template(dirname(__FILE__).DS.'templates'.DS.'paypal_pro_debug_info.template.php')), |
|
| 125 | + 'first_name' |
|
| 126 | + ); |
|
| 127 | + $billing_form->get_input('credit_card_type')->set_default('Visa'); |
|
| 128 | + $billing_form->get_input('exp_year')->set_default(2018); |
|
| 129 | + $billing_form->get_input('cvv')->set_default('115'); |
|
| 130 | + } |
|
| 131 | + return $billing_form; |
|
| 132 | + } |
|
| 133 | + |
|
| 134 | + |
|
| 135 | + |
|
| 136 | + /** |
|
| 137 | + * Returns an array of all the payment cards possibly supported by paypal pro. |
|
| 138 | + * Keys are their values, values are their pretty names. |
|
| 139 | + * @return array |
|
| 140 | + */ |
|
| 141 | + public static function card_types_supported() |
|
| 142 | + { |
|
| 143 | + return array( |
|
| 144 | + 'Visa'=> __("Visa", 'event_espresso'), |
|
| 145 | + 'MasterCard'=> __("MasterCard", 'event_espresso'), |
|
| 146 | + 'Amex'=> __("American Express", 'event_espresso'), |
|
| 147 | + 'Discover'=> __("Discover", 'event_espresso') |
|
| 148 | + ); |
|
| 149 | + } |
|
| 150 | + |
|
| 151 | + |
|
| 152 | + |
|
| 153 | + /** |
|
| 154 | + * Adds the help tab |
|
| 155 | + * @see EE_PMT_Base::help_tabs_config() |
|
| 156 | + * @return array |
|
| 157 | + */ |
|
| 158 | + public function help_tabs_config() |
|
| 159 | + { |
|
| 160 | + return array( |
|
| 161 | + $this->get_help_tab_name() => array( |
|
| 162 | + 'title' => __('PayPal Pro Settings', 'event_espresso'), |
|
| 163 | + 'filename' => 'payment_methods_overview_paypalpro' |
|
| 164 | + ), |
|
| 165 | + ); |
|
| 166 | + } |
|
| 167 | + |
|
| 168 | + /** |
|
| 169 | + * Overrides parent's _get_billing_values_from_form because we want to |
|
| 170 | + * get the country's 2-character ISO code, not the name like most gateways |
|
| 171 | + * @param EE_Billing_Info_Form $billing_form |
|
| 172 | + * @return array |
|
| 173 | + */ |
|
| 174 | + protected function _get_billing_values_from_form($billing_form) |
|
| 175 | + { |
|
| 176 | + $billing_values = parent::_get_billing_values_from_form($billing_form); |
|
| 177 | + $billing_values['country'] = $billing_form->get_input_value('country'); |
|
| 178 | + $billing_values['credit_card_type'] = $billing_form->get_input_value('credit_card_type'); |
|
| 179 | + return $billing_values; |
|
| 180 | + } |
|
| 181 | 181 | } |
@@ -81,22 +81,22 @@ discard block |
||
| 81 | 81 | // 'html_id'=> 'ee-Paypal_Pro-billing-form', |
| 82 | 82 | 'subsections'=>array( |
| 83 | 83 | 'credit_card'=>new EE_Credit_Card_Input( |
| 84 | - array( 'required'=>true, 'html_class' => 'ee-billing-qstn', 'html_label_text' => __('Card Number', 'event_espresso')) |
|
| 84 | + array('required'=>true, 'html_class' => 'ee-billing-qstn', 'html_label_text' => __('Card Number', 'event_espresso')) |
|
| 85 | 85 | ), |
| 86 | 86 | 'credit_card_type'=>new EE_Select_Input( |
| 87 | 87 | // the options are set dynamically |
| 88 | 88 | array_intersect_key(EE_PMT_Paypal_Pro::card_types_supported(), array_flip($allowed_types)), |
| 89 | - array( 'required'=>true, 'html_class' => 'ee-billing-qstn', 'html_label_text' => __('Card Type', 'event_espresso')) |
|
| 89 | + array('required'=>true, 'html_class' => 'ee-billing-qstn', 'html_label_text' => __('Card Type', 'event_espresso')) |
|
| 90 | 90 | ), |
| 91 | 91 | 'exp_month'=>new EE_Credit_Card_Month_Input( |
| 92 | 92 | true, |
| 93 | - array( 'required'=>true, 'html_class' => 'ee-billing-qstn', 'html_label_text' => __('Expiry Month', 'event_espresso') ) |
|
| 93 | + array('required'=>true, 'html_class' => 'ee-billing-qstn', 'html_label_text' => __('Expiry Month', 'event_espresso')) |
|
| 94 | 94 | ), |
| 95 | 95 | 'exp_year'=>new EE_Credit_Card_Year_Input( |
| 96 | - array( 'required'=>true, 'html_class' => 'ee-billing-qstn', 'html_label_text' => __('Expiry Year', 'event_espresso') ) |
|
| 96 | + array('required'=>true, 'html_class' => 'ee-billing-qstn', 'html_label_text' => __('Expiry Year', 'event_espresso')) |
|
| 97 | 97 | ), |
| 98 | 98 | 'cvv'=>new EE_CVV_Input( |
| 99 | - array( 'required'=>true, 'html_class' => 'ee-billing-qstn', 'html_label_text' => __('CVV', 'event_espresso') ) |
|
| 99 | + array('required'=>true, 'html_class' => 'ee-billing-qstn', 'html_label_text' => __('CVV', 'event_espresso')) |
|
| 100 | 100 | ), |
| 101 | 101 | ) |
| 102 | 102 | ) |
@@ -117,11 +117,11 @@ discard block |
||
| 117 | 117 | { |
| 118 | 118 | if ($this->_pm_instance->debug_mode()) { |
| 119 | 119 | $billing_form->add_subsections( |
| 120 | - array( 'fyi_about_autofill' => $billing_form->payment_fields_autofilled_notice_html() ), |
|
| 120 | + array('fyi_about_autofill' => $billing_form->payment_fields_autofilled_notice_html()), |
|
| 121 | 121 | 'credit_card' |
| 122 | 122 | ); |
| 123 | 123 | $billing_form->add_subsections( |
| 124 | - array( 'debug_content' => new EE_Form_Section_HTML_From_Template(dirname(__FILE__).DS.'templates'.DS.'paypal_pro_debug_info.template.php')), |
|
| 124 | + array('debug_content' => new EE_Form_Section_HTML_From_Template(dirname(__FILE__).DS.'templates'.DS.'paypal_pro_debug_info.template.php')), |
|
| 125 | 125 | 'first_name' |
| 126 | 126 | ); |
| 127 | 127 | $billing_form->get_input('credit_card_type')->set_default('Visa'); |
@@ -4,10 +4,10 @@ discard block |
||
| 4 | 4 | </p> |
| 5 | 5 | <p> |
| 6 | 6 | <?php printf( |
| 7 | - __('See %1$shere%2$s for list of currencies supported by Paypal Pro.', 'event_espresso'), |
|
| 8 | - "<a href='https://www.paypal.com/multicurrency'>", |
|
| 9 | - "</a>" |
|
| 10 | - ); ?> |
|
| 7 | + __('See %1$shere%2$s for list of currencies supported by Paypal Pro.', 'event_espresso'), |
|
| 8 | + "<a href='https://www.paypal.com/multicurrency'>", |
|
| 9 | + "</a>" |
|
| 10 | + ); ?> |
|
| 11 | 11 | </p> |
| 12 | 12 | <p><strong><?php _e('PayPal Pro Settings', 'event_espresso'); ?></strong></p> |
| 13 | 13 | <ul> |
@@ -18,30 +18,30 @@ discard block |
||
| 18 | 18 | <li> |
| 19 | 19 | <strong><?php _e('PayPal API Username', 'event_espresso'); ?></strong><br/> |
| 20 | 20 | <?php _e( |
| 21 | - 'Enter your API Username for PayPal. Learn how to find your <a href="https://www.paypal.com/us/cgi-bin/webscr?cmd=xpt/cps/merchant/wppro/WPProIntegrationSteps-outside#SectionB" target="_blank">API Username</a>.', |
|
| 22 | - 'event_espresso' |
|
| 23 | - ); ?> |
|
| 21 | + 'Enter your API Username for PayPal. Learn how to find your <a href="https://www.paypal.com/us/cgi-bin/webscr?cmd=xpt/cps/merchant/wppro/WPProIntegrationSteps-outside#SectionB" target="_blank">API Username</a>.', |
|
| 22 | + 'event_espresso' |
|
| 23 | + ); ?> |
|
| 24 | 24 | </li> |
| 25 | 25 | <li> |
| 26 | 26 | <strong><?php _e('PayPal API Password', 'event_espresso'); ?></strong><br/> |
| 27 | 27 | <?php _e( |
| 28 | - 'Enter your API Password for PayPal. Learn how to find your <a href="https://www.paypal.com/us/cgi-bin/webscr?cmd=xpt/cps/merchant/wppro/WPProIntegrationSteps-outside#SectionB" target="_blank">API Password</a>.', |
|
| 29 | - 'event_espresso' |
|
| 30 | - ); ?> |
|
| 28 | + 'Enter your API Password for PayPal. Learn how to find your <a href="https://www.paypal.com/us/cgi-bin/webscr?cmd=xpt/cps/merchant/wppro/WPProIntegrationSteps-outside#SectionB" target="_blank">API Password</a>.', |
|
| 29 | + 'event_espresso' |
|
| 30 | + ); ?> |
|
| 31 | 31 | </li> |
| 32 | 32 | <li> |
| 33 | 33 | <strong><?php _e('PayPal API Signature', 'event_espresso'); ?></strong><br/> |
| 34 | 34 | <?php _e( |
| 35 | - 'Enter your API Signature for PayPal. Learn how to find your <a href="https://www.paypal.com/us/cgi-bin/webscr?cmd=xpt/cps/merchant/wppro/WPProIntegrationSteps-outside#SectionB" target="_blank">API Signature</a>.', |
|
| 36 | - 'event_espresso' |
|
| 37 | - ); ?> |
|
| 35 | + 'Enter your API Signature for PayPal. Learn how to find your <a href="https://www.paypal.com/us/cgi-bin/webscr?cmd=xpt/cps/merchant/wppro/WPProIntegrationSteps-outside#SectionB" target="_blank">API Signature</a>.', |
|
| 36 | + 'event_espresso' |
|
| 37 | + ); ?> |
|
| 38 | 38 | </li> |
| 39 | 39 | <li> |
| 40 | 40 | <strong><?php _e('Country Currency', 'event_espresso'); ?></strong><br/> |
| 41 | 41 | <?php _e( |
| 42 | - 'Select the currency for your country. Payments will be accepted in this currency.', |
|
| 43 | - 'event_espresso' |
|
| 44 | - ); ?> |
|
| 42 | + 'Select the currency for your country. Payments will be accepted in this currency.', |
|
| 43 | + 'event_espresso' |
|
| 44 | + ); ?> |
|
| 45 | 45 | </li> |
| 46 | 46 | <li> |
| 47 | 47 | <strong><?php _e('Accepted Card Types', 'event_espresso'); ?></strong><br/> |
@@ -50,9 +50,9 @@ discard block |
||
| 50 | 50 | <li> |
| 51 | 51 | <strong><?php _e('Use the Debugging Feature and the PayPal Sandbox', 'event_espresso'); ?></strong><br/> |
| 52 | 52 | <?php _e( |
| 53 | - 'Specify if you want to test the payment gateway by submitting a test transaction. If this option is enabled, be sure to enter your PayPal sandbox credentials in the fields above. Be sure to turn this setting off when you are done testing.', |
|
| 54 | - 'event_espresso' |
|
| 55 | - ); ?> |
|
| 53 | + 'Specify if you want to test the payment gateway by submitting a test transaction. If this option is enabled, be sure to enter your PayPal sandbox credentials in the fields above. Be sure to turn this setting off when you are done testing.', |
|
| 54 | + 'event_espresso' |
|
| 55 | + ); ?> |
|
| 56 | 56 | </li> |
| 57 | 57 | <li> |
| 58 | 58 | <strong><?php _e('Button Image URL', 'event_espresso'); ?></strong><br/> |
@@ -16,43 +16,43 @@ discard block |
||
| 16 | 16 | <div class="sandbox-panel"> |
| 17 | 17 | <h2 class="section-title"><?php _e('PayPal Sandbox Mode', 'event_espresso'); ?></h2> |
| 18 | 18 | <h3 style="color:#ff0000;"><?php |
| 19 | - _e( |
|
| 20 | - 'Debug Mode Is Turned On. Payments will not be processed', |
|
| 21 | - 'event_espresso' |
|
| 22 | - ); ?></h3> |
|
| 19 | + _e( |
|
| 20 | + 'Debug Mode Is Turned On. Payments will not be processed', |
|
| 21 | + 'event_espresso' |
|
| 22 | + ); ?></h3> |
|
| 23 | 23 | |
| 24 | 24 | <p class="test-credit-cards-info-pg" style="margin-bottom:0;"> |
| 25 | 25 | <strong><?php _e('Testing Guidelines', 'event_espresso'); ?></strong> |
| 26 | 26 | </p> |
| 27 | 27 | <ul style="margin:1em 2em 1.5em; line-height:1.2em;"> |
| 28 | 28 | <li><?php |
| 29 | - _e( |
|
| 30 | - 'While testing, use the credit card number associated with your sandbox account.', |
|
| 31 | - 'event_espresso' |
|
| 32 | - ); ?></li> |
|
| 29 | + _e( |
|
| 30 | + 'While testing, use the credit card number associated with your sandbox account.', |
|
| 31 | + 'event_espresso' |
|
| 32 | + ); ?></li> |
|
| 33 | 33 | <li><?php |
| 34 | - printf( |
|
| 35 | - __( |
|
| 36 | - 'To find the sandbox account\'s credit card, go to %1$s, then "Dashboard", then under Sandbox click "Accounts", then click your account and click "Profile", then in the popup that appears click on the "Funding" tab. Your testing card is listed there.', |
|
| 37 | - 'event_espresso' |
|
| 38 | - ), |
|
| 39 | - '<a href="http://developer.paypal.com">developer.paypal.com</a>' |
|
| 40 | - ); ?></li> |
|
| 34 | + printf( |
|
| 35 | + __( |
|
| 36 | + 'To find the sandbox account\'s credit card, go to %1$s, then "Dashboard", then under Sandbox click "Accounts", then click your account and click "Profile", then in the popup that appears click on the "Funding" tab. Your testing card is listed there.', |
|
| 37 | + 'event_espresso' |
|
| 38 | + ), |
|
| 39 | + '<a href="http://developer.paypal.com">developer.paypal.com</a>' |
|
| 40 | + ); ?></li> |
|
| 41 | 41 | <li><?php |
| 42 | - printf( |
|
| 43 | - __('CVV2 should be 115 (see %s PayPal\'s documentation for other special codes %s)', 'event_espresso'), |
|
| 44 | - '<a href="https://cms.paypal.com/ca/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_testing_SBTestErrorConditions#id108HH0RJ0TS" target="_blank">', |
|
| 45 | - '</a>' |
|
| 46 | - ); ?></li> |
|
| 42 | + printf( |
|
| 43 | + __('CVV2 should be 115 (see %s PayPal\'s documentation for other special codes %s)', 'event_espresso'), |
|
| 44 | + '<a href="https://cms.paypal.com/ca/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_testing_SBTestErrorConditions#id108HH0RJ0TS" target="_blank">', |
|
| 45 | + '</a>' |
|
| 46 | + ); ?></li> |
|
| 47 | 47 | </ul> |
| 48 | 48 | |
| 49 | 49 | <p class="test-credit-cards-info-pg"> |
| 50 | 50 | <strong><?php _e('Credit Card Numbers Used for Testing', 'event_espresso'); ?></strong><br/> |
| 51 | 51 | <span class="small-text"><?php |
| 52 | - _e( |
|
| 53 | - 'Use the following credit card numbers for testing. Any other card number produces a general failure.', |
|
| 54 | - 'event_espresso' |
|
| 55 | - ); ?></span> |
|
| 52 | + _e( |
|
| 53 | + 'Use the following credit card numbers for testing. Any other card number produces a general failure.', |
|
| 54 | + 'event_espresso' |
|
| 55 | + ); ?></span> |
|
| 56 | 56 | </p> |
| 57 | 57 | |
| 58 | 58 | <div class="tbl-wrap"> |
@@ -76,18 +76,18 @@ discard block |
||
| 76 | 76 | <p class="test-credit-cards-info-pg"> |
| 77 | 77 | <strong><?php _e('Testing Result Code Responses', 'event_espresso'); ?></strong><br/> |
| 78 | 78 | <span class="small-text"><?php |
| 79 | - printf( |
|
| 80 | - __( |
|
| 81 | - 'You can use the amount of the transaction to generate a particular result code (see %s PayPal\'s documentation%s). The table below lists the general guidelines for specifying amounts. IMPORTANT: before you attempt any of these, ensure your sandbox PayPal account has %s "Negative Testing" set to on%s. Also be aware that you can generate AVS errors by using certain strings in your address field, and CVV errors using certain CVV values. See %s this PayPal doc %s', |
|
| 82 | - 'event_espresso' |
|
| 83 | - ), |
|
| 84 | - "<a href='https://developer.paypal.com/docs/classic/api/errorcodes/#id09C3GA00GR1' target='_blank'>", |
|
| 85 | - "</a>", |
|
| 86 | - "<a href='https://docs.google.com/a/eventespresso.com/file/d/0B5P8GXTvZgfMNXNkZ2s5VUlHTUk/edit?usp=drivesdk' target='_blank'>", |
|
| 87 | - "</a>", |
|
| 88 | - "<a href='https://cms.paypal.com/ca/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_testing_SBTestErrorConditions' target='_blank'>", |
|
| 89 | - "</a>" |
|
| 90 | - ); ?></span> |
|
| 79 | + printf( |
|
| 80 | + __( |
|
| 81 | + 'You can use the amount of the transaction to generate a particular result code (see %s PayPal\'s documentation%s). The table below lists the general guidelines for specifying amounts. IMPORTANT: before you attempt any of these, ensure your sandbox PayPal account has %s "Negative Testing" set to on%s. Also be aware that you can generate AVS errors by using certain strings in your address field, and CVV errors using certain CVV values. See %s this PayPal doc %s', |
|
| 82 | + 'event_espresso' |
|
| 83 | + ), |
|
| 84 | + "<a href='https://developer.paypal.com/docs/classic/api/errorcodes/#id09C3GA00GR1' target='_blank'>", |
|
| 85 | + "</a>", |
|
| 86 | + "<a href='https://docs.google.com/a/eventespresso.com/file/d/0B5P8GXTvZgfMNXNkZ2s5VUlHTUk/edit?usp=drivesdk' target='_blank'>", |
|
| 87 | + "</a>", |
|
| 88 | + "<a href='https://cms.paypal.com/ca/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_testing_SBTestErrorConditions' target='_blank'>", |
|
| 89 | + "</a>" |
|
| 90 | + ); ?></span> |
|
| 91 | 91 | </p> |
| 92 | 92 | |
| 93 | 93 | <div class="tbl-wrap"> |
@@ -1,8 +1,8 @@ |
||
| 1 | 1 | <?php printf( |
| 2 | - esc_html__( |
|
| 3 | - 'PayPal Pro (Website Payments Pro) is an on-site payment method for accepting credit and debit cards and is available to event organizers in the United States, United Kingdom, and Canada. An account with PayPal is required to accept payments. Need a PayPal Pro account? Call 1-855-456-1338 or %1$sclick here to sign up for a merchant account%2$s.', |
|
| 4 | - 'event_espresso' |
|
| 5 | - ), |
|
| 6 | - '<a href="https://eventespresso.com/go/paypalpro/" target="_blank">', |
|
| 7 | - '</a>' |
|
| 2 | + esc_html__( |
|
| 3 | + 'PayPal Pro (Website Payments Pro) is an on-site payment method for accepting credit and debit cards and is available to event organizers in the United States, United Kingdom, and Canada. An account with PayPal is required to accept payments. Need a PayPal Pro account? Call 1-855-456-1338 or %1$sclick here to sign up for a merchant account%2$s.', |
|
| 4 | + 'event_espresso' |
|
| 5 | + ), |
|
| 6 | + '<a href="https://eventespresso.com/go/paypalpro/" target="_blank">', |
|
| 7 | + '</a>' |
|
| 8 | 8 | ); |
@@ -4,71 +4,71 @@ |
||
| 4 | 4 | </p> |
| 5 | 5 | <p> |
| 6 | 6 | <?php printf( |
| 7 | - __('See %1$shere%2$s for list of currencies supported by Authorize.net AIM.', 'event_espresso'), |
|
| 8 | - "<a href='http://www.authorize.net/international/' target='_blank'>", |
|
| 9 | - "</a>" |
|
| 10 | - ); ?> |
|
| 7 | + __('See %1$shere%2$s for list of currencies supported by Authorize.net AIM.', 'event_espresso'), |
|
| 8 | + "<a href='http://www.authorize.net/international/' target='_blank'>", |
|
| 9 | + "</a>" |
|
| 10 | + ); ?> |
|
| 11 | 11 | </p> |
| 12 | 12 | <p><strong><?php _e('Authorize.net AIM Settings', 'event_espresso'); ?></strong></p> |
| 13 | 13 | <ul> |
| 14 | 14 | <li> |
| 15 | 15 | <strong><?php _e('Authorize.net API Login ID', 'event_espresso'); ?></strong><br/> |
| 16 | 16 | <?php _e( |
| 17 | - 'Enter your API Login ID for Authorize.net. Learn how to find your <a href="https://support.authorize.net/authkb/index?page=content&id=A405" target="_blank">API Login ID</a>.', |
|
| 18 | - 'event_espresso' |
|
| 19 | - ); ?> |
|
| 17 | + 'Enter your API Login ID for Authorize.net. Learn how to find your <a href="https://support.authorize.net/authkb/index?page=content&id=A405" target="_blank">API Login ID</a>.', |
|
| 18 | + 'event_espresso' |
|
| 19 | + ); ?> |
|
| 20 | 20 | </li> |
| 21 | 21 | <li> |
| 22 | 22 | <strong><?php _e('Authorize.net Transaction Key', 'event_espresso'); ?></strong><br/> |
| 23 | 23 | <?php _e( |
| 24 | - 'Enter your Transaction Key for Authorize.net. Learn how to find your <a href="https://support.authorize.net/authkb/index?page=content&id=A405" target="_blank">Transaction Key</a>.', |
|
| 25 | - 'event_espresso' |
|
| 26 | - ); ?> |
|
| 24 | + 'Enter your Transaction Key for Authorize.net. Learn how to find your <a href="https://support.authorize.net/authkb/index?page=content&id=A405" target="_blank">Transaction Key</a>.', |
|
| 25 | + 'event_espresso' |
|
| 26 | + ); ?> |
|
| 27 | 27 | </li> |
| 28 | 28 | <li> |
| 29 | 29 | <strong> |
| 30 | 30 | <?php _e( |
| 31 | - 'Is this an account on the Authorize.net development server?', |
|
| 32 | - 'event_espresso' |
|
| 33 | - ); ?></strong><br/> |
|
| 31 | + 'Is this an account on the Authorize.net development server?', |
|
| 32 | + 'event_espresso' |
|
| 33 | + ); ?></strong><br/> |
|
| 34 | 34 | <?php _e( |
| 35 | - 'Specify whether this is a live/production account or a test account on the Authorize.net development server.', |
|
| 36 | - 'event_espresso' |
|
| 37 | - ); ?> |
|
| 35 | + 'Specify whether this is a live/production account or a test account on the Authorize.net development server.', |
|
| 36 | + 'event_espresso' |
|
| 37 | + ); ?> |
|
| 38 | 38 | </li> |
| 39 | 39 | <li> |
| 40 | 40 | <strong><?php _e('Do you want to submit a test transaction?', 'event_espresso'); ?></strong><br/> |
| 41 | 41 | <?php _e( |
| 42 | - 'Specify if you want to test the Authorize.net AIM payment gateway by submitting a test transaction. Be sure to turn this setting off when you are done testing.', |
|
| 43 | - 'event_espresso' |
|
| 44 | - ); ?> |
|
| 42 | + 'Specify if you want to test the Authorize.net AIM payment gateway by submitting a test transaction. Be sure to turn this setting off when you are done testing.', |
|
| 43 | + 'event_espresso' |
|
| 44 | + ); ?> |
|
| 45 | 45 | </li> |
| 46 | 46 | <li> |
| 47 | 47 | <strong><?php _e('Excluded and Required Payment Form Fields', 'event_espresso'); ?></strong><br/> |
| 48 | 48 | <?php _e( |
| 49 | - 'By logging into Authorize.net, you can change which payment fields are required by Authorize.net when processing payments. These settings affect both the Advanced Integration Method (AIM, this) and the Simple Integration Method (SIM, different). The payment method settings "Excluded Payment Form Fields" and "Required Payment Form Fields" allow you to change the billing form in Event Espresso to reflect your payment form settings in Authorize.net.', |
|
| 50 | - 'event_espresso' |
|
| 51 | - ); ?> |
|
| 49 | + 'By logging into Authorize.net, you can change which payment fields are required by Authorize.net when processing payments. These settings affect both the Advanced Integration Method (AIM, this) and the Simple Integration Method (SIM, different). The payment method settings "Excluded Payment Form Fields" and "Required Payment Form Fields" allow you to change the billing form in Event Espresso to reflect your payment form settings in Authorize.net.', |
|
| 50 | + 'event_espresso' |
|
| 51 | + ); ?> |
|
| 52 | 52 | <br> |
| 53 | 53 | <?php |
| 54 | - printf( |
|
| 55 | - __( |
|
| 56 | - 'To change your payment form settings in Authorize.net, %1$slog in to authorize.net%2$s, go to %3$sAccount then Payment Form%2$s, then %4$sForm Fields%2$s. It will look similar to %5$sthis%2$s. If you make a field required in Authorize.net, you should also make it required in Event Espresso. If it isn\'t required in Authorize.net, and you want to simplify the billing form in Event Espresso, you can exclude it from the Event Espresso Form too.', |
|
| 57 | - 'event_espresso' |
|
| 58 | - ), |
|
| 59 | - '<a href="http://authorize.net" target="_blank">', |
|
| 60 | - '</a>', |
|
| 61 | - '<a href="https://monosnap.com/file/nebVteOkEXcdDIos88SojStWOifP23" target="_blank">', |
|
| 62 | - '<a href="https://monosnap.com/file/WyxGJtev87TcDmdGBEZ2oi1xaBIQAm" target="_blank">', |
|
| 63 | - '<a href="https://monosnap.com/image/DbCJNfEesWXeSNUs1wLIpGYODFw52m" target="_blank">' |
|
| 64 | - ); ?> |
|
| 54 | + printf( |
|
| 55 | + __( |
|
| 56 | + 'To change your payment form settings in Authorize.net, %1$slog in to authorize.net%2$s, go to %3$sAccount then Payment Form%2$s, then %4$sForm Fields%2$s. It will look similar to %5$sthis%2$s. If you make a field required in Authorize.net, you should also make it required in Event Espresso. If it isn\'t required in Authorize.net, and you want to simplify the billing form in Event Espresso, you can exclude it from the Event Espresso Form too.', |
|
| 57 | + 'event_espresso' |
|
| 58 | + ), |
|
| 59 | + '<a href="http://authorize.net" target="_blank">', |
|
| 60 | + '</a>', |
|
| 61 | + '<a href="https://monosnap.com/file/nebVteOkEXcdDIos88SojStWOifP23" target="_blank">', |
|
| 62 | + '<a href="https://monosnap.com/file/WyxGJtev87TcDmdGBEZ2oi1xaBIQAm" target="_blank">', |
|
| 63 | + '<a href="https://monosnap.com/image/DbCJNfEesWXeSNUs1wLIpGYODFw52m" target="_blank">' |
|
| 64 | + ); ?> |
|
| 65 | 65 | </li> |
| 66 | 66 | <li> |
| 67 | 67 | <strong><?php _e('Server', 'event_espresso'); ?></strong> |
| 68 | 68 | <?php _e( |
| 69 | - 'Use this setting to change the server where Authorize.net AIM requests are sent. Change this to "Authorize.net/Akamai" before June 30th 2016 to verify your server wil work with Authorize.net\'s servers which will be in use after that date.', |
|
| 70 | - 'event_espresso' |
|
| 71 | - ); ?> |
|
| 69 | + 'Use this setting to change the server where Authorize.net AIM requests are sent. Change this to "Authorize.net/Akamai" before June 30th 2016 to verify your server wil work with Authorize.net\'s servers which will be in use after that date.', |
|
| 70 | + 'event_espresso' |
|
| 71 | + ); ?> |
|
| 72 | 72 | </li> |
| 73 | 73 | <li> |
| 74 | 74 | <strong><?php _e('Button Image URL', 'event_espresso'); ?></strong><br/> |
@@ -12,276 +12,276 @@ |
||
| 12 | 12 | { |
| 13 | 13 | |
| 14 | 14 | |
| 15 | - /** |
|
| 16 | - * @param EE_Payment_Method $pm_instance |
|
| 17 | - * @return EE_PMT_Aim |
|
| 18 | - * @throws \EE_Error |
|
| 19 | - */ |
|
| 20 | - public function __construct($pm_instance = null) |
|
| 21 | - { |
|
| 22 | - $this->_setup_properties(); |
|
| 23 | - parent::__construct($pm_instance); |
|
| 24 | - $this->_gateway->set_unsupported_character_remover(new \EventEspresso\core\services\formatters\Windows1252()); |
|
| 25 | - } |
|
| 15 | + /** |
|
| 16 | + * @param EE_Payment_Method $pm_instance |
|
| 17 | + * @return EE_PMT_Aim |
|
| 18 | + * @throws \EE_Error |
|
| 19 | + */ |
|
| 20 | + public function __construct($pm_instance = null) |
|
| 21 | + { |
|
| 22 | + $this->_setup_properties(); |
|
| 23 | + parent::__construct($pm_instance); |
|
| 24 | + $this->_gateway->set_unsupported_character_remover(new \EventEspresso\core\services\formatters\Windows1252()); |
|
| 25 | + } |
|
| 26 | 26 | |
| 27 | - /** |
|
| 28 | - * Sets up payment method type properties for this gateway, which is normally |
|
| 29 | - * done in the constructor, but we want this to be easy for similar gateways to override |
|
| 30 | - * while still calling the parent constructor. |
|
| 31 | - * So children should override this method instead of __construct |
|
| 32 | - */ |
|
| 33 | - protected function _setup_properties() |
|
| 34 | - { |
|
| 35 | - require_once($this->file_folder().'EEG_Aim.gateway.php'); |
|
| 36 | - $this->_gateway = new EEG_Aim(); |
|
| 37 | - $this->_pretty_name = __("Authorize.net AIM", 'event_espresso'); |
|
| 38 | - $this->_default_description = __('Please provide the following billing information.', 'event_espresso'); |
|
| 39 | - $this->_requires_https = true; |
|
| 40 | - } |
|
| 27 | + /** |
|
| 28 | + * Sets up payment method type properties for this gateway, which is normally |
|
| 29 | + * done in the constructor, but we want this to be easy for similar gateways to override |
|
| 30 | + * while still calling the parent constructor. |
|
| 31 | + * So children should override this method instead of __construct |
|
| 32 | + */ |
|
| 33 | + protected function _setup_properties() |
|
| 34 | + { |
|
| 35 | + require_once($this->file_folder().'EEG_Aim.gateway.php'); |
|
| 36 | + $this->_gateway = new EEG_Aim(); |
|
| 37 | + $this->_pretty_name = __("Authorize.net AIM", 'event_espresso'); |
|
| 38 | + $this->_default_description = __('Please provide the following billing information.', 'event_espresso'); |
|
| 39 | + $this->_requires_https = true; |
|
| 40 | + } |
|
| 41 | 41 | |
| 42 | 42 | |
| 43 | 43 | |
| 44 | - /** |
|
| 45 | - * Creates the billing form for this payment method type |
|
| 46 | - * |
|
| 47 | - * @param \EE_Transaction $transaction |
|
| 48 | - * @return EE_Billing_Info_Form |
|
| 49 | - * @throws \EE_Error |
|
| 50 | - */ |
|
| 51 | - public function generate_new_billing_form(EE_Transaction $transaction = null) |
|
| 52 | - { |
|
| 53 | - $billing_form = new EE_Billing_Attendee_Info_Form($this->_pm_instance, array( |
|
| 54 | - 'name'=>'AIM_Form', |
|
| 55 | - 'subsections'=>array( |
|
| 56 | - 'credit_card'=>new EE_Credit_Card_Input(array( |
|
| 57 | - 'required'=>true, |
|
| 58 | - 'html_label_text' => __('Card Number', 'event_espresso') |
|
| 59 | - )), |
|
| 60 | - 'exp_month'=>new EE_Credit_Card_Month_Input(true, array( |
|
| 61 | - 'required'=>true, |
|
| 62 | - 'html_label_text' => __('Expiry Month', 'event_espresso') |
|
| 63 | - )), |
|
| 64 | - 'exp_year'=>new EE_Credit_Card_Year_Input(array( |
|
| 65 | - 'required'=>true, |
|
| 66 | - 'html_label_text' => __('Expiry Year', 'event_espresso') |
|
| 67 | - )), |
|
| 68 | - 'cvv'=>new EE_CVV_Input(array( |
|
| 69 | - 'required'=>true, |
|
| 70 | - 'html_label_text' => __('CVV', 'event_espresso') )), |
|
| 71 | - ) |
|
| 72 | - )); |
|
| 73 | - $billing_form->add_subsections(array( |
|
| 74 | - 'company' => new EE_Text_Input(array( |
|
| 75 | - 'html_label_text' => __('Company', 'event_espresso') |
|
| 76 | - )) |
|
| 77 | - ), 'email', false); |
|
| 78 | - $billing_form->add_subsections( |
|
| 79 | - array( |
|
| 80 | - 'fax' => new EE_Text_Input(array( |
|
| 81 | - 'html_label_text' => __('Fax', 'event_espresso') |
|
| 82 | - )) |
|
| 83 | - ), |
|
| 84 | - 'phone', |
|
| 85 | - false |
|
| 86 | - ); |
|
| 87 | - $settings_form = $this->settings_form(); |
|
| 88 | - if ($settings_form->get_input('excluded_billing_inputs') instanceof EE_Checkbox_Multi_Input) { |
|
| 89 | - $billing_form->exclude($settings_form->get_input('excluded_billing_inputs')->normalized_value()); |
|
| 90 | - } |
|
| 91 | - if ($settings_form->get_input('required_billing_inputs') instanceof EE_Checkbox_Multi_Input) { |
|
| 92 | - $required_inputs = $settings_form->get_input('required_billing_inputs')->normalized_value(); |
|
| 93 | - // only change the requirement of inputs which are allowed to be changed |
|
| 94 | - /** @var EE_Form_Input_Base[] $inputs_to_evaluate */ |
|
| 95 | - $inputs_to_evaluate = array_intersect_key( |
|
| 96 | - $billing_form->inputs(), |
|
| 97 | - $this->billing_input_names() |
|
| 98 | - ); |
|
| 99 | - foreach ($inputs_to_evaluate as $input_name => $input) { |
|
| 100 | - if (in_array($input_name, $required_inputs)) { |
|
| 101 | - $input->set_required(true); |
|
| 102 | - } else { |
|
| 103 | - $input->set_required(false); |
|
| 104 | - } |
|
| 105 | - } |
|
| 106 | - } |
|
| 107 | - return $this->apply_billing_form_debug_settings($billing_form); |
|
| 108 | - } |
|
| 44 | + /** |
|
| 45 | + * Creates the billing form for this payment method type |
|
| 46 | + * |
|
| 47 | + * @param \EE_Transaction $transaction |
|
| 48 | + * @return EE_Billing_Info_Form |
|
| 49 | + * @throws \EE_Error |
|
| 50 | + */ |
|
| 51 | + public function generate_new_billing_form(EE_Transaction $transaction = null) |
|
| 52 | + { |
|
| 53 | + $billing_form = new EE_Billing_Attendee_Info_Form($this->_pm_instance, array( |
|
| 54 | + 'name'=>'AIM_Form', |
|
| 55 | + 'subsections'=>array( |
|
| 56 | + 'credit_card'=>new EE_Credit_Card_Input(array( |
|
| 57 | + 'required'=>true, |
|
| 58 | + 'html_label_text' => __('Card Number', 'event_espresso') |
|
| 59 | + )), |
|
| 60 | + 'exp_month'=>new EE_Credit_Card_Month_Input(true, array( |
|
| 61 | + 'required'=>true, |
|
| 62 | + 'html_label_text' => __('Expiry Month', 'event_espresso') |
|
| 63 | + )), |
|
| 64 | + 'exp_year'=>new EE_Credit_Card_Year_Input(array( |
|
| 65 | + 'required'=>true, |
|
| 66 | + 'html_label_text' => __('Expiry Year', 'event_espresso') |
|
| 67 | + )), |
|
| 68 | + 'cvv'=>new EE_CVV_Input(array( |
|
| 69 | + 'required'=>true, |
|
| 70 | + 'html_label_text' => __('CVV', 'event_espresso') )), |
|
| 71 | + ) |
|
| 72 | + )); |
|
| 73 | + $billing_form->add_subsections(array( |
|
| 74 | + 'company' => new EE_Text_Input(array( |
|
| 75 | + 'html_label_text' => __('Company', 'event_espresso') |
|
| 76 | + )) |
|
| 77 | + ), 'email', false); |
|
| 78 | + $billing_form->add_subsections( |
|
| 79 | + array( |
|
| 80 | + 'fax' => new EE_Text_Input(array( |
|
| 81 | + 'html_label_text' => __('Fax', 'event_espresso') |
|
| 82 | + )) |
|
| 83 | + ), |
|
| 84 | + 'phone', |
|
| 85 | + false |
|
| 86 | + ); |
|
| 87 | + $settings_form = $this->settings_form(); |
|
| 88 | + if ($settings_form->get_input('excluded_billing_inputs') instanceof EE_Checkbox_Multi_Input) { |
|
| 89 | + $billing_form->exclude($settings_form->get_input('excluded_billing_inputs')->normalized_value()); |
|
| 90 | + } |
|
| 91 | + if ($settings_form->get_input('required_billing_inputs') instanceof EE_Checkbox_Multi_Input) { |
|
| 92 | + $required_inputs = $settings_form->get_input('required_billing_inputs')->normalized_value(); |
|
| 93 | + // only change the requirement of inputs which are allowed to be changed |
|
| 94 | + /** @var EE_Form_Input_Base[] $inputs_to_evaluate */ |
|
| 95 | + $inputs_to_evaluate = array_intersect_key( |
|
| 96 | + $billing_form->inputs(), |
|
| 97 | + $this->billing_input_names() |
|
| 98 | + ); |
|
| 99 | + foreach ($inputs_to_evaluate as $input_name => $input) { |
|
| 100 | + if (in_array($input_name, $required_inputs)) { |
|
| 101 | + $input->set_required(true); |
|
| 102 | + } else { |
|
| 103 | + $input->set_required(false); |
|
| 104 | + } |
|
| 105 | + } |
|
| 106 | + } |
|
| 107 | + return $this->apply_billing_form_debug_settings($billing_form); |
|
| 108 | + } |
|
| 109 | 109 | |
| 110 | 110 | |
| 111 | 111 | |
| 112 | - /** |
|
| 113 | - * apply_billing_form_debug_settings |
|
| 114 | - * applies debug data to the form |
|
| 115 | - * |
|
| 116 | - * @param \EE_Billing_Info_Form $billing_form |
|
| 117 | - * @return \EE_Billing_Info_Form |
|
| 118 | - * @throws \EE_Error |
|
| 119 | - */ |
|
| 120 | - public function apply_billing_form_debug_settings(EE_Billing_Info_Form $billing_form) |
|
| 121 | - { |
|
| 122 | - if ($this->_pm_instance->debug_mode() |
|
| 123 | - || $this->_pm_instance->get_extra_meta('test_transactions', true, false) |
|
| 124 | - ) { |
|
| 125 | - $billing_form->get_input('credit_card')->set_default('4007000000027'); |
|
| 126 | - $billing_form->get_input('exp_year')->set_default('2020'); |
|
| 127 | - if ($billing_form->get_subsection('cvv') instanceof EE_Form_Input_Base) { |
|
| 128 | - $billing_form->get_input('cvv')->set_default('123'); |
|
| 129 | - } |
|
| 130 | - $billing_form->add_subsections( |
|
| 131 | - array( 'fyi_about_autofill' => $billing_form->payment_fields_autofilled_notice_html() ), |
|
| 132 | - 'credit_card' |
|
| 133 | - ); |
|
| 134 | - $billing_form->add_subsections( |
|
| 135 | - array( |
|
| 136 | - 'debug_content' => new EE_Form_Section_HTML_From_Template( |
|
| 137 | - __DIR__.DS.'templates'.DS.'authorize_net_aim_debug_info.template.php' |
|
| 138 | - ) |
|
| 139 | - ), |
|
| 140 | - 'first_name' |
|
| 141 | - ); |
|
| 142 | - } |
|
| 143 | - return $billing_form; |
|
| 144 | - } |
|
| 112 | + /** |
|
| 113 | + * apply_billing_form_debug_settings |
|
| 114 | + * applies debug data to the form |
|
| 115 | + * |
|
| 116 | + * @param \EE_Billing_Info_Form $billing_form |
|
| 117 | + * @return \EE_Billing_Info_Form |
|
| 118 | + * @throws \EE_Error |
|
| 119 | + */ |
|
| 120 | + public function apply_billing_form_debug_settings(EE_Billing_Info_Form $billing_form) |
|
| 121 | + { |
|
| 122 | + if ($this->_pm_instance->debug_mode() |
|
| 123 | + || $this->_pm_instance->get_extra_meta('test_transactions', true, false) |
|
| 124 | + ) { |
|
| 125 | + $billing_form->get_input('credit_card')->set_default('4007000000027'); |
|
| 126 | + $billing_form->get_input('exp_year')->set_default('2020'); |
|
| 127 | + if ($billing_form->get_subsection('cvv') instanceof EE_Form_Input_Base) { |
|
| 128 | + $billing_form->get_input('cvv')->set_default('123'); |
|
| 129 | + } |
|
| 130 | + $billing_form->add_subsections( |
|
| 131 | + array( 'fyi_about_autofill' => $billing_form->payment_fields_autofilled_notice_html() ), |
|
| 132 | + 'credit_card' |
|
| 133 | + ); |
|
| 134 | + $billing_form->add_subsections( |
|
| 135 | + array( |
|
| 136 | + 'debug_content' => new EE_Form_Section_HTML_From_Template( |
|
| 137 | + __DIR__.DS.'templates'.DS.'authorize_net_aim_debug_info.template.php' |
|
| 138 | + ) |
|
| 139 | + ), |
|
| 140 | + 'first_name' |
|
| 141 | + ); |
|
| 142 | + } |
|
| 143 | + return $billing_form; |
|
| 144 | + } |
|
| 145 | 145 | |
| 146 | 146 | |
| 147 | 147 | |
| 148 | - /** |
|
| 149 | - * Gets the form for all the settings related to this payment method type |
|
| 150 | - * @return EE_Payment_Method_Form |
|
| 151 | - */ |
|
| 152 | - public function generate_new_settings_form() |
|
| 153 | - { |
|
| 154 | - $billing_input_names = $this->billing_input_names(); |
|
| 155 | - return new EE_Payment_Method_Form( |
|
| 156 | - array( |
|
| 157 | - 'extra_meta_inputs'=>array( |
|
| 158 | - 'login_id'=>new EE_Text_Input( |
|
| 159 | - array( |
|
| 160 | - 'html_label_text'=> sprintf(__("Authorize.net API Login ID %s", "event_espresso"), $this->get_help_tab_link()), |
|
| 161 | - 'required' => true ) |
|
| 162 | - ), |
|
| 163 | - 'transaction_key'=>new EE_Text_Input( |
|
| 164 | - array( |
|
| 165 | - 'html_label_text'=> sprintf(__("Authorize.net Transaction Key %s", "event_espresso"), $this->get_help_tab_link()), |
|
| 166 | - 'required' => true ) |
|
| 167 | - ), |
|
| 168 | - 'test_transactions'=>new EE_Yes_No_Input( |
|
| 169 | - array( |
|
| 170 | - 'html_label_text'=> sprintf(__("Send test transactions? %s", 'event_espresso'), $this->get_help_tab_link()), |
|
| 171 | - 'html_help_text'=> __("Send test transactions, even to live server", 'event_espresso'), |
|
| 172 | - 'default' => false, |
|
| 173 | - 'required' => true |
|
| 174 | - ) |
|
| 175 | - ), |
|
| 176 | - 'excluded_billing_inputs' => new EE_Checkbox_Multi_Input( |
|
| 177 | - $billing_input_names, |
|
| 178 | - array( |
|
| 179 | - 'html_label_text' => sprintf(__("Excluded Payment Form Fields %s", 'event_espresso'), $this->get_help_tab_link()), |
|
| 180 | - 'default' => array( |
|
| 181 | - 'company', |
|
| 182 | - 'fax', |
|
| 183 | - ) |
|
| 184 | - ) |
|
| 185 | - ), |
|
| 186 | - 'required_billing_inputs' => new EE_Checkbox_Multi_Input( |
|
| 187 | - $billing_input_names, |
|
| 188 | - array( |
|
| 189 | - 'html_label_text' => sprintf(__("Required Payment Form Fields %s", 'event_espresso'), $this->get_help_tab_link()), |
|
| 190 | - 'default' => array_diff( |
|
| 191 | - array_keys($billing_input_names), |
|
| 192 | - array( 'address2', 'phone', 'company', 'fax' ) |
|
| 193 | - ), |
|
| 194 | - 'html_help_text' => __('Note: if fields are excluded they cannot be required.', 'event_espresso') |
|
| 195 | - ) |
|
| 196 | - ), |
|
| 197 | - 'server' => new EE_Select_Input( |
|
| 198 | - apply_filters( |
|
| 199 | - 'FHEE__EE_PMT_Aim__generate_new_settings_form__server_select_input__options', |
|
| 200 | - array( |
|
| 201 | - 'akamai' => __('Authorize.net/Akamai (default)', 'event_espresso'), |
|
| 202 | - 'authorize.net' => __('Authorize.net (deprecated)', 'event_espresso'), |
|
| 203 | - ), |
|
| 204 | - $this |
|
| 205 | - ), |
|
| 206 | - array( |
|
| 207 | - 'html_label_text' => __('Server', 'event_espresso'), |
|
| 208 | - 'html_help_text' => __('The Gateway Server where payment requests will be sent', 'event_espresso') |
|
| 209 | - ) |
|
| 210 | - ) |
|
| 148 | + /** |
|
| 149 | + * Gets the form for all the settings related to this payment method type |
|
| 150 | + * @return EE_Payment_Method_Form |
|
| 151 | + */ |
|
| 152 | + public function generate_new_settings_form() |
|
| 153 | + { |
|
| 154 | + $billing_input_names = $this->billing_input_names(); |
|
| 155 | + return new EE_Payment_Method_Form( |
|
| 156 | + array( |
|
| 157 | + 'extra_meta_inputs'=>array( |
|
| 158 | + 'login_id'=>new EE_Text_Input( |
|
| 159 | + array( |
|
| 160 | + 'html_label_text'=> sprintf(__("Authorize.net API Login ID %s", "event_espresso"), $this->get_help_tab_link()), |
|
| 161 | + 'required' => true ) |
|
| 162 | + ), |
|
| 163 | + 'transaction_key'=>new EE_Text_Input( |
|
| 164 | + array( |
|
| 165 | + 'html_label_text'=> sprintf(__("Authorize.net Transaction Key %s", "event_espresso"), $this->get_help_tab_link()), |
|
| 166 | + 'required' => true ) |
|
| 167 | + ), |
|
| 168 | + 'test_transactions'=>new EE_Yes_No_Input( |
|
| 169 | + array( |
|
| 170 | + 'html_label_text'=> sprintf(__("Send test transactions? %s", 'event_espresso'), $this->get_help_tab_link()), |
|
| 171 | + 'html_help_text'=> __("Send test transactions, even to live server", 'event_espresso'), |
|
| 172 | + 'default' => false, |
|
| 173 | + 'required' => true |
|
| 174 | + ) |
|
| 175 | + ), |
|
| 176 | + 'excluded_billing_inputs' => new EE_Checkbox_Multi_Input( |
|
| 177 | + $billing_input_names, |
|
| 178 | + array( |
|
| 179 | + 'html_label_text' => sprintf(__("Excluded Payment Form Fields %s", 'event_espresso'), $this->get_help_tab_link()), |
|
| 180 | + 'default' => array( |
|
| 181 | + 'company', |
|
| 182 | + 'fax', |
|
| 183 | + ) |
|
| 184 | + ) |
|
| 185 | + ), |
|
| 186 | + 'required_billing_inputs' => new EE_Checkbox_Multi_Input( |
|
| 187 | + $billing_input_names, |
|
| 188 | + array( |
|
| 189 | + 'html_label_text' => sprintf(__("Required Payment Form Fields %s", 'event_espresso'), $this->get_help_tab_link()), |
|
| 190 | + 'default' => array_diff( |
|
| 191 | + array_keys($billing_input_names), |
|
| 192 | + array( 'address2', 'phone', 'company', 'fax' ) |
|
| 193 | + ), |
|
| 194 | + 'html_help_text' => __('Note: if fields are excluded they cannot be required.', 'event_espresso') |
|
| 195 | + ) |
|
| 196 | + ), |
|
| 197 | + 'server' => new EE_Select_Input( |
|
| 198 | + apply_filters( |
|
| 199 | + 'FHEE__EE_PMT_Aim__generate_new_settings_form__server_select_input__options', |
|
| 200 | + array( |
|
| 201 | + 'akamai' => __('Authorize.net/Akamai (default)', 'event_espresso'), |
|
| 202 | + 'authorize.net' => __('Authorize.net (deprecated)', 'event_espresso'), |
|
| 203 | + ), |
|
| 204 | + $this |
|
| 205 | + ), |
|
| 206 | + array( |
|
| 207 | + 'html_label_text' => __('Server', 'event_espresso'), |
|
| 208 | + 'html_help_text' => __('The Gateway Server where payment requests will be sent', 'event_espresso') |
|
| 209 | + ) |
|
| 210 | + ) |
|
| 211 | 211 | |
| 212 | - ) |
|
| 213 | - ) |
|
| 214 | - ); |
|
| 215 | - } |
|
| 212 | + ) |
|
| 213 | + ) |
|
| 214 | + ); |
|
| 215 | + } |
|
| 216 | 216 | |
| 217 | - /** |
|
| 218 | - * Returns an array where keys are the slugs for billing inputs, and values |
|
| 219 | - * are their i18n names |
|
| 220 | - * @return array |
|
| 221 | - */ |
|
| 222 | - public function billing_input_names() |
|
| 223 | - { |
|
| 224 | - return array( |
|
| 225 | - 'first_name' => __('First Name', 'event_espresso'), |
|
| 226 | - 'last_name' => __('Last Name', 'event_espresso'), |
|
| 227 | - 'email' => __('Email', 'event_espresso'), |
|
| 228 | - 'company' => __('Company', 'event_espresso'), |
|
| 229 | - 'address' => __('Address', 'event_espresso'), |
|
| 230 | - 'address2' => __('Address2', 'event_espresso'), |
|
| 231 | - 'city' => __('City', 'event_espresso'), |
|
| 232 | - 'state' => __('State', 'event_espresso'), |
|
| 233 | - 'country' => __('Country', 'event_espresso'), |
|
| 234 | - 'zip' => __('Zip', 'event_espresso'), |
|
| 235 | - 'phone' => __('Phone', 'event_espresso'), |
|
| 236 | - 'fax' => __('Fax', 'event_espresso'), |
|
| 237 | - 'cvv' => __('CVV', 'event_espresso') |
|
| 238 | - ); |
|
| 239 | - } |
|
| 217 | + /** |
|
| 218 | + * Returns an array where keys are the slugs for billing inputs, and values |
|
| 219 | + * are their i18n names |
|
| 220 | + * @return array |
|
| 221 | + */ |
|
| 222 | + public function billing_input_names() |
|
| 223 | + { |
|
| 224 | + return array( |
|
| 225 | + 'first_name' => __('First Name', 'event_espresso'), |
|
| 226 | + 'last_name' => __('Last Name', 'event_espresso'), |
|
| 227 | + 'email' => __('Email', 'event_espresso'), |
|
| 228 | + 'company' => __('Company', 'event_espresso'), |
|
| 229 | + 'address' => __('Address', 'event_espresso'), |
|
| 230 | + 'address2' => __('Address2', 'event_espresso'), |
|
| 231 | + 'city' => __('City', 'event_espresso'), |
|
| 232 | + 'state' => __('State', 'event_espresso'), |
|
| 233 | + 'country' => __('Country', 'event_espresso'), |
|
| 234 | + 'zip' => __('Zip', 'event_espresso'), |
|
| 235 | + 'phone' => __('Phone', 'event_espresso'), |
|
| 236 | + 'fax' => __('Fax', 'event_espresso'), |
|
| 237 | + 'cvv' => __('CVV', 'event_espresso') |
|
| 238 | + ); |
|
| 239 | + } |
|
| 240 | 240 | |
| 241 | - /** |
|
| 242 | - * Overrides parent so we always have all billing inputs in the returned array, |
|
| 243 | - * not just the ones included at the time. This helps simplify the gateway code |
|
| 244 | - * |
|
| 245 | - * @param EE_Billing_Info_Form $billing_form |
|
| 246 | - * @return array |
|
| 247 | - */ |
|
| 248 | - protected function _get_billing_values_from_form($billing_form) |
|
| 249 | - { |
|
| 250 | - $all_billing_values_empty = array(); |
|
| 251 | - foreach (array_keys($this->billing_input_names()) as $input_name) { |
|
| 252 | - $all_billing_values_empty[ $input_name ] = ''; |
|
| 253 | - } |
|
| 254 | - return array_merge( |
|
| 255 | - $all_billing_values_empty, |
|
| 256 | - parent::_get_billing_values_from_form($billing_form) |
|
| 257 | - ); |
|
| 258 | - } |
|
| 241 | + /** |
|
| 242 | + * Overrides parent so we always have all billing inputs in the returned array, |
|
| 243 | + * not just the ones included at the time. This helps simplify the gateway code |
|
| 244 | + * |
|
| 245 | + * @param EE_Billing_Info_Form $billing_form |
|
| 246 | + * @return array |
|
| 247 | + */ |
|
| 248 | + protected function _get_billing_values_from_form($billing_form) |
|
| 249 | + { |
|
| 250 | + $all_billing_values_empty = array(); |
|
| 251 | + foreach (array_keys($this->billing_input_names()) as $input_name) { |
|
| 252 | + $all_billing_values_empty[ $input_name ] = ''; |
|
| 253 | + } |
|
| 254 | + return array_merge( |
|
| 255 | + $all_billing_values_empty, |
|
| 256 | + parent::_get_billing_values_from_form($billing_form) |
|
| 257 | + ); |
|
| 258 | + } |
|
| 259 | 259 | |
| 260 | 260 | |
| 261 | 261 | |
| 262 | - /** |
|
| 263 | - * Adds the help tab |
|
| 264 | - * @see EE_PMT_Base::help_tabs_config() |
|
| 265 | - * @return array |
|
| 266 | - */ |
|
| 267 | - public function help_tabs_config() |
|
| 268 | - { |
|
| 269 | - return array( |
|
| 270 | - $this->get_help_tab_name() => array( |
|
| 271 | - 'title' => __('Authorize.net AIM Settings', 'event_espresso'), |
|
| 272 | - 'filename' => 'payment_methods_overview_aim' |
|
| 273 | - ), |
|
| 274 | - ); |
|
| 275 | - } |
|
| 262 | + /** |
|
| 263 | + * Adds the help tab |
|
| 264 | + * @see EE_PMT_Base::help_tabs_config() |
|
| 265 | + * @return array |
|
| 266 | + */ |
|
| 267 | + public function help_tabs_config() |
|
| 268 | + { |
|
| 269 | + return array( |
|
| 270 | + $this->get_help_tab_name() => array( |
|
| 271 | + 'title' => __('Authorize.net AIM Settings', 'event_espresso'), |
|
| 272 | + 'filename' => 'payment_methods_overview_aim' |
|
| 273 | + ), |
|
| 274 | + ); |
|
| 275 | + } |
|
| 276 | 276 | |
| 277 | 277 | |
| 278 | 278 | |
| 279 | - /** |
|
| 280 | - * Gets a list of instructions and/or information regarding how the payment is to be completed |
|
| 281 | - * @return string |
|
| 282 | - */ |
|
| 283 | - public function payment_information() |
|
| 284 | - { |
|
| 285 | - // TODO: Implement payment_information() method. |
|
| 286 | - } |
|
| 279 | + /** |
|
| 280 | + * Gets a list of instructions and/or information regarding how the payment is to be completed |
|
| 281 | + * @return string |
|
| 282 | + */ |
|
| 283 | + public function payment_information() |
|
| 284 | + { |
|
| 285 | + // TODO: Implement payment_information() method. |
|
| 286 | + } |
|
| 287 | 287 | } |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | $billing_form->get_input('cvv')->set_default('123'); |
| 129 | 129 | } |
| 130 | 130 | $billing_form->add_subsections( |
| 131 | - array( 'fyi_about_autofill' => $billing_form->payment_fields_autofilled_notice_html() ), |
|
| 131 | + array('fyi_about_autofill' => $billing_form->payment_fields_autofilled_notice_html()), |
|
| 132 | 132 | 'credit_card' |
| 133 | 133 | ); |
| 134 | 134 | $billing_form->add_subsections( |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | 'html_label_text' => sprintf(__("Required Payment Form Fields %s", 'event_espresso'), $this->get_help_tab_link()), |
| 190 | 190 | 'default' => array_diff( |
| 191 | 191 | array_keys($billing_input_names), |
| 192 | - array( 'address2', 'phone', 'company', 'fax' ) |
|
| 192 | + array('address2', 'phone', 'company', 'fax') |
|
| 193 | 193 | ), |
| 194 | 194 | 'html_help_text' => __('Note: if fields are excluded they cannot be required.', 'event_espresso') |
| 195 | 195 | ) |
@@ -249,7 +249,7 @@ discard block |
||
| 249 | 249 | { |
| 250 | 250 | $all_billing_values_empty = array(); |
| 251 | 251 | foreach (array_keys($this->billing_input_names()) as $input_name) { |
| 252 | - $all_billing_values_empty[ $input_name ] = ''; |
|
| 252 | + $all_billing_values_empty[$input_name] = ''; |
|
| 253 | 253 | } |
| 254 | 254 | return array_merge( |
| 255 | 255 | $all_billing_values_empty, |
@@ -17,9 +17,9 @@ |
||
| 17 | 17 | |
| 18 | 18 | <p> |
| 19 | 19 | <?php _e( |
| 20 | - 'Test Mode allows you to submit test transactions to the payment gateway. Transactions that are submitted while Test Mode is ON are NOT actually processed. The result of a transaction depends on the card number submitted, and the invoice amount. If you want a transaction to be approved, use one of the following card numbers.', |
|
| 21 | - 'event_espresso' |
|
| 22 | - ); ?> |
|
| 20 | + 'Test Mode allows you to submit test transactions to the payment gateway. Transactions that are submitted while Test Mode is ON are NOT actually processed. The result of a transaction depends on the card number submitted, and the invoice amount. If you want a transaction to be approved, use one of the following card numbers.', |
|
| 21 | + 'event_espresso' |
|
| 22 | + ); ?> |
|
| 23 | 23 | </p> |
| 24 | 24 | |
| 25 | 25 | <p> |
@@ -1,8 +1,8 @@ |
||
| 1 | 1 | <?php printf( |
| 2 | - esc_html__( |
|
| 3 | - 'Authorize.Net AIM is an on-site payment method for accepting credit and debit card payments and is available to event organizers in the United States, Canada, United Kingdom, and Australia. An account with Authorize.Net is required to accept payments. Need an Authorize.Net account? %1$sClick here to sign up for a merchant account%2$s.', |
|
| 4 | - 'event_espresso' |
|
| 5 | - ), |
|
| 6 | - '<a href="https://eventespresso.com/go/authorizenetaim/" target="_blank">', |
|
| 7 | - '</a>' |
|
| 2 | + esc_html__( |
|
| 3 | + 'Authorize.Net AIM is an on-site payment method for accepting credit and debit card payments and is available to event organizers in the United States, Canada, United Kingdom, and Australia. An account with Authorize.Net is required to accept payments. Need an Authorize.Net account? %1$sClick here to sign up for a merchant account%2$s.', |
|
| 4 | + 'event_espresso' |
|
| 5 | + ), |
|
| 6 | + '<a href="https://eventespresso.com/go/authorizenetaim/" target="_blank">', |
|
| 7 | + '</a>' |
|
| 8 | 8 | ); |