Overview
Set the PrimerHeadlessUniversalCheckoutRawDataManagerListener
in order to receive different
callbacks from Primer SDK.
onValidationChanged
fun onValidationChanged (isValid: Boolean , errors: List < PrimerInputValidationError >)
Returns whether the rawData
set by setRawData is valid, and all
the errors that occurred during validation.
Parameters
Returns true
in case raw data is valid, otherwise false
.
errors
List<PrimerInputValidationError>
required
Returns all of the validation errors for a raw data.
Show PrimerInputValidationError
A unique error identifier.
inputElementType
PrimerInputElementType
required
A input element associated with the error returned.
A unique diagnostics id for the given error.
Returns metadata for the current data set by using the setRawData .
This synchronous callback provides immediate metadata updates based on internal SDK calculations.
Check the section below for the metadata types that can be returned.
fun onMetadataChanged (metadata: PrimerPaymentMethodMetadata )
Parameters
metadata
PrimerPaymentMethodMetadata
Returns metadata state for the current data set by using
the setRawData .
In contrast to onMetadataChanged
, this callback involves internal asynchronous operations,
offering a broader and more accurate dataset that can be fetched remotely.
Its dynamic nature enables you to access the current state of SDK operations,
providing an opportunity to tailor the UI accordingly.
Check the section below for the metadata state types that can be returned.
fun onMetadataStateChanged (metadataState: PrimerPaymentMethodMetadataState )
Parameters
metadataState
PrimerPaymentMethodMetadataState
sealed class PrimerCardMetadataState
cardNumberEntryState
PrimerCardNumberEntryState
required
The state of card number entry triggered the metadata fetch.
cardNumberEntryState
PrimerCardNumberEntryState
required
The state of card number entry triggered the metadata fetch.
cardNumberEntryMetadata
PrimerCardNumberEntryMetadata
required
Represents metadata for PrimerCardNumberEntry, including selectable
(co-badged) and detected card networks.
selectableCardNetworks
PrimerCardNetworksMetadata?
Selectable card networks for a given card number, will be null in case
card network is not co-badged.
Represents a card network with metadata including display name, network type, and whether it is allowed.
The type of card network (e.g., VISA, MASTERCARD).
The human-readable name of the card network (e.g., Visa, Mastercard).
A boolean indicating whether this card network is allowed.
Represents a card network with metadata including display name, network type, and whether it is allowed.
The type of card network (e.g., VISA, MASTERCARD).
The human-readable name of the card network (e.g., Visa, Mastercard).
A boolean indicating whether this card network is allowed.
detectedCardNetworks
PrimerCardNetworksMetadata
required
All detected card networks for a given card number.
Represents a card network with metadata including display name, network type, and whether it is allowed.
The type of card network (e.g., VISA, MASTERCARD).
The human-readable name of the card network (e.g., Visa, Mastercard).
A boolean indicating whether this card network is allowed.
Represents a card network with metadata including display name, network type, and whether it is allowed.
The type of card network (e.g., VISA, MASTERCARD).
The human-readable name of the card network (e.g., Visa, Mastercard).
A boolean indicating whether this card network is allowed.
source
enum ValidationSource
required
Enum class representing the source of validation for card metadata.
The data comes from Primer API.
ValidationSource.LOCAL_FALLBACK
The data comes from the SDK if Primer’s server fails to be reached.
This works similarly to LOCAL.
The data comes from the SDK, usually by levering the first few digits.