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
// pod 'hyperswitch-sdk-ios'
paymentSession = PaymentSession(publishableKey: publishableKey)2. Create a Payment Intent
3. Initialize your Payment Session
paymentSession?.initPaymentSession(paymentIntentClientSecret: paymentIntentClientSecret)options (Required)
Description
4. Craft a customized payments experience
private var handler: PaymentSessionHandler?
func initSavedPaymentMethodSessionCallback(handler: PaymentSessionHandler)-> Void {
self.handler = handler
}
@objc func launchHeadless(_ sender: Any) {
paymentSession!.getCustomerSavedPaymentMethods(initSavedPaymentMethodSessionCallback)
}
@objc func confirmPayment(_ sender: Any) {
let paymentMethod = self.handler!.getCustomerLastUsedSavedPaymentMethodData(callback)
}
@objc func confirmPayment(_ sender: Any) {
self.handler!.confirmWithLastUsedSavedPaymentMethodData(callback)
}options (Required)
Description
Last updated
Was this helpful?

