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

Error when using `authenticatePayment` and 3dsecure on Android #140

Closed squarfed closed 2 years ago

squarfed commented 3 years ago

I am trying to validate a payment with 3dsecure. I pay with a stripe test credit card number: 4000000000003063. The backend returns me a request to authenticate and a pi secret "pi_........" which I pass to authenticatePayment:

final result = await Stripe.instance.authenticatePayment(pi);

This should open a webview with the authentication method I suppose? But instead the app crashes

E/flutter ( 7817): [ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: NoSuchMethodError: The method '[]' was called on null.
E/flutter ( 7817): Receiver: null
E/flutter ( 7817): Tried calling: []("url")
E/flutter ( 7817): #0      Object.noSuchMethod (dart:core-patch/object_patch.dart:54:5)
E/flutter ( 7817): #1      Stripe._authenticateIntent
package:stripe_sdk/src/stripe.dart:176
E/flutter ( 7817): #2      Stripe.authenticatePaymentWithNextAction
package:stripe_sdk/src/stripe.dart:156
E/flutter ( 7817): #3      Stripe.authenticatePayment
package:stripe_sdk/src/stripe.dart:148
E/flutter ( 7817): <asynchronous suspension>
E/flutter ( 7817): #4      _ReviewOrderState.build.<anonymous closure>.<anonymous closure>.authorizePayment
package:tresarti/routes/review_order.dart:99
E/flutter ( 7817): <asynchronous suspension>
E/flutter ( 7817): #5      _ReviewOrderState.build.<anonymous closure>.<anonymous closure>.<anonymous closure>
package:tresarti/routes/review_order.dart:258
E/flutter ( 7817): <asynchronous suspension>
E/flutter ( 7817):

I am not sure if this is a bug or if I am doing something wrong.

squarfed commented 3 years ago

In found out that this is a duplicate of https://github.com/ezet/stripe-sdk/issues/42 however I would like to point out that not supporting "use_stripe_sdk" is very limiting for users. I have to interface with Magento and I cannot use this library, precisely because of this issue.

ezet commented 2 years ago

use_stripe_sdk refers to Stripes own SDKs, and requires them to work. I'm not sure it's possible to support it, and it's certainly not a priority.