This method allows you get a new instance of a PrimerHeadlessMainComponent implementation.

KOTLIN
@Throws(SdkUninitializedException::class, UnsupportedPaymentMethodException::class)
fun <T : PrimerHeadlessMainComponent<out PrimerCollectableData, out PrimerHeadlessStep>> provide(paymentMethodType: String): T

Parameters

Type parameters

Returns

An instance of the passed generic type T, which could be any of the following available components:

Throws

Example

KOTLIN
class CheckoutActivity : AppCompatActivity() {
  // 👇 Add this
  private val banksComponent by lazy {
	PrimerHeadlessUniversalCheckoutComponentWithRedirectManager(viewModelStoreOwner = this)
            .provide(paymentMethodType = "ADYEN_IDEAL")
  }
}