You are here

function mollie_payment_method_configuration in Mollie Payment 7.2

Same name and namespace in other branches
  1. 7 mollie_payment.module \mollie_payment_method_configuration()

Payment method configuration form elements callback.

Parameters

array $form: A Drupal form array.

array $form_state: The current state of the form.

Return value

array A Drupal form array.

File

./mollie_payment.module, line 679
Provides Mollie integration for the Payment platform.

Code

function mollie_payment_method_configuration(array $form, array &$form_state) {
  $controller_data = $form_state['payment_method']->controller_data;
  if (!is_array($form)) {
    $form = array();
  }
  $form['mollie_api_key'] = array(
    '#type' => 'password',
    '#title' => t('Mollie API key'),
    '#description' => t('Your Mollie API key. Leave empty to use the current or your default key.'),
  );
  $form['mollie_test_api_key'] = array(
    '#type' => 'password',
    '#title' => t('Mollie test API key'),
    '#description' => t('Your Mollie test API key. Leave empty to use the current or your default key.'),
  );
  $form['advanced'] = array(
    '#type' => 'checkbox',
    '#title' => t('Advanced'),
    '#description' => t('In advanced mode the payer can select the payment method in Drupal.'),
    '#default_value' => isset($controller_data['advanced']) ? $controller_data['advanced'] : 0,
  );
  $form['test_mode'] = array(
    '#type' => 'checkbox',
    '#title' => t('Test mode'),
    '#description' => t('In test mode the test API key is used and no real money is transfered.'),
    '#default_value' => isset($controller_data['test_mode']) ? $controller_data['test_mode'] : 0,
  );
  $form['webhook_base_url'] = array(
    '#type' => 'textfield',
    '#title' => t('Webhook Base URL'),
    '#description' => t('When testing in a local environment you may want to use a service like ngrok to
    make your environment accessible from the outside. Leave empty for online environments. Please note
    that Mollie checks the webhook URLs for a valid TLD. Mollie Payment does not work with a
    local test domain like my-project.dev.'),
    '#default_value' => isset($controller_data['webhook_base_url']) ? $controller_data['webhook_base_url'] : '',
  );
  return $form;
}