You are here

function commerce_payleap_base_settings_form in Commerce Payleap 7

Build common form for both payment method.

2 calls to commerce_payleap_base_settings_form()
commerce_payleap_cof_settings_form in ./commerce_payleap.module
Payment method callback: settings form.
commerce_payleap_direct_settings_form in ./commerce_payleap.module
Payment method callback: settings form.

File

./commerce_payleap.module, line 169
Implements PayLeap payment services for use in Drupal Commerce.

Code

function commerce_payleap_base_settings_form($settings) {

  // Merge default settings into the stored settings array.
  $form = array();
  $form['login'] = array(
    '#type' => 'textfield',
    '#title' => t('PayLeap API login ID'),
    '#description' => t('Your API Login ID'),
    '#default_value' => $settings['login'],
    '#required' => TRUE,
    '#weight' => -5,
  );
  $form['tran_key'] = array(
    '#type' => 'textfield',
    '#title' => t('PayLeap API transaction key'),
    '#description' => t('Transaction Key are unique pieces of information specifically associated with your payment gateway account'),
    '#default_value' => $settings['tran_key'],
    '#required' => TRUE,
    '#weight' => -4,
  );
  $form['txn_mode'] = array(
    '#type' => 'radios',
    '#title' => t('Transaction mode'),
    '#description' => t('Adjust to live transactions when you are ready to start processing real payments.'),
    '#options' => array(
      PAYLEAP_TXN_MODE_PRODUCTION => t('Live transactions in a production account'),
      PAYLEAP_TXN_MODE_TEST => t('Test transactions with your account'),
    ),
    '#default_value' => $settings['txn_mode'],
  );
  $form['log'] = array(
    '#type' => 'checkboxes',
    '#title' => t('Log the following messages for debugging'),
    '#options' => array(
      'request' => t('API request messages'),
      'response' => t('API response messages'),
    ),
    '#default_value' => $settings['log'],
  );
  return $form;
}