You are here

public function StripePaymentMethodController::payment_configuration_form_elements in Stripe 7

Builder callback for the payment configuration form elements.

TODO: Support form WITHOUT Stripe.js. (see TODO for payment_method_configuration_form_elements) TODO: Support option to (not) collect card holder's name. TODO: Support option to collect card holder's address.

Parameters

array $element: The parent element.

array $form_state: The form states.

Return value

array The forms elements to configure a payment.

File

stripe_payment/includes/StripePaymentMethodController.inc, line 614
Stripe Payment controller class and helper code (classes and function).

Class

StripePaymentMethodController

Code

public function payment_configuration_form_elements(array $element, array &$form_state) {
  $payment = $form_state['payment'];
  $publishable_key = !empty($payment->method->controller_data['keys']['mode']) ? $payment->method->controller_data['keys']['publishable'] : stripe_get_key('publishable');
  $element = array(
    '#type' => 'stripe_payment',
    '#publishable_key' => $publishable_key,
  );
  return array(
    'stripe' => $element,
  );
}