Esempio n. 1
0
 /**
  * Gateway value
  */
 public static function gateway_values()
 {
     global $app_abbr;
     // Gateway values
     global $action_gateway_values;
     $action_gateway_values = array(array('type' => 'tab', 'tabname' => __('iDEAL', 'pronamic_ideal'), 'id' => ''), array('type' => 'title', 'name' => __('iDEAL Options', 'pronamic_ideal'), 'id' => ''), array('type' => 'logo', 'name' => sprintf('<img src="%s" alt="" />', plugins_url('images/icon-32x32.png', Pronamic_WP_Pay_Plugin::$file)), 'id' => ''), array('type' => 'select', 'name' => __('Enable iDEAL', 'pronamic_ideal'), 'options' => array('yes' => __('Yes', 'pronamic_ideal'), 'no' => __('No', 'pronamic_ideal')), 'id' => $app_abbr . '_pronamic_ideal_enable'), array('type' => 'select', 'name' => __('iDEAL Configuration', 'pronamic_ideal'), 'options' => Pronamic_WP_Pay_Plugin::get_config_select_options(), 'id' => $app_abbr . '_pronamic_ideal_config_id'), array('type' => 'tabend', 'id' => ''));
 }
Esempio n. 2
0
 /**
  * Register settings.
  */
 public static function register_settings()
 {
     add_settings_section(self::OPTION_GROUP, null, '__return_false', self::OPTION_GROUP);
     add_settings_field(self::BUTTON_TITLE_OPTION_KEY, __('Title', 'pronamic_ideal'), array(__CLASS__, 'input_text'), self::OPTION_GROUP, self::OPTION_GROUP, array('label_for' => self::BUTTON_TITLE_OPTION_KEY, 'classes' => array('regular-text'), 'default' => self::get_gateway_button_title()));
     add_settings_field(self::CONFIGURATION_OPTION_KEY, __('iDEAL Configuration', 'pronamic_ideal'), array(__CLASS__, 'input_select'), self::OPTION_GROUP, self::OPTION_GROUP, array('label_for' => self::CONFIGURATION_OPTION_KEY, 'options' => Pronamic_WP_Pay_Plugin::get_config_select_options()));
     register_setting(self::OPTION_GROUP, self::BUTTON_TITLE_OPTION_KEY);
     register_setting(self::OPTION_GROUP, self::CONFIGURATION_OPTION_KEY);
 }
Esempio n. 3
0
 /**
  * Initialise form fields
  */
 function init_form_fields()
 {
     $description_prefix = '';
     if (Pronamic_WP_Pay_Extensions_WooCommerce_WooCommerce::version_compare('2.0.0', '<')) {
         $description_prefix = '<br />';
     }
     $this->form_fields = array('enabled' => array('title' => __('Enable/Disable', 'pronamic_ideal'), 'type' => 'checkbox', 'label' => __('Enable iDEAL', 'pronamic_ideal'), 'default' => 'no'), 'title' => array('title' => __('Title', 'pronamic_ideal'), 'type' => 'text', 'description' => $description_prefix . __('This controls the title which the user sees during checkout.', 'pronamic_ideal'), 'default' => $this->method_title), 'description' => array('title' => __('Description', 'pronamic_ideal'), 'type' => 'textarea', 'description' => $description_prefix . sprintf(__('Give the customer instructions for paying via %s, and let them know that their order won\'t be shipping until the money is received.', 'pronamic_ideal'), $this->method_title), 'default' => __('With iDEAL you can easily pay online in the secure environment of your own bank.', 'pronamic_ideal')), 'icon' => array('title' => __('Icon', 'pronamic_ideal'), 'type' => 'text', 'description' => sprintf('%s%s<br />%s', $description_prefix, __('This controls the icon which the user sees during checkout.', 'pronamic_ideal'), sprintf(__('Default: <code>%s</code>.', 'pronamic_ideal'), plugins_url('images/icon-24x24.png', Pronamic_WP_Pay_Plugin::$file))), 'default' => plugins_url('images/ideal/wc-icon.png', Pronamic_WP_Pay_Plugin::$file)), 'config_id' => array('title' => __('Configuration', 'pronamic_ideal'), 'type' => 'select', 'default' => '', 'options' => Pronamic_WP_Pay_Plugin::get_config_select_options($this->payment_method)), 'payment' => array('title' => __('Payment Options', 'pronamic_ideal'), 'type' => 'title', 'description' => ''), 'payment_description' => array('title' => __('Payment Description', 'pronamic_ideal'), 'type' => 'text', 'description' => sprintf('%s%s<br />%s<br />%s', $description_prefix, __('This controls the payment description.', 'pronamic_ideal'), sprintf(__('Default: <code>%s</code>.', 'pronamic_ideal'), Pronamic_WP_Pay_Extensions_WooCommerce_PaymentData::get_default_description()), sprintf(__('Tags: %s', 'pronamic_ideal'), sprintf('<code>%s</code> <code>%s</code> <code>%s</code>', '{order_number}', '{order_date}', '{blogname}'))), 'default' => Pronamic_WP_Pay_Extensions_WooCommerce_PaymentData::get_default_description()));
 }
