Android SDK
- Installation
- Primer
- PrimerHeadlessUniversalCheckout
- Logging
- Common objects
This method allows you get a new instance of a PrimerHeadlessMainComponent
implementation.
@Throws(SdkUninitializedException::class, UnsupportedPaymentMethodException::class)
fun <T : PrimerHeadlessMainComponent<out PrimerCollectableData, out PrimerHeadlessStep>> provide(paymentMethodType: String): T
Parameters
Hide Parameters
Hide Parameters
A unique string identifier for the payment method. Supported payment methods for current client session are returned in onAvailablePaymentMethodsLoaded callback.
Type parameters
Hide Type parameters
Hide Type parameters
The type of the PrimerHeadlessMainComponent
implementation to
return.
Hide Supported types
Hide Supported types
Type | paymentMethodType |
---|---|
BanksComponent | ADYEN_IDEAL |
Returns
An instance of the passed generic type T
, which could be any of the following available components:
Hide Common API and available components
Hide Common API and available components
Show Common API
Show Common API
Initialize the component by calling the start function. This method should be called only once.
Call submit
function in order to process collected data and move component to next state.
Get a Flow of PrimerError objects that represent errors emitted by this component. Subscribers can observe and handle errors using this Flow.
Hide Supported types
Hide Supported types
Show API
Show API
Update component with collected data by passing implementations of sealed interface. This method can be called at any point, even if you have only partially collected data. To validate the partially collected data, you can refer to the componentValidationStatus and receive the validation status when it’s updated.
Show sealed interface BanksCollectableData
Show sealed interface BanksCollectableData
Data class representing representing the collected bank list filter.
Hide Properties
Hide Properties
A string representing the query by which the bank list should be filtered.
BanksStep
is a class holding different output data for specific steps. Whenever
start or submit methods are
called, componentStep
will trigger the next step in case the call to the mentioned method was successful.
Show sealed interface BanksStep
Show sealed interface BanksStep
Object signifing that the list of available banks is in the process of being loaded.
A data class representing the step of emitting the list of available banks.
Hide Properties
Hide Properties
The list of available banks.
The PrimerValidationStatus
interface encompasses a range of validation statuses.
Show sealed interface PrimerValidationStatus
Show sealed interface PrimerValidationStatus
Indicates that data is currently in the process of being validated.
Hide Properties
Hide Properties
The data being validated.
Indicates that the data has successfully been validated.
Hide Properties
Hide Properties
The successfully validated data.
Indicates that the data has been considered invalid after validation.
Hide Properties
Hide Properties
List of PrimerValidationError
objects that represent data validation errors emitted by this component.
The data that failed validation.
Represents the status when an error occurred during the validation process.
Hide Properties
Hide Properties
The specific PrimerError
that occurred during validation.
Show PrimerValidationError
Show PrimerValidationError
A unique error identifier.
A unique error code.
A error description.
A recovery suggestion for the given error. In case it’s present, use it to try to recover from error.
A unique diagnostics id for the given error.
The data for which the error occurred.
Throws
Hide Throws
Hide Throws
An exception that will be thrown in case the SDK was not initialized properly. Before calling any of the manager’s method, the SDK must be initialized using start method.
An exception that will be thrown in case the initialization of the manager has been done using unsupported paymentMethodType
- PrimerHeadlessMainComponent
combination.
Supported payment methods for current client session are returned
in onAvailablePaymentMethodsLoaded callback. See Supported types for the supported combinations.
Example
class CheckoutActivity : AppCompatActivity() {
// 👇 Add this
private val banksComponent by lazy {
PrimerHeadlessUniversalCheckoutComponentWithRedirectManager(viewModelStoreOwner = this)
.provide(paymentMethodType = "ADYEN_IDEAL")
}
}