startPayment

fun DropIn.startPayment(dropInLauncher: ActivityResultLauncher<SessionDropInResultContractParams>, checkoutSession: CheckoutSession, dropInConfiguration: DropInConfiguration, serviceClass: Class<out SessionDropInService> = SessionDropInService::class.java)

Starts the checkout flow to be handled by the Drop-in solution. With this solution your backend only needs to integrate the /sessions endpoint to start the checkout flow.

Call rememberLauncherForDropInResult to create a launcher and receive the final result of Drop-in.

Use dropInConfiguration to configure Drop-in and the components that will be loaded inside it.

Optionally, you can extend SessionDropInService with your own implementation and add it to your manifest file. This allows you to interact with Drop-in, and take over the checkout flow.

Parameters

dropInLauncher

A launcher to start Drop-in, obtained with registerForDropInResult.

checkoutSession

The result from the /sessions endpoint passed onto CheckoutSessionProvider.createSession to create this object.

dropInConfiguration

Additional required configuration data.

serviceClass

Service that extends from SessionDropInService to optionally take over the checkout flow.


fun DropIn.startPayment(dropInLauncher: ActivityResultLauncher<SessionDropInResultContractParams>, checkoutSession: CheckoutSession, checkoutConfiguration: CheckoutConfiguration = checkoutSession.getConfiguration(), serviceClass: Class<out SessionDropInService> = SessionDropInService::class.java)

Starts the checkout flow to be handled by the Drop-in solution. With this solution your backend only needs to integrate the /sessions endpoint to start the checkout flow.

Call rememberLauncherForDropInResult to create a launcher and receive the final result of Drop-in.

Use checkoutConfiguration to configure Drop-in and the components that will be loaded inside it.

Optionally, you can extend SessionDropInService with your own implementation and add it to your manifest file. This allows you to interact with Drop-in, and take over the checkout flow.

Parameters

dropInLauncher

A launcher to start Drop-in, obtained with registerForDropInResult.

checkoutSession

The result from the /sessions endpoint passed onto CheckoutSessionProvider.createSession to create this object.

checkoutConfiguration

Additional required configuration data.

serviceClass

Service that extends from SessionDropInService to optionally take over the checkout flow.


fun DropIn.startPayment(dropInLauncher: ActivityResultLauncher<DropInResultContractParams>, paymentMethodsApiResponse: PaymentMethodsApiResponse, dropInConfiguration: DropInConfiguration, serviceClass: Class<out DropInService>)

Starts the advanced checkout flow to be handled by the Drop-in solution. With this solution your backend needs to integrate the 3 main API endpoints: /paymentMethods, /payments and /payments/details.

Extend DropInService with your own implementation and add it to your manifest file. This class allows you to interact with Drop-in during the checkout flow.

Call rememberLauncherForDropInResult to create a launcher and receive the final result of Drop-in.

Use dropInConfiguration to configure Drop-in and the components that will be loaded inside it.

Parameters

dropInLauncher

A launcher to start Drop-in, obtained with registerForDropInResult.

paymentMethodsApiResponse

The result from the /paymentMethods endpoint.

dropInConfiguration

Additional required configuration data.

serviceClass

Service that extends from DropInService to interact with Drop-in during the checkout flow.


fun DropIn.startPayment(dropInLauncher: ActivityResultLauncher<DropInResultContractParams>, paymentMethodsApiResponse: PaymentMethodsApiResponse, checkoutConfiguration: CheckoutConfiguration, serviceClass: Class<out DropInService>)

Starts the advanced checkout flow to be handled by the Drop-in solution. With this solution your backend needs to integrate the 3 main API endpoints: /paymentMethods, /payments and /payments/details.

Extend DropInService with your own implementation and add it to your manifest file. This class allows you to interact with Drop-in during the checkout flow.

Call rememberLauncherForDropInResult to create a launcher and receive the final result of Drop-in.

Use checkoutConfiguration to configure Drop-in and the components that will be loaded inside it.

Parameters

dropInLauncher

A launcher to start Drop-in, obtained with registerForDropInResult.

paymentMethodsApiResponse

The result from the /paymentMethods endpoint.

checkoutConfiguration

Additional required configuration data.

serviceClass

Service that extends from DropInService to interact with Drop-in during the checkout flow.