コード例 #1
0
 /**
  * Creates the billing form for this payment method type
  * @param \EE_Transaction $transaction
  * @return EE_Billing_Info_Form
  */
 public function generate_new_billing_form(EE_Transaction $transaction = NULL)
 {
     $billing_form = new EE_Billing_Attendee_Info_Form($this->_pm_instance, array('name' => 'AIM_Form', 'subsections' => array('credit_card' => new EE_Credit_Card_Input(array('required' => true, 'html_label_text' => __('Card Number', 'event_espresso'))), 'exp_month' => new EE_Credit_Card_Month_Input(true, array('required' => true, 'html_label_text' => __('Expiry Month', 'event_espresso'))), 'exp_year' => new EE_Credit_Card_Year_Input(array('required' => true, 'html_label_text' => __('Expiry Year', 'event_espresso'))), 'cvv' => new EE_CVV_Input(array('required' => true, 'html_label_text' => __('CVV', 'event_espresso'))))));
     $billing_form->add_subsections(array('company' => new EE_Text_Input(array('html_label_text' => __('Company', 'event_espresso')))), 'email', false);
     $billing_form->add_subsections(array('fax' => new EE_Text_Input(array('html_label_text' => __('Fax', 'event_espresso')))), 'phone', false);
     $settings_form = $this->settings_form();
     if ($settings_form->get_input('excluded_billing_inputs') instanceof EE_Checkbox_Multi_Input) {
         $billing_form->exclude($settings_form->get_input('excluded_billing_inputs')->normalized_value());
     }
     if ($settings_form->get_input('required_billing_inputs') instanceof EE_Checkbox_Multi_Input) {
         $required_inputs = array_merge(array('credit_card', 'exp_month', 'exp_year'), $settings_form->get_input('required_billing_inputs')->normalized_value());
         foreach ($billing_form->inputs() as $input_name => $input) {
             if (in_array($input_name, $required_inputs)) {
                 $input->set_required(true);
             } else {
                 $input->set_required(false);
             }
         }
     }
     return $this->apply_billing_form_debug_settings($billing_form);
 }