Exemplo n.º 1
0
 public function feed_settings_fields()
 {
     $default_settings = parent::feed_settings_fields();
     $customer_info_field = array('name' => 'customerInformation', 'label' => __('Customer Information', 'gravityformsstripe'), 'type' => 'field_map', 'dependency' => array('field' => 'transactionType', 'values' => array('subscription')), 'field_map' => array(array('name' => 'email', 'label' => __('Email', 'gravityformsstripe'), 'required' => true), array('name' => 'description', 'label' => __('Description', 'gravityformsstripe'), 'required' => false)));
     $default_settings = $this->replace_field('billingInformation', $customer_info_field, $default_settings);
     // Stripe does not support ending a subscription after a set number of payments
     $default_settings = $this->remove_field('recurringTimes', $default_settings);
     $trial_period_field = array('name' => 'trialPeriod', 'label' => __('Trial Period', 'gravityformsstripe'), 'style' => 'width:40px;text-align:center;', 'type' => 'trial_period', 'validation_callback' => array($this, 'validate_trial_period'));
     $default_settings = $this->add_field_after('trial', $trial_period_field, $default_settings);
     if ($this->get_setting('transactionType') == 'product') {
         $receipt_settings = array('name' => 'receipt', 'label' => 'Stripe Receipt', 'type' => 'receipt', 'tooltip' => __('<h6>Stripe Receipt</h6> Stripe can send a receipt via email upon payment. Select an email field to enable this feature.', 'gravityforms'));
         $default_settings = $this->add_field_before('conditionalLogic', $receipt_settings, $default_settings);
     }
     return $default_settings;
 }
 public function feed_settings_fields()
 {
     $default_settings = parent::feed_settings_fields();
     if ($this->getAllowPaymentActionOverride() == 'yes') {
         $authorize_or_charge_field = array('name' => 'authorize_or_charge', 'label' => __('Payment Action', 'gravityforms-securesubmit'), 'type' => 'select', 'default_value' => 'capture', 'tooltip' => __('Choose whether you wish to capture funds immediately or authorize payment only.', 'gravityforms-securesubmit'), 'choices' => array(array('label' => __('Capture', 'gravityforms-securesubmit'), 'value' => 'capture'), array('label' => __('Authorize', 'gravityforms-securesubmit'), 'value' => 'authorize')));
         if ($this->getAuthorizeOrCharge() == 'capture') {
             $authorize_or_charge_field['choices'][0]['selected'] = true;
         } else {
             $authorize_or_charge_field['choices'][1]['selected'] = true;
         }
         $default_settings = $this->add_field_after('paymentAmount', $authorize_or_charge_field, $default_settings);
     }
     if ($this->getAllowAPIKeysOverride() == 'yes') {
         $public_api_key_field = array('name' => 'public_api_key', 'label' => __('Public Key', 'gravityforms-securesubmit'), 'type' => 'text', 'class' => 'medium', 'onchange' => "SecureSubmitAdmin.validateKey('public_api_key', this.value);");
         $secret_api_key_field = array('name' => 'secret_api_key', 'label' => __('Secret Key', 'gravityforms-securesubmit'), 'type' => 'text', 'class' => 'medium', 'onchange' => "SecureSubmitAdmin.validateKey('secret_api_key', this.value);");
         $default_settings = $this->add_field_after('paymentAmount', $public_api_key_field, $default_settings);
         $default_settings = $this->add_field_after('paymentAmount', $secret_api_key_field, $default_settings);
     }
     return $default_settings;
 }
