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

collectBankAccount returns PlatformException #1467

Open
chilimsv opened this issue Nov 1, 2023 · 3 comments · May be fixed by #1507
Open

collectBankAccount returns PlatformException #1467

chilimsv opened this issue Nov 1, 2023 · 3 comments · May be fixed by #1507
Labels
needs triage Needs triage

Comments

@chilimsv
Copy link

chilimsv commented Nov 1, 2023

Describe the bug
Calling collectBankAccount on both iOS and Android returns PlatformException(Invalid Params, , , null)

To Reproduce
Call this function

 const billingDetails = BillingDetails(
        name: 'Flutter Stipe',
        email: 'email@stripe.com',
        phone: '+48888000888',
        address: Address(
          city: 'Houston',
          country: 'US',
          line1: '1459  Circle Drive',
          line2: 'S',
          state: 'Texas',
          postalCode: '77063',
        ),
      );
      await Stripe.instance.collectBankAccount(
        isPaymentIntent: true,
        clientSecret: paymentInfo.clientSecret,
        params: const CollectBankAccountParams(
          paymentMethodType: PaymentMethodType.USBankAccount,
          billingDetails: billingDetails,
        ),
      );

This is returned:

[   +1 ms] flutter: PlatformException(Invalid Params, , , null)
[        ] flutter: 
           #0      JSONMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:171:7)
           #1      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:310:18)
           <asynchronous suspension>
           #2      MethodChannel.invokeMapMethod (package:flutter/src/services/platform_channel.dart:510:43)
           <asynchronous suspension>
           #3      MethodChannelStripe.collectBankAccount (package:stripe_platform_interface/src/method_channel_stripe.dart:429:20)
           <asynchronous suspension>
           #4      Stripe.collectBankAccount (package:flutter_stripe/src/stripe.dart:583:12)
           <asynchronous suspension>

Expected behavior
I expect a modal to show up to collect bank details after calling this method with required parameters

Package version: flutter_stripe: 9.5.0+1
Flutter version: stable, 3.13.0

Additional context
Is this the wrong usage or a bug? Every parameter is filled

@chilimsv chilimsv added the needs triage Needs triage label Nov 1, 2023
@xkxeeshankhan
Copy link

xkxeeshankhan commented Nov 16, 2023

Hey @chilimsv any update on the above issue?

@chilimsv
Copy link
Author

Hey @chilimsv any update on the above issue?

No luck. Decided to collect the bank details on our client side as a workaround

@lukatommy
Copy link

Hey, any update on this? collectBankAccount still doesn't work.

I've found 2 problems:

  1. Flutter plugin send
    'isPaymentIntent':isPaymentIntent and ios side use wrong key
    let isPaymentIntent = arguments["intentType"] as? Bool,

  2. Flutter plugin send as params CollectBankAccountParams parsed to json and both ios and android side try to extract this by paymentMethodData which is not in that model.

What with this draft PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage Needs triage
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants