For additional information on available SDK parameters, please refer to the corresponding platform-specific section of our documentation.
Handle SDK callbacks
To get results from kevin. SDK payment initiation flow you need to override platform-specific callbacks.
Android
Android handler module should conform to ActivityEventListener and should override onActivityResult(activity: Activity?, requestCode: Int, resultCode: Int, data: Intent?)
KevinModule.kt
class KevinModule internal constructor(context: ReactApplicationContext?) :
ReactContextBaseJavaModule(context), ActivityEventListener {
//...
override fun onActivityResult(
activity: Activity?,
requestCode: Int,
resultCode: Int,
data: Intent?
) {
if (requestCode == REQUEST_CODE_PAYMENT) {
val result = data?.getParcelableExtra<SessionResult<PaymentSessionResult>>(PaymentSessionContract.RESULT_KEY)
when (result) {
is SessionResult.Success -> {
callback?.invoke(null, result.value.paymentId)
}
is SessionResult.Canceled -> {
callback?.invoke("Canceled", null)
}
is SessionResult.Failure -> {
callback?.invoke("Failed", null)
}
}
}
}
}
iOS
iOS handler module should conform to KevinPaymentSessionDelegate and override those methods: