PaymentCardDetailsForm

class PaymentCardDetailsForm @JvmOverloads constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : ConstraintLayout, CardValidCallback

Convenience multi-field form for collecting card details from a user. Card fields are separated into multiple input fields, and the control has a "card" style background.


Important:

User-entered card details are intentionally restricted for PCI compliance


Styling/Branding

This class can be styled by overriding the following color resource values:

olopay_paymentcarddetailsform_edittext_textcolor
olopay_paymentcarddetailsform_edittext_disabledtextcolor
olopay_paymentcarddetailsform_background
olopay_paymentcarddetailsform_disabledbackground
olopay_paymentcarddetailsform_errorcolor
olopay_paymentcarddetailsform_bordercolor

In addition, since this form uses an instance of [PaymentCardDetailsMultiLineView] under the hood, many of the fields can be styled by following style documentation for [PaymentCardDetailsMultiLineView].

Note that values specifically called out here will take precedence over similar values for customizing the same attributes on PaymentCardDetailsMultiLineView. For example, olopay_paymentcarddetailsmultilineview_edittext_textcolor won't have an effect on this form because of olopay_paymentcarddetailsform_edittext_textcolor

Constructors

PaymentCardDetailsForm
Link copied to clipboard
fun PaymentCardDetailsForm(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0)

Creates a new instance of PaymentCardDetailsForm

Properties

formValidCallback
Link copied to clipboard
var formValidCallback: FormValidCallback? = null

Callback to be notified when the card transitions to valid and invalid states

isValid
Link copied to clipboard
val isValid: Boolean

true if all fields are complete and valid, otherwise false

paymentMethodParams
Link copied to clipboard
val paymentMethodParams: IPaymentMethodParams?

Get an IPaymentMethodParams instance that can be used to create an IPaymentMethod instance. If the form is not valid this will return null.

Functions

isEnabled
Link copied to clipboard
open override fun isEnabled(): Boolean

True if the form is enabled and can accept user input, false otherwise

setEnabled
Link copied to clipboard
open override fun setEnabled(enabled: Boolean)

Enables or disables the control