jonasbark / flutter_stripe_payment

[DISCONTINUED] A flutter plugin with stripe payment plugin integration
MIT License
307 stars 243 forks source link

Bug - not able to unset Stripe account #331

Open vytautas-pranskunas- opened 2 years ago

vytautas-pranskunas- commented 2 years ago

hi @jonasbark Is there a way how to unset Stripe account? Because now - once 3ds is triggered I am setting Stripe account. But after i need to unset it because otherways all other actions, like payment methods creation, will be made in that account...

I see in this post guy is doing this is setting it null to fight not corrrect authentication before each payment method creation. But in null safety version param is not nullable :( https://medium.com/flutter-community/build-a-marketplace-in-your-flutter-app-and-accept-payments-using-stripe-and-firebase-72f3f7228625

I really need a way to reset that header otherways all integration just not correct. Can you help? If needd I can help. This is ONLY bug left which blocks us from going LIVE

Also i see it is easy fix I can even do PR because i see you are doing all it needs

 @ReactMethod
  public void setStripeAccount(final String stripeAccount) {
    ArgCheck.notEmptyString(mPublicKey);
    mStripeAccountId = stripeAccount;
    if (stripeAccount == null) {
      mStripe = new Stripe(getReactApplicationContext(), mPublicKey);
    } else {
      mStripe = new Stripe(getReactApplicationContext(), mPublicKey, stripeAccount);
    }
  }

the only bad stuff is this:

  static void setStripeAccount(String stripeAccount) {
    _channel.invokeMethod('setStripeAccount', {"stripeAccount": stripeAccount});
  }

String is not nullable :(

vytautas-pranskunas- commented 2 years ago

Here you go: https://github.com/jonasbark/flutter_stripe_payment/pull/332 Can you merge it please?

vytautas-pranskunas- commented 2 years ago

@jonasbark would you be able to merge this small PR please?