Overview
Set the PrimerHeadlessUniversalCheckoutRawDataManagerDelegate
in order to receive different callbacks from your RawDataManager
.
primerRawDataManager(_:dataIsValid:)
Returns whether the rawData
set is valid, and all the errors that occurred during validation.
1
func primerRawDataManager(_ rawDataManager: PrimerHeadlessUniversalCheckout.RawDataManager, dataIsValid isValid: Bool, errors: [Error]?)
Parameters
primerRawDataManager(_:willFetchMetadataForState:)
Called when we begin to fetch metadata forthe current rawData
. Changing rawData
triggers this callback.
Some time after this is called, primerRawDataManager(_:didReceiveMetadata:forState:)
will be called with the relevant metadata for the state.
Use this method to indicate to the user that metadata is being fetched; for example, by showing a loading spinner or other UI until the metadata has been returned.
12
func primerRawDataManager(_ rawDataManager: PrimerHeadlessUniversalCheckout.RawDataManager, willFetchMetadataForState state: PrimerValidationState)
Parameters
An object containing the state that triggered the metadata fetch. For example, for
card number entry, this will be an instance of PrimerCardNumberEntryState
Implementations
Used when rawData
is set to PrimerCardData
Properties
The card number set on rawData
that triggered the metadata fetch
primerRawDataManager(_:didReceiveMetadata:forState:)
Called when new validation metadata relating to the current validation state is received. This will always be
called some time after primerRawDataManager(_:willFetchMetadataForState:)
is called.
Use this method to query new validation metadata, add informational UI, or allow the user to add additional payment information required to make a payment.
123
func primerRawDataManager(_ rawDataManager: PrimerHeadlessUniversalCheckout.RawDataManager, didReceiveMetadata metadata: PrimerPaymentMethodMetadata, forState state: PrimerValidationState)
Parameters
An object containing metadata for the relevant state
also returned with this method.
Implementations
Used when rawData
is set to PrimerCardData
Properties
The card number set on rawData
that triggered the metadata fetch
An object containing the state that triggered the metadata fetch. For example, for
card number entry, this will be an instance of PrimerCardNumberEntryState
Implementations
Properties
cases
Properties
An enum value for the card network (e.g. .visa
, .mastercard
)
An enum value for the card network (e.g. .visa
, .mastercard
)
Properties
An enum value for the card network (e.g. .visa
, .mastercard
)
An enum value for the card network (e.g. .visa
, .mastercard
)
primerRawDataManager(_:metadataDidChange:)
This method is deprecated. Please use primerRawDataManager(_:willFetchMetadataForState:)
and
primerRawDataManager(_:didReceiveMetadata:forState:)
.
Returns validation metadata for the current validation state, triggered by using rawData
. Check the section below for the metadata types that can be returned.
1
func primerRawDataManager(_ rawDataManager: PrimerHeadlessUniversalCheckout.RawDataManager, metadataDidChange metadata: [String: Any]?)