DropIn

object DropIn

Drop-in is our pre-built checkout UI for accepting payments. You only need to integrate through your backend with the /sessions API endpoint and provide some configuration data. Drop-in will handle the rest of the checkout flow.

Alternatively you can opt for a more advanced implementation with the 3 main API endpoints: /paymentMethods, /payments and /payments/details.

To start the checkout flow, register you activity or fragment using registerForDropInResult to receive the result of Drop-in. Then call one of the startPayment methods.

Functions

Link copied to clipboard

Register your Activity or Fragment with the Activity Result API and receive the final Drop-in result using the DropInCallback.

Register your Activity or Fragment with the Activity Result API and receive the final Drop-in result using the SessionDropInCallback.

Link copied to clipboard
fun startPayment(context: Context, dropInLauncher: ActivityResultLauncher<DropInResultContractParams>, paymentMethodsApiResponse: PaymentMethodsApiResponse, checkoutConfiguration: CheckoutConfiguration, serviceClass: Class<out DropInService>)
fun startPayment(context: Context, 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.

fun startPayment(context: Context, dropInLauncher: ActivityResultLauncher<SessionDropInResultContractParams>, checkoutSession: CheckoutSession, checkoutConfiguration: CheckoutConfiguration = checkoutSession.getConfiguration(), serviceClass: Class<out SessionDropInService> = SessionDropInService::class.java)
fun startPayment(context: Context, 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.