Headless SDK
Hyperswitch is designed to facilitate the integration and management of payment-related functionalities in a decoupled or headless architecture with flexibility to customize your checkout UI.
Customize the payment experience using Headless functions
1. Initialize the Hyperswitch SDK
// dependencies: implementation 'io.hyperswitch:hyperswitch-sdk-android:+' val
paymentSession = PaymentSession(applicationContext, "YOUR_PUBLISHABLE_KEY")2. Create a Payment Intent
3. Initialize your Payment Session
paymentSession.initPaymentSession(paymentIntentClientSecret)options (Required)
Description
4. Craft a customized payments experience
var handler: PaymentSessionHandler? = null
paymentSession.getCustomerSavedPaymentMethods { paymentSessionHandler ->
handler = paymentSessionHandler
}
val savedPaymentMethid = handler!!.getCustomerLastUsedSavedPaymentMethodData()
button.setOnClickListener {
handler!!.confirmWithCustomerLastUsedPaymentMethod { paymentResult ->
println(paymentResult)
}
}options (Required)
Description
Last updated
Was this helpful?

