Form API

Stripe Elements Options

The Javascript defaults you can override with the stripeElementsOptions parameter to the form template function.

Name Description Default
singleElement Use a single Stripe Elements element false
cardNumber Document selector for card number div .card_number
cardExpiry Document selector for card expiry div .card_expiry
cardCvc Document selector for card cvc div .card_cvc
style Styles to apply {}
paymentButton Document selector for the payment button that we bind to in order to intiate payment .payment_button
paymentRequestButton Document selector for where the payment request button is placed .payment_request_button
errorMessage Document selector for where the error messages that are received from Stripe are placed .stripe_error
creditCardValidationFields Fields to validate see below
paymentRequestStyle Options to pass to Stripe Payment Request button see below

creditCardValidationFields

The credit card validation fields allows you to specify which fields need to be non-empty before payment is attempted. It defaults to the following.

creditCardValidationFields = {
  first_name: true,
  surname: true,
  address_1: true,
  city: true,
  postcode: true,
  country: true,
  email: true
};

paymentRequestStyle

The parameters to pass to the Stripe Elements Payment Request button. It defaults to the following:

paymentRequestStyle = {
  type: 'donate',
  theme: 'dark',
  height: '60px'
};

On this page