stripe-android icon indicating copy to clipboard operation
stripe-android copied to clipboard

Calling "paymentLauncher.confirm(confirmParams)" 3 to 4 times making my whole app jerky and sluggish

Open stahanaqvi opened this issue 2 years ago • 3 comments

Summary

I'm making payment using stripe's payment launcher and if I comment this line "paymentLauncher.confirm(confirmParams)" my app has started behaving perfectly fine but If I uncomment this line and make a payment 3 to 4 times my app has started behaving jerky while scrolling anywhere in the app.

Code to reproduce

paymentLauncher = PaymentLauncher.Companion.create( context, paymentConfiguration.publishableKey, paymentConfiguration.stripeAccountId, ::onPaymentResult )

private fun confirmPayment(clientSecret: String, stripePaymentMethodId: String) { val confirmParams = ConfirmPaymentIntentParams .createWithPaymentMethodId(stripePaymentMethodId, clientSecret) mClientSecret = clientSecret context.lifecycleScope.launch { paymentLauncher.confirm(confirmParams) } }

private fun onPaymentResult(paymentResult: PaymentResult) { when (paymentResult) { is PaymentResult.Completed -> { paymentProcessed(true, context.getString(R.string.SdqLblPaymentCompleted), flag, false) } is PaymentResult.Canceled -> { paymentProcessed(false, context.getString(R.string.SdqLblPaymentCancelled), null, false) } is PaymentResult.Failed -> { paymentProcessed(false, context.getString(R.string.SdqLblPaymentFailed), null, false) } } }

Android version

All Android versions having this problem

Impacted devices

All devices are being impacted by this issue

Installation method

I'm using your SDK using gradle

Dependency Versions

Previously, the Stripe SDK version was 20.17.0 but to resolve this issue I've upgraded the version to 20.32.0 and still this issue is occurring.

stahanaqvi avatar Sep 28 '23 10:09 stahanaqvi

We do this same thing in our example app. https://github.com/stripe/stripe-android/blob/5786a4010995a8117e2abae77ac7cb81354bb09d/example/src/main/java/com/stripe/example/activity/StripeIntentActivity.kt#L39

I gave it a go, and I didn't notice any jank, or sluggishness in our example app. Do you have a way to recreate this? Does it also happen for you in our example app?

jaynewstrom-stripe avatar Sep 28 '23 15:09 jaynewstrom-stripe

No, it's not happening in your example app but can be reproduced on my app. I can also share a video if you say

stahanaqvi avatar Oct 04 '23 09:10 stahanaqvi

Could you modify our example app to recreate it? Or create a minimally reproducible sample? I'm also willing to dive into why if you notice what's different about or example vs your app.

jaynewstrom-stripe avatar Oct 04 '23 13:10 jaynewstrom-stripe

@stahanaqvi we haven't heard from you in a bit, so we're going to close this issue. Please reopen if needed!

jaynewstrom-stripe avatar Jun 17 '24 18:06 jaynewstrom-stripe