Esempio n. 4
0
 /**
  * Register gateway settings.
  *
  * @param   array   $settings
  * @return  array
  * @since   1.0.0
  */
 public function gateway_settings($settings)
 {
     $settings['config_id'] = array('type' => 'select', 'title' => __('Configuration', 'pronamic_ideal'), 'priority' => 8, 'options' => Pronamic_WP_Pay_Plugin::get_config_select_options($this->payment_method), 'default' => get_option('pronamic_pay_config_id'));
     $settings['transaction_description'] = array('type' => 'text', 'title' => __('Transaction description', 'pronamic_ideal'), 'priority' => 8, 'default' => __('Charitable donation {donation_id}', 'pronamic_ideal'), 'help' => sprintf(__('Available tags: %s', 'pronamic_ideal'), sprintf('<code>%s</code>', '{donation_id}')));
     if (null === $this->payment_method) {
         $settings['gateway_info'] = array('type' => 'content', 'title' => '', 'priority' => 8, 'content' => sprintf('<p><em>%s</em></p>', __("This payment method does not use a predefined payment method for the payment. Some payment providers list all activated payment methods for your account to choose from. Use payment method specific gateways (such as 'iDEAL') to let customers choose their desired payment method at checkout.", 'pronamic_ideal')));
     }
     return $settings;
 }
Esempio n. 5
0
 /**
  * Register gateway settings.
  *
  * @param   array   $settings
  * @return  array
  * @since   1.0.0
  */
 public function gateway_settings($settings)
 {
     $description = '';
     if ('pronamic_pay' === $this->id) {
         $description = __("This payment method does not use a predefined payment method for the payment. Some payment providers list all activated payment methods for your account to choose from. Use payment method specific gateways (such as 'iDEAL') to let customers choose their desired payment method at checkout.", 'pronamic_ideal');
     }
     $settings[] = array('name' => $this->name, 'desc' => $description, 'id' => sprintf('give_title_%s', $this->id), 'type' => 'give_title');
     $settings[] = array('name' => __('Configuration', 'pronamic_ideal'), 'desc' => '', 'id' => sprintf('give_%s_configuration', $this->id), 'type' => 'select', 'options' => Pronamic_WP_Pay_Plugin::get_config_select_options($this->payment_method), 'default' => get_option('pronamic_pay_config_id'));
     $settings[] = array('name' => __('Transaction description', 'pronamic_ideal'), 'desc' => sprintf(__('Available tags: %s', 'pronamic_ideal'), sprintf('<code>%s</code>', '{donation_id}')), 'id' => sprintf('give_%s_transaction_description', $this->id), 'type' => 'text', 'default' => __('Give donation {donation_id}', 'pronamic_ideal'));
     return $settings;
 }
 /**
  * Gets the form for all the settings related to this payment method type
  *
  * @return EE_Payment_Method_Form
  */
 public function generate_new_settings_form()
 {
     EE_Registry::instance()->load_helper('Template');
     $config_options = Pronamic_WP_Pay_Plugin::get_config_select_options();
     // Fix for incorrect normalization strategy
     // @see https://github.com/eventespresso/event-espresso-core/blob/4.6.17.p/core/libraries/form_sections/inputs/EE_Form_Input_With_Options_Base.input.php#L89-L113
     $select_option = $config_options[0];
     unset($config_options[0]);
     $config_options = array('select' => $select_option) + $config_options;
     $form = new EE_Payment_Method_Form(array('extra_meta_inputs' => array('config_id' => new EE_Select_Input($config_options, array('html_label_text' => __('Configuration', 'pronamic_ideal'), 'default' => get_option('pronamic_pay_config_id'))), 'transaction_description' => new EE_Text_Input(array('html_label_text' => __('Transaction description', 'pronamic_ideal'), 'html_help_text' => sprintf(__('Available tags: %s', 'pronamic_ideal'), sprintf('<code>%s</code>', '{transaction_id}')), 'default' => __('Event Espresso transaction {transaction_id}', 'pronamic_ideal'))))));
     return $form;
 }
