ezet / stripe-sdk

A simple and flexible Stripe library for Flutter with complete support for SCA and PSD2.
https://pub.dev/packages/stripe_sdk
Other
137 stars 137 forks source link

Creating token for the bank account #107

Closed alexandersokol closed 2 years ago

alexandersokol commented 3 years ago

Hello!

I'm trying to create a token for the Bank account using stripe SDK with the following code:

` StripeApi.init('pk_test_my_token'); accountNumber = "000123456789"; // Test bank account routingNumber = "110000000";

final data = <String, dynamic>{}; data[_kCountry] = _kCountryUS; data[_kAccountNumber] = int.tryParse(accountNumber); data[_kRoutingNumber] = int.tryParse(routingNumber);

  final tokenResult = await StripeApi.instance.createToken(data);

` I'm getting an error: "You cannot use a live bank account number when making transfers or debits in test mode"

On the Stripe testing doc page, it is written to use test secret keys for test bank accounts. https://stripe.com/docs/connect/testing

https://stripe.com/docs/api/tokens/create_bank_account?lang=curl Could you please shed some light on where I can put my sktest* key to make test bank accounts work?

ezet commented 3 years ago

edit: ignore my previous response. I am using this in test mode and have not experienced any similar issues, so I don't know what I can do to help. Your approach seems correct wrt. the library