Show Primer's Drop-In Checkout.

The simplest way to integrate with Primer. With just a few lines of code, you can display a fully in-context checkout UI with all your payment methods.

Note that there are more options which you can set by passing your SDK settings in the configure function.

1
fun showUniversalCheckout(context: Context, clientToken: String)
kotlin
copy

Parameters

contextContextRequired

Android Context of your Activity or Fragment.

clientTokenstringRequired

A client token as returned by the create client session call.

Example

Availing Universal Checkout is as easy as implementing one line of code:

123456789
class CheckoutActivity : AppCompatActivity() {     // ...     private fun showUniversalCheckout(clientToken: String) {        // 👇 Add this        Primer.instance.showUniversalCheckout(context, clientToken)    }}
kotlin
copy