The state object represents the internal state of the fields. The current state is included on every change event .
You can also always call the getState()
method to retrieve the current state of the fields.
const currentState = window . confidoHostedFields . getState ();
Props
The current active form. This can be either card
or ach
. The active form
determines which fields are loaded.
Information about the card number that was entered. This is only populated
when the activeForm
is card
and the card number field has been filled. The first six digits of the card number that was entered.
The type of card that was entered. This can be either credit
or debit
.
The card brand that was entered, such as visa
, mastercard
, etc.
The processing environment. This can be either sandbox
or production
.
The state of the hosted fields. The state of the card number field. The ID of the container element where the card number field is rendered.
`true` if the field is still loading.
This will be set when the field has a validation error.
The state of the card expiration date field. The ID of the container element where the card number field is rendered.
`true` if the field is still loading.
This will be set when the field has a validation error.
The state of the card security code field. The ID of the container element where the card number field is rendered.
`true` if the field is still loading.
This will be set when the field has a validation error.
The state of the account number field. The ID of the container element where the card number field is rendered.
`true` if the field is still loading.
This will be set when the field has a validation error.
The state of the routing number field. The ID of the container element where the card number field is rendered.
`true` if the field is still loading.
This will be set when the field has a validation error.
The state of the account holder name field. The ID of the container element where the card number field is rendered.
`true` if the field is still loading.
This will be set when the field has a validation error.
true
when the sdk is still initializing.
true
after sdk.submitFields()
is called and before the fields are done
submitting their data.
The payment link object, if applicable. The unique identifier for the payment link.
The amounts associated with the payment link. The category of the bank account, e.g., trust
, operating
.
The maximum ACH payment amount in cents. You should use this to show a
warning if your amount is over this limit.
This indicates the payment method for the transaction. When activeForm
is
ach
, this will be ACH
. When activeForm
is card
, this will be either
CREDIT
or DEBIT
depending on the card type. Possible values are: ACH
|
CREDIT
| DEBIT
The type of session. Possible values are: payment
| save_payment_method
Surcharging information. This is only applicable when the activeForm
is
card
. It provides details about whether surcharging is active, the rate, and
whether it will be applied. Whether surcharging is active.
Whether the surcharge rate will be applied or not. If surcharging is
enabled by the firm, this will show as true
when the cardNumber
field
has been filled out and the bin_loaded
event has been produced by the
form.
The surcharge rate that will be multiplied by the amount and added to the
payment.
Set when there is an initialization error. The error message describing the initialization error.