Exemplo n.º 3
0
 public function feed_settings_fields()
 {
     $default_settings = parent::feed_settings_fields();
     //--add PayPal Email Address field
     $fields = array(array('name' => 'paypalEmail', 'label' => __('PayPal Email Address ', 'gravityformspaypal'), 'type' => 'text', 'class' => 'medium', 'required' => true, 'tooltip' => '<h6>' . __('PayPal Email Address', 'gravityformspaypal') . '</h6>' . __('Enter the PayPal email address where payment should be received.', 'gravityformspaypal')), array('name' => 'mode', 'label' => __('Mode', 'gravityformspaypal'), 'type' => 'radio', 'choices' => array(array('id' => 'gf_paypal_mode_production', 'label' => __('Production', 'gravityformspaypal'), 'value' => 'production'), array('id' => 'gf_paypal_mode_test', 'label' => __('Test', 'gravityformspaypal'), 'value' => 'test')), 'horizontal' => true, 'default_value' => 'production', 'tooltip' => '<h6>' . __('Mode', 'gravityformspaypal') . '</h6>' . __('Select Production to receive live payments. Select Test for testing purposes when using the PayPal development sandbox.', 'gravityformspaypal')));
     $default_settings = parent::add_field_after('feedName', $fields, $default_settings);
     //--------------------------------------------------------------------------------------
     //--add donation to transaction type drop down
     $transaction_type = parent::get_field('transactionType', $default_settings);
     $choices = $transaction_type['choices'];
     $add_donation = true;
     foreach ($choices as $choice) {
         //add donation option if it does not already exist
         if ($choice['value'] == 'donation') {
             $add_donation = false;
         }
     }
     if ($add_donation) {
         //add donation transaction type
         $choices[] = array('label' => __('Donations', 'gravityformspaypal'), 'value' => 'donation');
     }
     $transaction_type['choices'] = $choices;
     $default_settings = $this->replace_field('transactionType', $transaction_type, $default_settings);
     //-------------------------------------------------------------------------------------------------
     //--add Page Style, Continue Button Label, Cancel URL
     $fields = array(array('name' => 'pageStyle', 'label' => __('Page Style', 'gravityformspaypal'), 'type' => 'text', 'class' => 'medium', 'required' => false, 'tooltip' => '<h6>' . __('Page Style', 'gravityformspaypal') . '</h6>' . __('This option allows you to select which PayPal page style should be used if you have setup a custom payment page style with PayPal.', 'gravityformspaypal')), array('name' => 'continueText', 'label' => __('Continue Button Label', 'gravityformspaypal'), 'type' => 'text', 'class' => 'medium', 'required' => false, 'tooltip' => '<h6>' . __('Continue Button Label', 'gravityformspaypal') . '</h6>' . __('Enter the text that should appear on the continue button once payment has been completed via PayPal.', 'gravityformspaypal')), array('name' => 'cancelUrl', 'label' => __('Cancel URL', 'gravityformspaypal'), 'type' => 'text', 'class' => 'medium', 'required' => false, 'tooltip' => '<h6>' . __('Cancel URL', 'gravityformspaypal') . '</h6>' . __('Enter the URL the user should be sent to should they cancel before completing their PayPal payment.', 'gravityformspaypal')), array('name' => 'options', 'label' => __('Options', 'gravityformspaypal'), 'type' => 'options', 'tooltip' => '<h6>' . __('Options', 'gravityformspaypal') . '</h6>' . __('Turn on or off the available PayPal checkout options.', 'gravityformspaypal')), array('name' => 'notifications', 'label' => __('Notifications', 'gravityformspaypal'), 'type' => 'notifications', 'tooltip' => '<h6>' . __('Notifications', 'gravityformspaypal') . '</h6>' . __("Enable this option if you would like to only send out this form's notifications after payment has been received. Leaving this option disabled will send notifications immediately after the form is submitted.", 'gravityformspaypal')));
     //Add post fields if form has a post
     $form = $this->get_current_form();
     if (GFCommon::has_post_field($form['fields'])) {
         $post_settings = array('name' => 'post_checkboxes', 'label' => __('Posts', 'gravityformspaypal'), 'type' => 'checkbox', 'tooltip' => '<h6>' . __('Posts', 'gravityformspaypal') . '</h6>' . __('Enable this option if you would like to only create the post after payment has been received.', 'gravityformspaypal'), 'choices' => array(array('label' => __('Create post only when payment is received.', 'gravityformspaypal'), 'name' => 'delayPost')));
         if ($this->get_setting('transactionType') == 'subscription') {
             $post_settings['choices'][] = array('label' => __('Change post status when subscription is canceled.', 'gravityformspaypal'), 'name' => 'change_post_status', 'onChange' => 'var action = this.checked ? "draft" : ""; jQuery("#update_post_action").val(action);');
         }
         $fields[] = $post_settings;
     }
     //Adding custom settings for backwards compatibility with hook 'gform_paypal_add_option_group'
     $fields[] = array('name' => 'custom_options', 'label' => '', 'type' => 'custom');
     $default_settings = $this->add_field_after('billingInformation', $fields, $default_settings);
     //-----------------------------------------------------------------------------------------
     //--get billing info section and add customer first/last name
     $billing_info = parent::get_field('billingInformation', $default_settings);
     $billing_fields = $billing_info['field_map'];
     $add_first_name = true;
     $add_last_name = true;
     foreach ($billing_fields as $mapping) {
         //add first/last name if it does not already exist in billing fields
         if ($mapping['name'] == 'firstName') {
             $add_first_name = false;
         } else {
             if ($mapping['name'] == 'lastName') {
                 $add_last_name = false;
             }
         }
     }
     if ($add_last_name) {
         //add last name
         array_unshift($billing_info['field_map'], array('name' => 'lastName', 'label' => __('Last Name', 'gravityformspaypal'), 'required' => false));
     }
     if ($add_first_name) {
         array_unshift($billing_info['field_map'], array('name' => 'firstName', 'label' => __('First Name', 'gravityformspaypal'), 'required' => false));
     }
     $default_settings = parent::replace_field('billingInformation', $billing_info, $default_settings);
     //----------------------------------------------------------------------------------------------------
     //hide default display of setup fee, not used by PayPal Standard
     $default_settings = parent::remove_field('setupFee', $default_settings);
     //--add trial period
     $trial_period = array('name' => 'trialPeriod', 'label' => __('Trial Period', 'gravityformspaypal'), 'type' => 'trial_period', 'hidden' => !$this->get_setting('trial_enabled'), 'tooltip' => '<h6>' . __('Trial Period', 'gravityformspaypal') . '</h6>' . __('Select the trial period length.', 'gravityformspaypal'));
     $default_settings = parent::add_field_after('trial', $trial_period, $default_settings);
     //-----------------------------------------------------------------------------------------
     //--Add Try to bill again after failed attempt.
     $recurring_retry = array('name' => 'recurringRetry', 'label' => __('Recurring Retry', 'gravityformspaypal'), 'type' => 'checkbox', 'horizontal' => true, 'choices' => array(array('label' => __('Try to bill again after failed attempt.', 'gravityformspaypal'), 'name' => 'recurringRetry', 'value' => '1')), 'tooltip' => '<h6>' . __('Recurring Retry', 'gravityformspaypal') . '</h6>' . __('Turn on or off whether to try to bill again after failed attempt.', 'gravityformspaypal'));
     $default_settings = parent::add_field_after('recurringTimes', $recurring_retry, $default_settings);
     //-----------------------------------------------------------------------------------------------------
     return apply_filters('gform_paypal_feed_settings_fields', $default_settings, $form);
 }
