Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Activity doesn't exist yet. You can safely retry this method. #771

Closed
ShwetaChauhan18 opened this issue Jun 7, 2022 · 24 comments
Closed
Assignees
Labels
Android Issue related to Android native bindings bug Something isn't working

Comments

@ShwetaChauhan18
Copy link

Describe the bug
After updating version "3.1.0", getting below error.

Error: StripeException(error: LocalizedErrorMessage(code: FailureCode.Failed, localizedMessage: null, message: Activity doesn't exist yet. You can safely retry this method., stripeErrorCode: null, declineCode: null, type: null))

To Reproduce
Steps to reproduce the behavior:

  1. Update stripe version
  2. Create payment method
  3. On confirm payment
  4. Getting error: Error: StripeException(error: LocalizedErrorMessage(code: FailureCode.Failed, localizedMessage: null, message: Activity doesn't exist yet. You can safely retry this method., stripeErrorCode: null, declineCode: null, type: null))

Expected behavior
It should works as it's work previously.

Smartphone / tablet

  • Device: [Android emulator]
  • OS: [Android 10]
  • Package version: [3.1.0]
  • Flutter version [3.0.0.]
@ShwetaChauhan18 ShwetaChauhan18 added the needs triage Needs triage label Jun 7, 2022
@ShwetaChauhan18 ShwetaChauhan18 changed the title Activity doesn't exist yet. You can safely retry this method after flutter version update Activity doesn't exist yet. You can safely retry this method. Jun 7, 2022
@ShwetaChauhan18
Copy link
Author

ShwetaChauhan18 commented Jun 7, 2022

I think this error is only in Android. Anything which I need to add for android??

I already extend this activity: FlutterFragmentActivity

This method is called in stripe I think: createMissingActivityError()

@loicgeek
Copy link

loicgeek commented Jun 7, 2022

I am also having this issue:

 flutter_stripe: ^3.1.0
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.0.1, on macOS 12.1 21C52 darwin-x64, locale en-GB)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0-rc4)
[✓] Xcode - develop for iOS and macOS (Xcode 13.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.2)
[✓] VS Code (version 1.67.2)
[✓] Connected device (2 available)
[✓] HTTP Host Availability

• No issues found!

@jonasbark
Copy link
Member

Does is still work for you on Version 3.0?
Please provide a reproducible example app or code

@juleshyacinthe
Copy link

Hi, I'm also encountering this issue.
It happens when confirming a setup intent's secret using Stripe.instance.confirmSetupIntent after creating a setup intent using CardField and Stripe.instance.createPaymentMethod, and sending the payment method details to my server.

I believe the issue is linked with the 0.12.0 version of the stripe react native sdk. They merged this pull request which fixed this issue related to activity creation during 3DS2 checks.

The workaround for version 3.0 was to tweak the MainActivity.kt file of our app but it looks like this causes some issues to some users as well.

I'll try to provide a minimum reproducible code example.

@ShwetaChauhan18
Copy link
Author

ShwetaChauhan18 commented Jun 8, 2022

I have same case which @juleshyacinthe describe.

It's happens when we confirm payment using intent's secret and for this I am using CardField and Stripe.instance.createPaymentMethod, and sending the payment method details to my server.

Yes, it's working in old version. Yesterday I already checked and it's working. After updating version I am getting this error in Android only.

@kekko7072
Copy link

kekko7072 commented Jun 8, 2022

I'am also facing this issue only in Android after upgrading from 3.0.2 to 3.1.0. I downgraded the package to the previous version and run flutter clean and rebuild the app but still not wokring despite the fact that before upgrading the package it was working with 3.0.2.

@ShwetaChauhan18
Copy link
Author

Any solution??

@n3rdkid
Copy link

n3rdkid commented Jun 9, 2022

Facing the same issue while using handleNextAction for 3d Secure.

@benfgit
Copy link

benfgit commented Jun 9, 2022

Having the same issue on confirmSetupIntent.

@accek-cosmose
Copy link

It looks like in quite a few places stripe-react-native casts context.currentActivity to AppCompatActivity to access the fragment manager. It looks like with the newest Flutter, its FlutterFragmentActivity is not a subclass of AppCompatActivity and these casts probably should be changed to FragmentActivity.

@loicgeek
Copy link

loicgeek commented Jun 9, 2022

this code produce that error:

 const billingDetails = BillingDetails(
                    email: 'ngounoubosseloic@gmail.com',
                    phone: '+48888000888',
                    address: Address(
                      city: 'Houston',
                      country: 'US',
                      line1: '1459  Circle Drive',
                      line2: '',
                      state: 'Texas',
                      postalCode: '77063',
                    ),
                  );

                  var subscriptionsRepository =
                      locator.get<SubscriptionsRepository>();

                  String clientSecret =
                      await subscriptionsRepository.getUserClientSecret();

                  var setupIntent = await Stripe.instance.confirmSetupIntent(
                    clientSecret,
                    const PaymentMethodParams.card(
                      paymentMethodData: PaymentMethodData(
                        billingDetails: billingDetails,
                      ),
                    ),
                  );

                  // create payment method
                  final paymentMethod = setupIntent.paymentMethodId;

@SlickSlime
Copy link

@kekko7072 downgrading to 3.0.0 worked for me. I also had to explicitly set stripe_android and other stripe packages in pubspec.lock to 3.0.0 too.

@kekko7072
Copy link

kekko7072 commented Jun 10, 2022

@kekko7072 downgrading to 3.0.0 worked for me. I also had to explicitly set stripe_android and other stripe packages in pubspec.lock to 3.0.0 too.

I was trying to downgrade oy on pubspec.yaml file and it was not working then I went back to the previous git commit and I saw that I need to change the Android as you mentioned, but I'm particular were I need to change the stripe_android and to witch version?

@remonh87 remonh87 added bug Something isn't working Android Issue related to Android native bindings and removed needs triage Needs triage labels Jun 10, 2022
@ShwetaChauhan18
Copy link
Author

I still not able to complete payment after downgrading version to 3.0.0.

Getting below error:

../../flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_stripe-3.0.0/lib/src/stripe.dart:276:27: Error: The method 'handleCardAction' isn't defined for the class 'StripePlatform'.
 - 'StripePlatform' is from 'package:stripe_platform_interface/src/stripe_platform_interface.dart' ('../../flutter/flutter/.pub-cache/hosted/pub.dartlang.org/stripe_platform_interface-3.1.0/lib/src/stripe_platform_interface.dart').
Try correcting the name to the name of an existing method, or defining a method named 'handleCardAction'.
          await _platform.handleCardAction(paymentIntentClientSecret);

@jonasbark
Copy link
Member

Fixed with stripe_android 3.1.1

@jjsebastianfuertes
Copy link

jjsebastianfuertes commented Jun 13, 2022

@jonasbark Any idea when 3.1.1 will be ready to consume?

@jonasbark
Copy link
Member

it is ready. You just need to update stripe_android to it.
flutter packages pub update stripe_android

@innoananga
Copy link

innoananga commented Jun 16, 2022

confirmSetupIntent stripe error when u used test card once for payment.
steps: Add test card (4242 4242 4242 4242). Pay with this test card. Delete added card. Try to add new test card (4242 4242 4242 4242). confirmSetupIntent caught the error.
Error code: "There was an unexpected error -- try again in few seconds, message: No such setupintent: *client secret.

@accek-cosmose
Copy link

it is ready. You just need to update stripe_android to it. flutter packages pub update stripe_android

3.1.1 does not seem to be published yet, we don't see it in pub.dev, and flutter pub get doesn't see it either:

❯ flutter pub get
Because example depends on flutter_stripe ^3.1.1 which doesn't match any versions, version solving failed.

Any idea, when it would be available?

@jonasbark
Copy link
Member

only stripe_android was updated - flutter_stripe remains on 3.1.0.

@loicgeek
Copy link

@accek-cosmose use dependecies overrides for stripe_android only

@Profhameed
Copy link

Profhameed commented Jun 26, 2022

handleNextAction returns "StripeException(error: LocalizedErrorMessage(code: FailureCode.Canceled, localizedMessage: null, message: null, stripeErrorCode: null, declineCode: null, type: null))" with 3DS2, in spite of upgrading the android_stipe to 3.1.1

@askankit
Copy link

I am using pay plugin and stripe together and this is i am getting when i tried to call
await Stripe.instance.createApplePayToken(paymentResult);

StripeException(error: LocalizedErrorMessage(code: FailureCode.Failed, localizedMessage: There was an unexpected error -- try again in a few seconds, message: There was an unexpected error -- try again in a few seconds, stripeErrorCode: null, declineCode: null, type: null))

@hateshkumar
Copy link

I am using pay plugin and stripe together and this is i am getting when i tried to call await Stripe.instance.createApplePayToken(paymentResult);

StripeException(error: LocalizedErrorMessage(code: FailureCode.Failed, localizedMessage: There was an unexpected error -- try again in a few seconds, message: There was an unexpected error -- try again in a few seconds, stripeErrorCode: null, declineCode: null, type: null))

same issues I am facing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Android Issue related to Android native bindings bug Something isn't working
Projects
None yet
Development

No branches or pull requests

16 participants