CardInputWidget
A single-line card input widget.
To enable 19-digit card support, PaymentConfiguration.init must be called before CardInputWidget is instantiated.
The individual EditText
views of this widget can be styled by defining a style Stripe.CardInputWidget.EditText
that extends Stripe.Base.CardInputWidget.EditText
.
The card number, cvc, and expiry date will always be left to right regardless of locale. Postal code layout direction will be set according to the locale.
Properties
A CardParams representing the card details and postal code if all fields are valid; otherwise null
. If a field is invalid focus will shift to the invalid field.
The Stripe account ID (if any) which is the business of record. See use cases to determine if this option is relevant for your integration. This should match the on_behalf_of provided on the Intent used when confirming payment.
A PaymentMethodCreateParams.Card representing the card details if all fields are valid; otherwise null
. If a field is invalid focus will shift to the invalid field.
A PaymentMethodCreateParams representing the card details and postal code if all fields are valid; otherwise null
. If a field is invalid focus will shift to the invalid field
The postal code field is enabled by default. Disabling the postal code field may impact auth success rates, so it is discouraged to disable it unless you are collecting the postal code outside of this form. If the postal code is disabled it will not be shown in the view.
If postalCodeEnabled is true and postalCodeRequired is true, then postal code is a required field.
If postalCodeEnabled is true and usZipCodeRequired is true, then postal code is a required field and must be a 5-digit US zip code.
Functions
Override of View.isEnabled that returns true
only if all three sub-controls are enabled.
Set a CardInputListener to be notified of card input events.
Set the card number. Method does not change text field focus.
Set a TextWatcher
to receive card number changes.
Set the CVC value for the card. Note that the maximum length is assumed to be 3, unless the brand of the card has already been set (by setting the card number).
Set an optional CVC field label to override defaults, or null
to use defaults.
Set a TextWatcher
to receive CVC value changes.
Enable or disable text fields
Set the expiration date. Method invokes completion listener and changes focus to the CVC field if a valid date is entered.
Set a TextWatcher
to receive expiration date changes.
Set a TextWatcher
to receive postal code changes.
A list of preferred networks that should be used to process payments made with a co-branded card if your user hasn't selected a network themselves.