[Feature] Add an `ActivityResultContract` for `handleNextActionForPayment()` functions
Is your feature request related to a problem? Please describe.
There's currently no easy way to use handleNextActionForPayment() (or any other handleNextAction functions) in a compose screen. It would be great to have an ActivityResultContract which would start an activity and make the call to handleNextAction transparent. (similarly to GooglePayPaymentMethodLauncherContract).
Describe the solution you'd like
A HandleNextActionContract which starts a transparent activity and makes the calls to the appropriate handleNextAction function.
@romainpiel Thanks for the request, our team will take a look.
Hi @romainpiel 👋 I just came across this issue again. On the off-chance that this is still relevant, is PaymentLauncher a possible alternative to you?
It offers a handleNextActionForPaymentIntent(clientSecret) method and can easily be used in Compose:
fun MyComposeScreen() {
val paymentLauncher = PaymentLauncher.rememberLauncher(publishableKey, stripeAccountId, callback)
// …
Button(onClick = { paymentLauncher.handleNextActionForPaymentIntent(clientSecret) }) {
// …
}
}
Closing due to inactivity.