Exemplo n.º 4
0
 /**
  * Configures the settings which should be rendered on the feed edit page.
  *
  * @return array The feed settings.
  */
 public function feed_settings_fields()
 {
     $default_settings = parent::feed_settings_fields();
     $customer_info_field = array('name' => 'customerInformation', 'label' => esc_html__('Customer Information', 'gravityformsstripe'), 'type' => 'field_map', 'dependency' => array('field' => 'transactionType', 'values' => array('subscription')), 'field_map' => array(array('name' => 'email', 'label' => esc_html__('Email', 'gravityformsstripe'), 'required' => true, 'field_type' => array('email', 'hidden')), array('name' => 'description', 'label' => esc_html__('Description', 'gravityformsstripe'), 'required' => false), array('name' => 'coupon', 'label' => esc_html__('Coupon', 'gravityformsstripe'), 'required' => false, 'field_type' => array('coupon', 'text'), 'tooltip' => '<h6>' . esc_html__('Coupon', 'gravityformsstripe') . '</h6>' . esc_html__('Select which field contains the coupon code to be applied to the recurring charge(s). The coupon must also exist in your Stripe Dashboard.', 'gravityformsstripe'))));
     $default_settings = $this->replace_field('billingInformation', $customer_info_field, $default_settings);
     //set part of tooltip depending on transaction type
     if ($this->get_setting('transactionType') == 'subscription') {
         $info = esc_html__('You will see this data when viewing a customer page.', 'gravityformsstripe');
     } else {
         $info = esc_html__('You will see this data when viewing a payment page.', 'gravityformsstripe');
     }
     //add custom  meta information
     $custom_meta = array(array('name' => 'metaData', 'label' => esc_html__('Metadata', 'gravityformsstripe'), 'type' => 'dynamic_field_map', 'limit' => 20, 'exclude_field_types' => 'creditcard', 'tooltip' => '<h6>' . esc_html__('Metadata', 'gravityformsstripe') . '</h6>' . esc_html__('You may send custom meta information to Stripe. A maximum of 20 custom keys may be sent. The key name must be 40 characters or less, and the mapped data will be truncated to 500 characters per requirements by Stripe. ' . $info, 'gravityformsstripe'), 'validation_callback' => array($this, 'validate_custom_meta')));
     $default_settings = $this->add_field_after('customerInformation', $custom_meta, $default_settings);
     // Stripe does not support ending a subscription after a set number of payments
     $default_settings = $this->remove_field('recurringTimes', $default_settings);
     $trial_period_field = array('name' => 'trialPeriod', 'label' => esc_html__('Trial Period', 'gravityformsstripe'), 'style' => 'width:40px;text-align:center;', 'type' => 'trial_period', 'validation_callback' => array($this, 'validate_trial_period'));
     $default_settings = $this->add_field_after('trial', $trial_period_field, $default_settings);
     if ($this->get_setting('transactionType') == 'product') {
         $receipt_settings = array('name' => 'receipt', 'label' => 'Stripe Receipt', 'type' => 'receipt', 'tooltip' => '<h6>' . esc_html__('Stripe Receipt', 'gravityformsstripe') . '</h6>' . esc_html__('Stripe can send a receipt via email upon payment. Select an email field to enable this feature.', 'gravityformsstripe'));
         $default_settings = $this->add_field_before('conditionalLogic', $receipt_settings, $default_settings);
     }
     return $default_settings;
 }
 /**
  * Configures the settings which should be rendered on the feed edit page.
  *
  * @return array The feed settings.
  */
 public function feed_settings_fields()
 {
     $default_settings = parent::feed_settings_fields();
     //remove default options before adding custom
     $default_settings = parent::remove_field('options', $default_settings);
     $default_settings = parent::remove_field('billingCycle', $default_settings);
     $default_settings = parent::remove_field('trial', $default_settings);
     //add pay period if subscription
     if ($this->get_setting('transactionType') == 'subscription') {
         $pay_period_field = array('name' => 'payPeriod', 'label' => esc_html__('Pay Period', 'gravityformspaypalpaymentspro'), 'type' => 'select', 'choices' => array(array('label' => esc_html__('Weekly', 'gravityformspaypalpaymentspro'), 'value' => 'WEEK'), array('label' => esc_html__('Every Two Weeks', 'gravityformspaypalpaymentspro'), 'value' => 'BIWK'), array('label' => esc_html__('Twice Every Month', 'gravityformspaypalpaymentspro'), 'value' => 'SMMO'), array('label' => esc_html__('Every Four Weeks', 'gravityformspaypalpaymentspro'), 'value' => 'FRWK'), array('label' => esc_html__('Monthly', 'gravityformspaypalpaymentspro'), 'value' => 'MONT'), array('label' => esc_html__('Quarterly', 'gravityformspaypalpaymentspro'), 'value' => 'QTER'), array('label' => esc_html__('Twice Every Year', 'gravityformspaypalpaymentspro'), 'value' => 'SMYR'), array('label' => esc_html__('Yearly', 'gravityformspaypalpaymentspro'), 'value' => 'YEAR')), 'tooltip' => '<h6>' . esc_html__('Pay Period', 'gravityformspaypalpaymentspro') . '</h6>' . esc_html__('Select pay period.  This determines how often the recurring payment should occur.', 'gravityformspaypalpaymentspro'));
         $default_settings = $this->add_field_after('recurringAmount', $pay_period_field, $default_settings);
         //Add post fields if form has a post
         $form = $this->get_current_form();
         if (GFCommon::has_post_field($form['fields'])) {
             $post_settings = array('name' => 'post_checkboxes', 'label' => esc_html__('Posts', 'gravityformspaypalpaymentspro'), 'type' => 'checkbox', 'tooltip' => '<h6>' . esc_html__('Posts', 'gravityformspaypalpaymentspro') . '</h6>' . esc_html__('Enable this option if you would like to change the post status when a subscription is cancelled.', 'gravityformspaypalpaymentspro'), 'choices' => array(array('label' => esc_html__('Update Post when subscription is cancelled.', 'gravityformspaypalpaymentspro'), 'name' => 'change_post_status', 'onChange' => 'var action = this.checked ? "draft" : ""; jQuery("#update_post_action").val(action);')));
             $default_settings = $this->add_field_after('billingInformation', $post_settings, $default_settings);
         }
     }
     $fields = array(array('name' => 'apiSettingsEnabled', 'label' => esc_html__('API Settings', 'gravityformspaypalpaymentspro'), 'type' => 'checkbox', 'tooltip' => '<h6>' . esc_html__('API Settings', 'gravityformspaypalpaymentspro') . '</h6>' . esc_html__('Override the settings provided on the PayPal Payments Pro Settings page and use these instead for this feed.', 'gravityformspaypalpaymentspro'), 'onchange' => "if(jQuery(this).prop('checked')){\r\n\t\t\t\t\t\t\t\t\t\tjQuery('#gaddon-setting-row-overrideMode').show();\r\n\t\t\t\t\t\t\t\t\t\tjQuery('#gaddon-setting-row-overrideUsername').show();\r\n\t\t\t\t\t\t\t\t\t\tjQuery('#gaddon-setting-row-overridePassword').show();\r\n\t\t\t\t\t\t\t\t\t\tjQuery('#gaddon-setting-row-overrideVendor').show();\r\n\t\t\t\t\t\t\t\t\t\tjQuery('#gaddon-setting-row-overridePartner').show();\r\n\t\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t\tjQuery('#gaddon-setting-row-overrideMode').hide();\r\n\t\t\t\t\t\t\t\t\t\tjQuery('#gaddon-setting-row-overrideUsername').hide();\r\n\t\t\t\t\t\t\t\t\t\tjQuery('#gaddon-setting-row-overridePassword').hide();\r\n\t\t\t\t\t\t\t\t\t\tjQuery('#gaddon-setting-row-overrideVendor').hide();\r\n\t\t\t\t\t\t\t\t\t\tjQuery('#gaddon-setting-row-overridePartner').hide();\r\n\t\t\t\t\t\t\t\t\t\tjQuery('#overrideUsername').val('');\r\n\t\t\t\t\t\t\t\t\t\tjQuery('#overridePassword').val('');\r\n\t\t\t\t\t\t\t\t\t\tjQuery('#overrideVendor').val('');\r\n\t\t\t\t\t\t\t\t\t\t//jQuery('#overridePartner').val('');\r\n\t\t\t\t\t\t\t\t\t\tjQuery('i').removeClass('icon-check fa-check gf_valid');\r\n\t\t\t\t\t\t\t\t\t}", 'choices' => array(array('label' => 'Override Default Settings', 'name' => 'apiSettingsEnabled'))), array('name' => 'overrideMode', 'label' => esc_html__('API', 'gravityformspaypalpaymentspro'), 'type' => 'radio', 'hidden' => !$this->get_setting('apiSettingsEnabled'), 'tooltip' => '<h6>' . esc_html__('API', 'gravityformspaypalpaymentspro') . '</h6>' . esc_html__('Select either Production or Sandbox API to override the chosen mode on the PayPal Payments Pro Settings page.', 'gravityformspaypalpaymentspro'), 'choices' => array(array('label' => esc_html__('Production', 'gravityformspaypalpaymentspro'), 'value' => 'production'), array('label' => esc_html__('Sandbox', 'gravityformspaypalpaymentspro'), 'value' => 'test')), 'horizontal' => true), array('name' => 'overrideUsername', 'label' => esc_html__('Username', 'gravityformspaypalpaymentspro'), 'type' => 'text', 'class' => 'medium', 'hidden' => !$this->get_setting('apiSettingsEnabled'), 'tooltip' => '<h6>' . esc_html__('Username', 'gravityformspaypalpaymentspro') . '</h6>' . esc_html__('Enter a new value to override the Username on the PayPal Payments Pro Settings page.', 'gravityformspaypalpaymentspro'), 'feedback_callback' => array($this, 'is_valid_override_credentials')), array('name' => 'overridePassword', 'label' => esc_html__('Password', 'gravityformspaypalpaymentspro'), 'type' => 'password', 'class' => 'medium', 'hidden' => !$this->get_setting('apiSettingsEnabled'), 'tooltip' => '<h6>' . esc_html__('Password', 'gravityformspaypalpaymentspro') . '</h6>' . esc_html__('Enter a new value to override the Password on the PayPal Payments Pro Settings page.', 'gravityformspaypalpaymentspro'), 'feedback_callback' => array($this, 'check_valid_override_credential_setting')), array('name' => 'overrideVendor', 'label' => esc_html__('Vendor (optional)', 'gravityformspaypalpaymentspro'), 'type' => 'vendor', 'class' => 'medium', 'hidden' => !$this->get_setting('apiSettingsEnabled'), 'tooltip' => '<h6>' . esc_html__('Vendor', 'gravityformspaypalpaymentspro') . '</h6>' . esc_html__('Enter a new value to override the Vendor on the PayPal Payments Pro Settings page.', 'gravityformspaypalpaymentspro'), 'feedback_callback' => array($this, 'check_valid_override_credential_setting')), array('name' => 'overridePartner', 'label' => esc_html__('Partner', 'gravityformspaypalpaymentspro'), 'type' => 'partner', 'class' => 'medium', 'hidden' => !$this->get_setting('apiSettingsEnabled'), 'tooltip' => '<h6>' . esc_html__('Partner', 'gravityformspaypalpaymentspro') . '</h6>' . esc_html__('Enter a new value to override the Partner on the PayPal Payments Pro Settings page.', 'gravityformspaypalpaymentspro'), 'default_value' => 'PayPal', 'feedback_callback' => array($this, 'check_valid_override_credential_setting')));
     $default_settings = $this->add_field_after('conditionalLogic', $fields, $default_settings);
     return $default_settings;
 }
 public function feed_settings_fields()
 {
     $default_settings = parent::feed_settings_fields();
     //remove default options before adding custom
     $default_settings = parent::remove_field('options', $default_settings);
     $fields = array(array('name' => 'options', 'label' => esc_html__('Options', 'gravityformsauthorizenet'), 'type' => 'options', 'tooltip' => '<h6>' . esc_html__('Options', 'gravityformsauthorizenet') . '</h6>' . esc_html__('Turn on or off the available Authorize.Net checkout options.', 'gravityformsauthorizenet')));
     //Add post fields if form has a post
     $form = $this->get_current_form();
     if (GFCommon::has_post_field($form['fields'])) {
         if ($this->get_setting('transactionType') == 'subscription') {
             $post_settings = array('name' => 'post_checkboxes', 'label' => esc_html__('Posts', 'gravityformsauthorizenet'), 'type' => 'checkbox', 'tooltip' => '<h6>' . esc_html__('Posts', 'gravityformsauthorizenet') . '</h6>' . esc_html__('Enable this option if you would like to change the post status when a subscription is canceled.', 'gravityformsauthorizenet'), 'choices' => array(array('label' => esc_html__('Change post status when subscription is canceled.', 'gravityformsauthorizenet'), 'name' => 'change_post_status', 'onChange' => 'var action = this.checked ? "draft" : ""; jQuery("#update_post_action").val(action);')));
             $fields[] = $post_settings;
         }
     }
     $default_settings = $this->add_field_after('billingInformation', $fields, $default_settings);
     $fields = array(array('name' => 'apiSettingsEnabled', 'label' => esc_html__('API Settings', 'gravityformsauthorizenet'), 'type' => 'checkbox', 'tooltip' => '<h6>' . esc_html__('API Settings', 'gravityformsauthorizenet') . '</h6>' . esc_html__('Override the settings provided on the Authorize.Net Settings page and use these instead for this feed.', 'gravityformsauthorizenet'), 'onchange' => "if(jQuery(this).prop('checked')){\r\n\t\t\t\t\t\t\t\t\t\tjQuery('#gaddon-setting-row-overrideMode').show();\r\n\t\t\t\t\t\t\t\t\t\tjQuery('#gaddon-setting-row-overrideLogin').show();\r\n\t\t\t\t\t\t\t\t\t\tjQuery('#gaddon-setting-row-overrideKey').show();\r\n\t\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t\tjQuery('#gaddon-setting-row-overrideMode').hide();\r\n\t\t\t\t\t\t\t\t\t\tjQuery('#gaddon-setting-row-overrideLogin').hide();\r\n\t\t\t\t\t\t\t\t\t\tjQuery('#gaddon-setting-row-overrideKey').hide();\r\n\t\t\t\t\t\t\t\t\t\tjQuery('#overrideLogin').val('');\r\n\t\t\t\t\t\t\t\t\t\tjQuery('#overrideKey').val('');\r\n\t\t\t\t\t\t\t\t\t\tjQuery('i').removeClass('icon-check fa-check gf_valid');\r\n\t\t\t\t\t\t\t\t\t}", 'choices' => array(array('label' => 'Override Default Settings', 'name' => 'apiSettingsEnabled'))), array('name' => 'overrideMode', 'label' => esc_html__('Mode', 'gravityformsauthorizenet'), 'type' => 'radio', 'default_value' => 'test', 'hidden' => !$this->get_setting('apiSettingsEnabled'), 'tooltip' => '<h6>' . esc_html__('Mode', 'gravityformsauthorizenet') . '</h6>' . esc_html__('Select either Production or Test mode to override the chosen mode on the Authorize.Net Settings page.', 'gravityformsauthorizenet'), 'choices' => array(array('label' => esc_html__('Production', 'gravityformsauthorizenet'), 'value' => 'production'), array('label' => esc_html__('Test', 'gravityformsauthorizenet'), 'value' => 'test')), 'horizontal' => true), array('name' => 'overrideLogin', 'label' => esc_html__('API Login ID', 'gravityformsauthorizenet'), 'type' => 'text', 'class' => 'medium', 'hidden' => !$this->get_setting('apiSettingsEnabled'), 'tooltip' => '<h6>' . esc_html__('API Login ID', 'gravityformsauthorizenet') . '</h6>' . esc_html__('Enter a new value to override the API Login ID on the Authorize.Net Settings page.', 'gravityformsauthorizenet'), 'feedback_callback' => array($this, 'is_valid_custom_key')), array('name' => 'overrideKey', 'label' => esc_html__('Transaction Key', 'gravityformsauthorizenet'), 'type' => 'text', 'class' => 'medium', 'hidden' => !$this->get_setting('apiSettingsEnabled'), 'tooltip' => '<h6>' . esc_html__('Transaction Key', 'gravityformsauthorizenet') . '</h6>' . esc_html__('Enter a new value to override the Transaction Key on the Authorize.Net Settings page.', 'gravityformsauthorizenet'), 'feedback_callback' => array($this, 'is_valid_custom_key')));
     $default_settings = $this->add_field_after('conditionalLogic', $fields, $default_settings);
     return $default_settings;
 }
 /**
  * Create and display feed settings fields.
  *
  * @since 1.0
  * @return void
  */
 public function feed_settings_fields()
 {
     // Get defaults from GFPaymentAddOn
     $settings = parent::feed_settings_fields();
     // Remove billing information
     $settings = $this->remove_field('billingInformation', $settings);
     // Remove options
     $settings = $this->remove_field('options', $settings);
     // Remove the subscription option from transaction type dropdown
     $transaction_type = $this->get_field('transactionType', $settings);
     foreach ($transaction_type['choices'] as $index => $choice) {
         if ($choice['value'] == 'subscription') {
             unset($transaction_type['choices'][$index]);
         }
     }
     $settings = $this->replace_field('transactionType', $transaction_type, $settings);
     // Return sanitized settings
     return $settings;
 }