Esempio n. 7
0
 /**
  * Get default options
  *
  * @return array
  */
 protected function get_default_options()
 {
     $defaults = array();
     // Section
     $defaults[] = array('name' => __('Pronamic iDEAL', 'pronamic_ideal'), 'type' => 'title', 'desc' => __('Allow iDEAL payments.', 'pronamic_ideal'));
     // Options
     $defaults[] = array('name' => __('Enable iDEAL', 'pronamic_ideal'), 'desc' => '', 'tip' => '', 'id' => 'pronamic_pay_ideal_jigoshop_enabled', 'std' => 'yes', 'type' => 'checkbox', 'choices' => array('no' => __('No', 'pronamic_ideal'), 'yes' => __('Yes', 'pronamic_ideal')));
     $defaults[] = array('name' => __('Title', 'pronamic_ideal'), 'desc' => '', 'tip' => __('This controls the title which the user sees during checkout.', 'pronamic_ideal'), 'id' => 'pronamic_pay_ideal_jigoshop_title', 'std' => __('iDEAL', 'pronamic_ideal'), 'type' => 'text');
     $defaults[] = array('name' => __('Description', 'pronamic_ideal'), 'desc' => '', 'tip' => __('This controls the description which the user sees during checkout.', 'pronamic_ideal'), 'id' => 'pronamic_pay_ideal_jigoshop_description', 'std' => '', 'type' => 'longtext');
     $defaults[] = array('name' => __('Configuration', 'pronamic_ideal'), 'desc' => '', 'tip' => '', 'id' => 'pronamic_pay_ideal_jigoshop_config_id', 'std' => '', 'type' => 'select', 'choices' => Pronamic_WP_Pay_Plugin::get_config_select_options());
     return $defaults;
 }
Esempio n. 8
0
 /**
  * Returns an array representing the form to output for admin config
  */
 public function form()
 {
     $form_values = array(array('title' => __('Configuration', 'pronamic_ideal'), 'type' => 'select', 'name' => 'config_id', 'choices' => Pronamic_WP_Pay_Plugin::get_config_select_options()));
     $return_array = array('title' => __('General Information', 'pronamic_ideal'), 'fields' => $form_values);
     return $return_array;
 }
Esempio n. 9
0
 public static function dropdown_configs($args)
 {
     $defaults = array('name' => 'pronamic_pay_config_id', 'echo' => true, 'selected' => false);
     $args = wp_parse_args($args, $defaults);
     // Output
     $output = '';
     // Dropdown
     $id = $args['name'];
     $name = $args['name'];
     $selected = $args['selected'];
     if (false === $selected) {
         $selected = get_option($id);
     }
     $output .= sprintf('<select id="%s" name="%s">', esc_attr($id), esc_attr($name));
     $options = Pronamic_WP_Pay_Plugin::get_config_select_options();
     foreach ($options as $value => $name) {
         $output .= sprintf('<option value="%s" %s>%s</option>', esc_attr($value), selected($value, $selected, false), esc_html($name));
     }
     $output .= sprintf('</select>');
     // Return or echo
     if ($args['echo']) {
         echo $output;
         //xss ok
     } else {
         return $output;
     }
 }
