function uc_recurring_settings_form in Ubercart 5
1 string reference to 'uc_recurring_settings_form'
- uc_recurring_product_feature in payment/
uc_recurring/ uc_recurring.module - Implementation of hook_product_feature().
File
- payment/
uc_recurring/ uc_recurring.module, line 520 - Allows you to add a recurring fee to a product/SKU to handle subscription type services.
Code
function uc_recurring_settings_form() {
$form['uc_recurring_handler'] = array(
'#type' => 'select',
'#title' => t('Recurring fee handler'),
'#description' => t('Select a module to process recurring fees on your site.'),
'#options' => drupal_map_assoc(module_implements('recurring_fee', TRUE)),
'#default_value' => variable_get('uc_recurring_handler', 'uc_recurring'),
);
foreach (_payment_method_list() as $method) {
$options[$method['id']] = $method['name'];
}
$form['uc_recurring_payment_methods'] = array(
'#type' => 'checkboxes',
'#title' => t('Valid payment methods for orders with recurring fees'),
'#description' => t('Only selected payment methods will be available for customers purchasing products with recurring fees.<br />It is up to you to make sure your chosen handler is compatible with the payment methods you select.<br />For example, the uc_recurring handler is only compatible with the Credit Card payment method.'),
'#options' => $options,
'#default_value' => variable_get('uc_recurring_payment_methods', array()),
);
$form['uc_recurring_checkout_message'] = array(
'#type' => 'textarea',
'#title' => t('Recurring free checkout form message'),
'#description' => t('Enter a message to be displayed on the checkout form page when a customer has products in the cart with recurring fees.<br />Leave blank to not display any message.'),
'#default_value' => variable_get('uc_recurring_checkout_message', ''),
);
$form['uc_recurring_checkout_process'] = array(
'#type' => 'checkbox',
'#title' => t('Attempt to process recurring fees during checkout.'),
'#description' => t('If not selected, you must have an alternate way of processing fees.<br />With the default handler, this is only possible in credit card debug mode.'),
'#default_value' => variable_get('uc_recurring_checkout_process', TRUE),
);
$form['uc_recurring_checkout_fail'] = array(
'#type' => 'radios',
'#title' => t('Action to take if a recurring fee fails to process during checkout'),
'#description' => t('Regardless of your selection, an admin comment will report the failure.<br /><strong>Note:</strong> Even if you select the first option, checkout will complete if another payment has already been captured.'),
'#options' => array(
'fail' => t('Return a failed message and do not complete checkout.'),
'proceed' => t('Return a failed message but complete checkout.'),
'silent' => t('Show no message and complete checkout.'),
),
'#default_value' => variable_get('uc_recurring_checkout_fail', 'fail'),
);
return $form;
}