/** * Gets the form for all the settings related to this payment method type * @return EE_Payment_Method_Form */ public function generate_new_settings_form() { $pdf_payee_input_name = 'pdf_payee_name'; $confirmation_text_input_name = 'page_confirmation_text'; $form = new EE_Payment_Method_Form(array('extra_meta_inputs' => array($pdf_payee_input_name => new EE_Text_Input(array('html_label_text' => sprintf(__('Payee Name %s', 'event_espresso'), $this->get_help_tab_link()))), 'pdf_payee_email' => new EE_Email_Input(array('html_label_text' => sprintf(__('Payee Email %s', 'event_espresso'), $this->get_help_tab_link()))), 'pdf_payee_tax_number' => new EE_Text_Input(array('html_label_text' => sprintf(__('Payee Tax Number %s', 'event_espresso'), $this->get_help_tab_link()))), 'pdf_payee_address' => new EE_Text_Area_Input(array('html_label_text' => sprintf(__('Payee Address %s', 'event_espresso'), $this->get_help_tab_link()), 'validation_strategies' => array(new EE_Full_HTML_Validation_Strategy()))), 'pdf_instructions' => new EE_Text_Area_Input(array('html_label_text' => sprintf(__("Instructions %s", "event_espresso"), $this->get_help_tab_link()), 'default' => __("Please send this invoice with payment attached to the address above, or use the payment link below. Payment must be received within 48 hours of event date.", 'event_espresso'), 'validation_strategies' => array(new EE_Full_HTML_Validation_Strategy()))), 'pdf_logo_image' => new EE_Admin_File_Uploader_Input(array('html_label_text' => sprintf(__("Logo Image %s", "event_espresso"), $this->get_help_tab_link()), 'default' => EE_Config::instance()->organization->logo_url, 'html_help_text' => __("(Logo for the top left of the invoice)", 'event_espresso'))), $confirmation_text_input_name => new EE_Text_Area_Input(array('html_label_text' => sprintf(__("Confirmation Text %s", "event_espresso"), $this->get_help_tab_link()), 'default' => __("Payment must be received within 48 hours of event date. Details about where to send payment is included on the invoice.", 'event_espresso'), 'validation_strategies' => array(new EE_Full_HTML_Validation_Strategy()))), 'page_extra_info' => new EE_Text_Area_Input(array('html_label_text' => sprintf(__("Extra Info %s", "event_espresso"), $this->get_help_tab_link()), 'validation_strategies' => array(new EE_Full_HTML_Validation_Strategy())))), 'include' => array('PMD_ID', 'PMD_name', 'PMD_desc', 'PMD_admin_name', 'PMD_admin_desc', 'PMD_type', 'PMD_slug', 'PMD_open_by_default', 'PMD_button_url', 'PMD_scope', 'Currency', 'PMD_order', $pdf_payee_input_name, 'pdf_payee_email', 'pdf_payee_tax_number', 'pdf_payee_address', 'pdf_instructions', 'pdf_logo_image', $confirmation_text_input_name, 'page_extra_info'))); $form->add_subsections(array('header1' => new EE_Form_Section_HTML_From_Template('payment_methods/Invoice/templates/invoice_settings_header_display.template.php')), $pdf_payee_input_name); $form->add_subsections(array('header2' => new EE_Form_Section_HTML_From_Template('payment_methods/Invoice/templates/invoice_settings_header_gateway.template.php')), $confirmation_text_input_name); return $form; }
/** * Gets teh form for displaying to admins where they setup the payment method * @return EE_Payment_Method_Form */ function settings_form() { if (!$this->_settings_form) { $this->_settings_form = $this->generate_new_settings_form(); $this->_settings_form->set_payment_method_type($this); $this->_settings_form->_construct_finalize(NULL, NULL); //if we have already assigned a model object to this pmt, make //sure its reflected in teh form we just generated if ($this->_pm_instance) { $this->_settings_form->populate_model_obj($this->_pm_instance); } } return $this->_settings_form; }
/** * @param array $req_data */ protected function _normalize($req_data) { parent::_normalize($req_data); $paypal_calculates_shipping = $this->get_input_value('paypal_shipping'); $paypal_calculates_taxes = $this->get_input_value('paypal_taxes'); $paypal_requests_address_info = $this->get_input_value('shipping_details'); if (($paypal_calculates_shipping || $paypal_calculates_taxes) && $paypal_requests_address_info == EE_PMT_Paypal_Standard::shipping_info_none) { //they want paypal to calculate taxes or shipping. They need to ask for //address info, otherwise paypal can't calculate taxes or shipping /** @type EE_Select_Input $shipping_details_input */ $shipping_details_input = $this->get_input('shipping_details'); $shipping_details_input->set_default(EE_PMT_Paypal_Standard::shipping_info_optional); $shipping_details_input_options = $shipping_details_input->options(); EE_Error::add_attention(sprintf(__('Automatically set "%s" to "%s" because Paypal requires address info in order to calculate shipping or taxes.', 'event_espresso'), strip_tags($shipping_details_input->html_label_text()), isset($shipping_details_input_options[EE_PMT_Paypal_Standard::shipping_info_optional]) ? $shipping_details_input_options[EE_PMT_Paypal_Standard::shipping_info_optional] : __('Unknown', 'event_espresso')), __FILE__, __FUNCTION__, __LINE__); } }
/** * * @param EE_PMT_Paypal_Standard $payment_method_type */ public function __construct($payment_method_type) { $options_array = array('payment_method_type' => $payment_method_type, 'extra_meta_inputs' => array('paypal_id' => new EE_Text_Input(array('html_label_text' => sprintf(__("Paypal Email %s", 'event_espresso'), $payment_method_type->get_help_tab_link()), 'html_help_text' => __("Typically payment@example-domain.com", 'event_espresso'), 'required' => true)), 'image_url' => new EE_Admin_File_Uploader_Input(array('html_help_text' => __("Used for your business/personal logo on the PayPal page", 'event_espresso'), 'html_label_text' => __('Image URL', 'event_espresso'))), 'shipping_details' => new EE_Select_Input(array(EE_PMT_Paypal_Standard::shipping_info_none => __("Do not prompt for an address", 'event_espresso'), EE_PMT_Paypal_Standard::shipping_info_optional => __("Prompt for an address, but do not require it", 'event_espresso'), EE_PMT_Paypal_Standard::shipping_info_required => __("Prompt for an address, and require it", 'event_espresso')))), 'before_form_content_template' => $payment_method_type->file_folder() . DS . 'templates' . DS . 'paypal_standard_settings_before_form.template.php'); parent::__construct($options_array); }
/** * Gets the form for all the settings related to this payment method type * @return EE_Payment_Method_Form */ public function generate_new_settings_form() { $form = new EE_Payment_Method_Form(array('extra_meta_inputs' => array('access_key' => new EE_Text_Input(array('html_label_text' => sprintf(__("Mijireh Access Key %s", 'event_espresso'), $this->get_help_tab_link()), 'required' => true))), 'exclude' => array('PMD_debug_mode'))); $form->add_subsections(array('slurper_area' => new EE_Form_Section_HTML_From_Template($this->file_folder() . DS . 'templates' . DS . 'mijireh_settings_after_form.template.php')), null, false); return $form; }