Show single paymentMethod in either Primer’s Checkout or Vault session.
Note that there are more options which you can set by passing your SDK settings in
the configure function.
fun showPaymentMethod(
context: Context,
clientToken: String,
paymentMethod: String,
intent: PrimerSessionIntent,
)
Parameters
Android Context of
your Activity
or Fragment
.
A paymentMethod to be shown.
intent
PrimerSessionIntent
required
Set the preferred session intent when showing paymentMethodType.
Example
Show a specific payment method using the following code:
class CheckoutActivity : AppCompatActivity() {
// ...
private fun showPaymentMethod(
clientToken: String,
paymentMethodType: String,
sessionIntent: PrimerSessionIntent
) {
// 👇 Add this
Primer.instance.showPaymentMethod(context, clientToken, paymentMethodType, sessionIntent)
}
}