Optional
onCallback function for each card number change.
Emits when:
Payload shape depends on whether saved payment methods support is enabled (i.e. paymentMethods
is provided):
paymentMethods
): { token: string | null }
— if token
is null
, the card number is invalid.
Note: The token
-only payload is deprecated and will be removed in a future version. Pass
paymentMethods
so you can rely on CardNumberInfo and use
CardFormEmbedState.cardNumberInfo / CardFormEmbedState.paymentMethodData instead.CardNumberInfo
— describes either a stored card selection (type: 'STORED_PAYMENT_METHOD'
) or a new card (type: 'ENCRYPTED_CARD_NUMBER'
).Make sure to always use the latest value (token/id) and discard any older ones.
Optional
onCallback function for each form state change.
Emits when:
Note: token is deprecated and will be removed in a future release. Prefer using CardFormEmbedState.cardNumberInfo for client-side branching and CardFormEmbedState.paymentMethodData as the value you send to your backend.
Optional
onCallback function for when the user submits a valid form,
most of the time using the ↩ Enter
key. Optional, improves UX.
Optional
optionalControls the visibility of various form elements.
true
(default): uses each element's default visibility (most are shown; cedulaField
is hidden unless explicitly enabled).false
: all optional elements are hidden.Optional
cardDisplays a group of card network logos at the bottom of the form.
Optional
cedulaNote: This field is hidden by default. Set to true
to explicitly show it.
Optional
dccDisplays some info about dynamic currency conversion at the bottom of the form.
Optional
emailDisplays an additional text field for the user to enter their email address.
Do not disable this unless you already provide the user's email address through another method, such as when setting up a new transaction on your backend.
Optional
firstOptional
lastOptional
storeDisplays a checkbox allowing the user to save the card for future payments.
Optional
submitDisplays a loading indicator over the form, after triggering the CardFormEmbed.pay method.
Optional
transactionDisplays the transaction terms and conditions for the user to accept.
Do not disable this unless you are already displaying it somewhere else.
Optional
paymentInitial list of saved payment methods used to populate the card form on mount. PaymentMethods
{
"paymentMethods": [
{
"type": "CARD",
"storedPaymentMethodData": [
{
"type": "CARD",
"id": "693f3244-9919-49ba-91c8-b095a5cf2ffb",
"maskedCardNumber": "************9507",
"expirationDate": "12/26",
"cvcRequiredForPayment": false,
"cardBrand": "MASTERCARD",
"paymentMethodDataOwner": { "name": "Jan Kowal" }
}
]
}
]
}
Specifies a container for the form.
Options for embedCardForm and CardFormEmbed.