Ejemplo n.º 1
0
 /**
  * apply_billing_form_debug_settings
  * applies debug data to the form
  *
  * @param \EE_Billing_Info_Form $billing_form
  * @return \EE_Billing_Info_Form
  * @throws \EE_Error
  */
 public function apply_billing_form_debug_settings(EE_Billing_Info_Form $billing_form)
 {
     if ($this->_pm_instance->debug_mode() || $this->_pm_instance->get_extra_meta('test_transactions', TRUE, FALSE)) {
         $billing_form->get_input('credit_card')->set_default('4007000000027');
         $billing_form->get_input('exp_year')->set_default('2020');
         if ($billing_form->get_subsection('cvv') instanceof EE_Form_Input_Base) {
             $billing_form->get_input('cvv')->set_default('123');
         }
         $billing_form->add_subsections(array('fyi_about_autofill' => $billing_form->payment_fields_autofilled_notice_html()), 'credit_card');
         $billing_form->add_subsections(array('debug_content' => new EE_Form_Section_HTML_From_Template(__DIR__ . DS . 'templates' . DS . 'authorize_net_aim_debug_info.template.php')), 'first_name');
     }
     return $billing_form;
 }
 /**
  * apply_billing_form_debug_settings
  * applies debug data to the form
  *
  * @param \EE_Billing_Info_Form $billing_form
  * @return \EE_Billing_Info_Form
  */
 public function apply_billing_form_debug_settings(EE_Billing_Info_Form $billing_form)
 {
     if ($this->_pm_instance->debug_mode()) {
         $billing_form->add_subsections(array('fyi_about_autofill' => $billing_form->payment_fields_autofilled_notice_html()), 'credit_card');
         $billing_form->add_subsections(array('debug_content' => new EE_Form_Section_HTML_From_Template(dirname(__FILE__) . DS . 'templates' . DS . 'paypal_pro_debug_info.template.php')), 'first_name');
         $billing_form->get_input('credit_card')->set_default('5424180818927383');
         $billing_form->get_input('credit_card_type')->set_default('MasterCard');
         $billing_form->get_input('exp_year')->set_default(date('Y') + 6);
         $billing_form->get_input('cvv')->set_default('115');
     }
     return $billing_form;
 }
 /**
  *	Possibly adds debug content to Payflow Pro checkout billing form.
  *
  *	@param \EE_Billing_Info_Form $billing_form
  *	@return \EE_Billing_Info_Form
  */
 public function apply_billing_form_debug_settings(EE_Billing_Info_Form $billing_form)
 {
     if ($this->_pm_instance->debug_mode()) {
         $billing_form->add_subsections(array('fyi_about_autofill' => $billing_form->payment_fields_autofilled_notice_html()), 'account_type');
         $billing_form->add_subsections(array('debug_content' => new EE_Form_Section_HTML_From_Template($this->_template_path . 'payflow_pro_debug_info.template.php')), 'account_type');
         $billing_form->get_input('credit_card')->set_default('4111111111111111');
         $billing_form->get_input('card_cvv')->set_default('117');
         $billing_form->get_input('exp_year')->set_default(date('Y') + 6);
     }
     return $billing_form;
 }
 /**
  * Gets the values we want to pass onto the gateway. Normally these
  * are just the 'pretty' values, but there may be times the data may need
  * a  little massaging. Proper subsections will become arrays of inputs
  * @param EE_Billing_Info_Form $billing_form
  * @return array
  */
 protected function _get_billing_values_from_form($billing_form)
 {
     if ($billing_form instanceof EE_Form_Section_Proper) {
         return $billing_form->input_pretty_values(true);
     } else {
         return NULL;
     }
 }
 /**
  *
  * @param EE_Payment_Method $payment_method
  * @param array $options_array @see EE_Form_Section_Proper::__construct()
  */
 public function __construct(EE_Payment_Method $payment_method, $options_array = array())
 {
     $options_array['subsections'] = array_merge(array('first_name' => new EE_Text_Input(array('required' => TRUE, 'html_class' => 'ee-billing-qstn ee-billing-qstn-fname', 'html_label_text' => __('First Name', 'event_espresso'))), 'last_name' => new EE_Text_Input(array('required' => TRUE, 'html_class' => 'ee-billing-qstn ee-billing-qstn-lname', 'html_label_text' => __('Last Name', 'event_espresso'))), 'email' => new EE_Email_Input(array('required' => TRUE, 'html_class' => 'ee-billing-qstn ee-billing-qstn-email', 'html_label_text' => __('Email', 'event_espresso'))), 'address' => new EE_Text_Input(array('html_label_text' => __('Address', 'event_espresso'), 'required' => TRUE, 'html_class' => 'ee-billing-qstn ee-billing-qstn-address')), 'address2' => new EE_Text_Input(array('html_label_text' => __('Address 2', 'event_espresso'), 'html_class' => 'ee-billing-qstn ee-billing-qstn-address2')), 'city' => new EE_Text_Input(array('required' => TRUE, 'html_class' => 'ee-billing-qstn ee-billing-qstn-city', 'html_label_text' => __('City', 'event_espresso'))), 'state' => apply_filters('FHEE__EE_Billing_Attendee_Info_Form__state_field', new EE_State_Select_Input(NULL, array('required' => TRUE, 'html_class' => 'ee-billing-qstn ee-billing-qstn-state', 'html_label_text' => __('State', 'event_espresso')))), 'country' => apply_filters('FHEE__EE_Billing_Attendee_Info_Form__country_field', new EE_Country_Select_Input(NULL, array('required' => TRUE, 'html_class' => 'ee-billing-qstn ee-billing-qstn-country', 'html_label_text' => __('Country', 'event_espresso')))), 'zip' => new EE_Text_Input(array('required' => TRUE, 'html_class' => 'ee-billing-qstn ee-billing-qstn-zip', 'html_label_text' => __('Zip', 'event_espresso'))), 'phone' => new EE_Text_Input(array('html_class' => 'ee-billing-qstn ee-billing-qstn-phone', 'html_label_text' => __('Phone', 'event_espresso')))), isset($options_array['subsections']) ? $options_array['subsections'] : array());
     parent::__construct($payment_method, $options_array);
 }