Esempio n. 10
0
 /**
  * Settings
  */
 public function settings()
 {
     $options = Pronamic_WP_Pay_Plugin::get_config_select_options();
     $this->ui->menu(0, array('name' => 'config_id', 'keyed' => true, 'label' => __('Select configuration', 'pronamic_ideal'), 'selected' => $this->config_id), $options);
     $options = $this->get_payment_method_select_options();
     $this->ui->menu(1, array('name' => 'payment_method', 'keyed' => true, 'label' => __('Select payment method', 'pronamic_ideal'), 'selected' => $this->payment_method), $options);
 }
 /**
  * Register gateway settings.
  *
  * @param   array   $settings
  * @return  array
  * @since   1.0.0
  */
 public function gateway_settings($settings)
 {
     $settings['config_id'] = array('type' => 'select', 'title' => __('Configuration', 'pronamic_ideal'), 'priority' => 8, 'options' => Pronamic_WP_Pay_Plugin::get_config_select_options($this->payment_method), 'default' => get_option('pronamic_pay_config_id'));
     return $settings;
 }
 protected function prepare_fields()
 {
     $fields = array('config_id' => array('id' => 'config_id', 'type' => MS_Helper_Html::INPUT_TYPE_SELECT, 'title' => __('Configuration', 'pronamic_ideal'), 'field_options' => Pronamic_WP_Pay_Plugin::get_config_select_options(), 'value' => $this->gateway->config_id, 'class' => 'ms-text-large', 'ajax_data' => array(1)), 'button_image_url' => array('id' => 'button_image_url', 'type' => MS_Helper_Html::INPUT_TYPE_TEXT, 'title' => __('Button image URL', 'pronamic_ideal'), 'value' => $this->gateway->button_image_url, 'class' => 'ms-text-large', 'ajax_data' => array(1)), 'button_image_url_default' => array('id' => 'button_image_url_default', 'type' => MS_Helper_Html::TYPE_HTML_TEXT, 'value' => '<span class="ms-settings-description ms-description">' . sprintf(__('Default: <code>%s</code>', 'pronamic_ideal'), plugins_url('images/ideal-logo-pay-off-2-lines.png', Pronamic_WP_Pay_Plugin::$file)) . '</span>'), 'button_description' => array('id' => 'button_description', 'type' => MS_Helper_Html::INPUT_TYPE_TEXT, 'title' => __('Button description', 'pronamic_ideal'), 'value' => $this->gateway->button_description, 'class' => 'ms-text-large', 'ajax_data' => array(1)));
     return $fields;
 }
Esempio n. 13
0
    /**
     * Display options form.
     *
     * @see https://gitlab.com/pronamic/memberpress/blob/1.2.4/app/lib/MeprBaseGateway.php#L291-292
     */
    public function display_options_form()
    {
        $mepr_options = MeprOptions::fetch();
        ?>
		<table>
			<tr>
				<?php 
        $name = sprintf('%s[%s][%s]', $mepr_options->integrations_str, $this->id, 'config_id');
        // @see https://gitlab.com/pronamic/memberpress/blob/1.2.4/app/gateways/MeprAuthorizeGateway.php#L1027-1037
        ?>
				<td>
					<?php 
        esc_html_e('Configuration', 'pronamic_ideal');
        ?>
				</td>
				<td>
					<select name="<?php 
        echo esc_attr($name);
        ?>
">
						<?php 
        foreach (Pronamic_WP_Pay_Plugin::get_config_select_options($this->payment_method) as $value => $label) {
            printf('<option value="%s" %s>%s</option>', esc_attr($value), selected($value, $this->settings->config_id, false), esc_html($label));
        }
        ?>
					</select>
				</td>
			</tr>
		</table>
		<?php 
    }
 /**
  * Add the iDEAL configuration settings to the Easy Digital Downloads payment gateways settings page.
  *
  * @see https://github.com/easydigitaldownloads/Easy-Digital-Downloads/blob/2.2.8/includes/admin/settings/register-settings.php#L126
  *
  * @param mixed $settings_gateways
  * @return mixed $settings_gateways
  */
 public function settings_gateways($settings_gateways)
 {
     $settings_gateways[$this->id] = array('id' => $this->id, 'name' => '<strong>' . sprintf(__('%s Settings', 'pronamic_ideal'), $this->admin_label) . '</strong>', 'desc' => sprintf(__('Configure the %s settings', 'pronamic_ideal'), $this->admin_label), 'type' => 'header');
     $settings_gateways[$this->id . '_config_id'] = array('id' => $this->id . '_config_id', 'name' => __('Gateway Configuration', 'pronamic_ideal'), 'type' => 'select', 'options' => Pronamic_WP_Pay_Plugin::get_config_select_options($this->payment_method), 'std' => get_option('pronamic_pay_config_id'));
     $settings_gateways[$this->id . '_checkout_label'] = array('id' => $this->id . '_checkout_label', 'name' => __('Checkout Label', 'pronamic_ideal'), 'type' => 'text', 'std' => $this->checkout_label);
     return $settings_gateways;
 }