The State Object
Example
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.
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 processing environment. This can be either sandbox
or production
.
The state of the hosted fields.
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.
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.
Set when there is an initialization error.
Example