Code Monkey home page Code Monkey logo

flutter_stripe's People

Contributors

albertus-stripe avatar asaarnak avatar aya2453 avatar dagyu avatar davidmigloz avatar dependabot[bot] avatar fachrifaul avatar gamesquatch avatar iamsahilsonawane avatar ignatz avatar illia-romanenko avatar j-j-gajjar avatar jamesblasco avatar jonasbark avatar kuodster avatar maranix avatar nerder avatar petermx avatar pratikbutani avatar remonh87 avatar ryanjohndias avatar siherrmann avatar simonpham avatar smarpit-singh avatar spendres avatar taym95 avatar tbuczkowski avatar thorsten-stripe avatar vahellame avatar volkanakbayir avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

flutter_stripe's Issues

Set default keyboard type to TextInputType.number

The keyboard opened in CardField() is TextInputType.text

The problem it is creating on my phone is that you have to press the numbers button on the bottom left every time you press a number. So you have to press 2 buttons to input 1 digit

vid.mp4

Add dart code analysis

I have a good yaml that would be very useful for us to use. Will integrate it and fix some issues

Support custom fonts in CardField

Custom fonts are not working in CardField widget.

CardField(
  style: const TextStyle(
        fontFamily: 'my-custom-font', // <- not working
      ),
),

Fix `flutter analyze` lint issues on the repository

We currently have 815 issues by running flutter analyze on the repository.

To Reproduce
Steps to reproduce the behavior:

  1. Clone the repository
  2. Run flutter analyze

Expected behavior
We should not be having any lint issues and we should be catching this on a GitHub Action CI and prevent future pull request to be merged if it's violating any lint warnings.

How to create a payment method with custom card details

I'm looking for some assistance on creating a payment method with a custom card form. My current form retrieves the 16 digit card number, CVV and expiry.

How do I associate the card details obtained via a custom card form to create a payment method? Looking at:
Stripe.instance.createPaymentMethod() it accepts PaymentMethodParams, i've looked at PaymentMethodParams.card but this just accepts BillingDetails(), which contain address, email, name and phone, but not card information.

Alternatively, I tried to use the custom form provided CardField() but cannot type anything in to it (no software keyboard appears and the hardware keyboard is unresponsive).

Web Support

Is your feature request related to a problem? (please describe)

  • Since Flutter web is already in stable branch. It will be good to have web support for this plugin.

Describe alternatives you've considered

ApplePayButtonStyle, ApplePayButtonType are unrecognized at build time

Describe the bug
Library is unable to resolve ApplePayButtonStyle and ApplePayButtonType

To Reproduce
Steps to reproduce the behavior:

  1. Add the library to any project in pubspec.yaml
  2. Attempt to build the project
  3. Observe a failure with exceptions similar to
../flutter/.pub-cache/hosted/pub.dartlang.org/flutter_stripe-1.0.1/lib/src/widgets/apple_pay_button.dart:166:20: Error: 'ApplePayButtonStyle' isn't a type.
    int mapButtonStyle(ApplePayButtonStyle style) {

Expected behavior
Package does not fail to resolve ApplePayButtonStyle + ApplePayButtonType

Smartphone / tablet

  • Device: iPhone XS Max or iPhone 12 simulator
  • OS: iOS 14
  • Package version: 1.0.1
  • Flutter version 2.2.0

confirmPayment can't be false

Describe the bug
setting the confirmPayment parameter to false results in the Payment Sheet not appearing on the screen and no errors appearing in the console.

await Stripe.instance.presentPaymentSheet(
    parameters: PresentPaymentSheetParameters(
        clientSecret: _paymentSheetData['paymentIntentClientSecret'],
        confirmPayment: false,
    )
);

To Reproduce
Use the Payment Sheet method in the example app provided by the package and change the confirmPayment parameter to false

Expected behavior
The payment sheet should appear as usual in order to input the card details

Smartphone / tablet

  • Device: Pixel 4 XL
  • OS: Android 11
  • Package version: flutter_stripe: ^1.0.1+2
  • Flutter version: Flutter 2.0.6 • channel stable

Add scan option to CardField

I'd love the "scan" button to be available for the CardField so that the card details can be entered by scanning the card with the device camera.

Paymentsheet is always dark on Android

Describe the bug
No matter which value of style you add the payment sheet on Android is always dark. On iOS I can change the styling.

To Reproduce
Steps to reproduce the behavior:

  1. configure paymentsheet
 await Stripe.instance.initPaymentSheet(
      paymentSheetParameters: SetupPaymentSheetParameters(
        paymentIntentClientSecret: paymentIntentClientSecret,
        customerId: customerId,
        customerEphemeralKeySecret: customerEphemeralKeySecret,
        style: ThemeMode.light,
        applePay: false,
        googlePay: false,
        customFlow: false,
        testEnv: true,
      ),
    );

2.call presentPaymentSheet and notice it is always represented in dark theme.

Expected behavior
In my example it should display the payment sheet in light theme.

Smartphone / tablet

  • Pixel 4a android 11.

Additional context
My app theme is: Theme.AppCompat.Light.NoActionBar

Allow pre-defined data to be shown in CardField

Sorry If I missed it - but I can't see a way in the current version to pre-define some of the data shown in CardField.
I'd like to collect some or all of the card data from Card IO and pass it to the CardField.

Is there any way to make CardField displayed along the vertical axis?

Hi, Team,

Can you, please advise me how can i customize the CardField? Now it looks like it is aligned to horizontal

image

And - is it possible to expose the setters for the fields? So that, for example, there could be used custom solution like flutter_credit_card or whichever and be still compliant with the createPaymentMethod method.

Thank you so much in advance!

Add unittests

  • we need to have good coverage for our business logic classes

Add minimal example of taking a credit card payment payment.

I find it difficult to get started if you're not familiar with Stripe. How do you take a credit card payment?
I'd like a minimum example of taking a credit card payment in Flutter.

Describe the solution you'd like
Would be nice if there were a 1 file example of taking a payment in the docs or in the example on pub.dev.

Thanks!

Crash on nodejs server when saving card

When trying to save a card off-session the server crashes

Unknown error occurred TypeError: Cannot read property 'id' of undefined
    at /lutter_stripe/stripe/example/server/src/index.ts:361:46
    at step /flutter_stripe/stripe/example/server/src/index.ts:33:23)
    at Object.next (/flutter_stripe/stripe/example/server/src/index.ts:14:53)
    at fulfilled (/flutter_stripe/stripe/example/server/src/index.ts:5:58)
    at processTicksAndRejections (node:internal/process/task_queues:94:5)

Stripe.instance.confirmSetupIntent crashes iOS

Android works as intended but on iOS calling Stripe.instance.confirmSetupIntent causes this crash:

** Assertion failure in -[FlutterStandardReader readValueOfType:], FlutterStandardCodec.mm:469
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Corrupted standard message'
*** First throw call stack:
(0x1a17425b4 0x1b61c17a8 0x1a1644258 0x1a2a0b6e4 0x1035e61d0 0x1035e77e8 0x1035e464c 0x102d84038 0x10308341c 0x10302281c 0x103024ed4 0x1a16bd08c 0x1a16bcc88 0x1a16bc0d8 0x1a16b5e8c 0x1a16b51c0 0x1b8c9d734 0x1a41237e4 0x1a4129054 0x1009a7c24 0x1a1371cf8)
libc++abi: terminating with uncaught exception of type NSException

  • thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
    frame #0: 0x00000001cf73b334 libsystem_kernel.dylib__pthread_kill + 8 libsystem_kernel.dylib__pthread_kill:
    -> 0x1cf73b334 <+8>: b.lo 0x1cf73b354 ; <+40>
    0x1cf73b338 <+12>: pacibsp
    0x1cf73b33c <+16>: stp x29, x30, [sp, #-0x10]!
    0x1cf73b340 <+20>: mov x29, sp

PaymentSheet stuck on loading

Describe the bug
I tried payment_sheet_screen example but the sheet stuck on loading.
There aren't error on console (only 4 lines with HI text).
Additional console feedback would be helpful.

Smartphone

  • Pixel 2XL
  • Android 11

Thanks

// 2. initialize the payment sheet
      await f_stripe.Stripe.instance.initPaymentSheet(
        paymentSheetParameters: f_stripe.SetupPaymentSheetParameters(
          applePay: false,
          googlePay: false,
          style: ThemeMode.dark,
          testEnv: true,
          merchantCountryCode: 'IT',
          merchantDisplayName: 'Flutter Stripe Store Demo',
          customerId: _customer.stripeCustomerId,
          paymentIntentClientSecret: _paymentIntent.stripeClientSecret,
          customerEphemeralKeySecret: _ephemeralKey.secret,
        ),
      );

Move all packages under `packages` folder to follow popular Flutter project structure convention

I have a very nitpick suggestion on improving our current project folder structure. Since this project publishes multiple packages at the same time, what do you think about adopting the flutter/flutter folder structure and moving stripe, stripe_android, stripe_ios, and stripe_platform_interfaces inside the packages folder?

Some references on Flutter project repository following the same convention:

  1. Flutter SDK
  2. Flutter Plugins
  3. FlutterFire
  4. plus_plugins

(discussed with the maintainer offline and we agreed on doing this later to prevent conflicts on current branch)

Error compiling Android

Describe the bug
When I run flutter build api --debug I run this error of Kotlin

The class is loaded from /Users/francescovezzani/.gradle/caches/transforms-2/files-2.1/be57fcae178790f4fbec9bc4895ce743/jetified-stripe-android-16.8.2-api.jar!/com/stripe/android/model/PaymentMethod$BillingDetails.class
e: /Users/francescovezzani/.pub-cache/hosted/pub.dartlang.org/stripe_android-1.0.1+3/android/src/main/kotlin/com/reactnativestripesdk/PaymentMethodCreateParamsFactory.kt: (81, 12): Class 'com.stripe.android.model.ConfirmPaymentIntentParams.Companion' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.

FAILURE: Build failed with an exception.                                
                                                                        
* What went wrong:                                                      
Execution failed for task ':stripe_android:compileDebugKotlin'.         
> Compilation error. See log for more details  

I recently updated to Kotlin 1.5 is linked to that?

stripeSdk has not been initialized on Android

I followed the example in order to do payments with webook and I believe I have not missed anything.
When I call confirmPaymentMethod:

await Stripe.instance.confirmPaymentMethod(
    client_secret,
    PaymentMethodParams.card(),
);

I get this error:

Log error
E/MethodChannel#flutter.stripe/payments( 9694): kotlin.UninitializedPropertyAccessException: lateinit property stripeSdk has not been initialized
E/MethodChannel#flutter.stripe/payments( 9694):         at com.flutter.stripe.StripeAndroidPlugin.onMethodCall(StripeAndroidPlugin.kt:44)
E/MethodChannel#flutter.stripe/payments( 9694):         at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:233)
E/MethodChannel#flutter.stripe/payments( 9694):         at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85)
E/MethodChannel#flutter.stripe/payments( 9694):         at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:818)
E/MethodChannel#flutter.stripe/payments( 9694):         at android.os.MessageQueue.nativePollOnce(Native Method)
E/MethodChannel#flutter.stripe/payments( 9694):         at android.os.MessageQueue.next(MessageQueue.java:363)
E/MethodChannel#flutter.stripe/payments( 9694):         at android.os.Looper.loop(Looper.java:173)
E/MethodChannel#flutter.stripe/payments( 9694):         at android.app.ActivityThread.main(ActivityThread.java:8178)
E/MethodChannel#flutter.stripe/payments( 9694):         at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#flutter.stripe/payments( 9694):         at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
E/MethodChannel#flutter.stripe/payments( 9694):         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1101)
E/flutter ( 9694): [ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: PlatformException(error, lateinit property stripeSdk has not been initialized, null, kotlin.UninitializedPropertyAccessException: lateinit property stripeSdk has not been initialized
E/flutter ( 9694):      at com.flutter.stripe.StripeAndroidPlugin.onMethodCall(StripeAndroidPlugin.kt:44)
E/flutter ( 9694):      at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:233)
E/flutter ( 9694):      at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85)
E/flutter ( 9694):      at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:818)
E/flutter ( 9694):      at android.os.MessageQueue.nativePollOnce(Native Method)
E/flutter ( 9694):      at android.os.MessageQueue.next(MessageQueue.java:363)
E/flutter ( 9694):      at android.os.Looper.loop(Looper.java:173)
E/flutter ( 9694):      at android.app.ActivityThread.main(ActivityThread.java:8178)
E/flutter ( 9694):      at java.lang.reflect.Method.invoke(Native Method)
E/flutter ( 9694):      at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
E/flutter ( 9694):      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1101)
E/flutter ( 9694): )
E/flutter ( 9694): #0      JSONMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:164:7)
E/flutter ( 9694): #1      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:158:18)
E/flutter ( 9694): <asynchronous suspension>
E/flutter ( 9694): #2      MethodChannelStripe.initialise (package:stripe_platform_interface/src/method_channel_stripe.dart:36:5)
E/flutter ( 9694): <asynchronous suspension>
E/flutter ( 9694): #3      Stripe._initialise (package:flutter_stripe/src/stripe.dart:315:5)
E/flutter ( 9694): <asynchronous suspension>
E/flutter ( 9694): #4      Stripe.confirmPaymentMethod (package:flutter_stripe/src/stripe.dart:186:5)
E/flutter ( 9694): <asynchronous suspension>

The thing is that the example works, my app doesn't.
I've call also in my main.dart before runApp and public key already configured:

WidgetsFlutterBinding.ensureInitialized();
flutter doctor -v
[✓] Flutter (Channel stable, 2.2.0, on Linux, locale en_GB.UTF-8)
    • Flutter version 2.2.0 at /home/anmentone/lib/flutter
    • Framework revision b22742018b (10 days ago), 2021-05-14 19:12:57 -0700
    • Engine revision a9d88a4d18
    • Dart version 2.13.0

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /home/anmentone/Android/Sdk
    • Platform android-30, build-tools 30.0.3
    • Java binary at: /usr/local/android-studio/jre/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.8+0-b944-P17168821)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • Chrome at google-chrome

[✓] Android Studio (version 4.2)
    • Android Studio at /usr/local/android-studio
    • Flutter plugin version 56.0.2
    • Dart plugin version 202.8488
    • Java version OpenJDK Runtime Environment (build 11.0.8+0-b944-P17168821)

[✓] IntelliJ IDEA Community Edition (version 2021.1)
    • IntelliJ at /usr/local/idea-IC-211.7142.45
    • Flutter plugin version 56.0.5
    • Dart plugin version 211.7233

[✓] VS Code (version 1.56.2)
    • VS Code at /usr/share/code
    • Flutter extension version 3.22.0

[✓] Connected device (2 available)
    • POT LX1 (mobile) • 39V4C19A18025168 • android-arm64  • Android 10 (API 29)
    • Chrome (web)     • chrome           • web-javascript • Google Chrome 90.0.4430.212

• No issues found!
  • Package version: 1.0.1+2

Thanks for your help!

Can't create a payment method

Describe the bug
The following error is received when attempting to create a payment method:
e type 'String' is not a subtype of type 'Map<dynamic, dynamic>?' in type cast

To Reproduce
Steps to reproduce the behavior:

  1. Using CardField, enter card information (4242 4242 4242 4242, ...)
  2. Once you have the resulting card, attempt to create a payment method
// UI
CardField(
  enablePostalCode: true,
  autofocus: true,
  onCardChanged: (card) {
    setState(() {
      _card = card;
    });
  },
),

// assuming we have `card` available from CardField now here:
// card = CardFieldInputDetails(complete: true, last4: 4242, expiryMonth: 12, expiryYear: 34, postalCode: 92103, brand: Visa)

final billingDetails = BillingDetails(
  email: '[email protected]',
  phone: '+48888000888',
  address: Address(
    city: 'Houston',
    country: 'US',
    line1: '1459  Circle Drive',
    line2: '',
    state: 'Texas',
    postalCode: card.postalCode,
  ),
);

// This fails
final pm = await Stripe.instance.createPaymentMethod(
  PaymentMethodParams.card(
    billingDetails: billingDetails,
  ),
);

flutter: e type 'String' is not a subtype of type 'Map<dynamic, dynamic>?' in type cast

Expected behavior
A payment method object should be created

Smartphone / tablet

  • Device: iPhone 12 Pro Max Simulator
  • OS: [e.g. iOS 13, Android 10]
  • Package version: latest
  • [✓] Flutter (Channel stable, 2.0.5, on macOS 11.3.1 20E241 darwin-x64, locale en-US)

Missing 'package' key attribute on element package at [com.stripe:stripe-android:16.8.2] AndroidManifest.xml:13:9-54

Describe the bug
I am using the latest version of flutter-stripe. There was no issue with calling flutter pub get. But after I run the project it thrown me the error:

Missing 'package' key attribute on element package at [com.stripe:stripe-android:16.8.2] AndroidManifest.xml:13:9-54

To Reproduce
Steps to reproduce the behavior:

  1. Update flutter-stripe to flutter_stripe: ^1.0.1+3.
  2. Run the project

Current dart version :

sdk: ">=2.10.0 <3.0.0"

Complete error code:

[   +2 ms] [com.stripe:stripe-android:16.8.2] C:\Users\cezay\.gradle\caches\transforms-2\files-2.1\d600c8495ab69dad66fbfef077cfbd4b\stripe-android-16.8.2\AndroidManifest.xml:13:9-54 Error:
[   +1 ms] 	Missing 'package' key attribute on element package at [com.stripe:stripe-android:16.8.2] AndroidManifest.xml:13:9-54
[        ] [com.stripe:stripe-android:16.8.2] C:\Users\cezay\.gradle\caches\transforms-2\files-2.1\d600c8495ab69dad66fbfef077cfbd4b\stripe-android-16.8.2\AndroidManifest.xml Error:
[        ] 	Validation failed, exiting
[        ] FAILURE: Build failed with an exception.
[        ] * What went wrong:
[        ] Execution failed for task ':app:processDebugManifest'.
[        ] > Manifest merger failed with multiple errors, see logs
[        ] * Try:
[        ] Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
[        ] * Get more help at https://help.gradle.org
[   +6 ms] BU�LD FAILED in 32s
[{"event":"app.progress","params":{"appId":"83d71c1a-19fd-41a2-b2b7-746649c99272","id":"0","progressId":null,"finished":true}}]
[ +542 ms] Exception: Gradle task assembleDebug failed with exit code 1
[   +2 ms] 
           #0      throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
           #1      RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:550:9)
           <asynchronous suspension>
           #2      FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:1157:12)
           <asynchronous suspension>
           #3      FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1009:27)
           <asynchronous suspension>
           #4      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
           <asynchronous suspension>
           #5      AppContext.run (package:flutter_tools/src/base/context.dart:149:12)
           <asynchronous suspension>
           #6      CommandRunner.runCommand (package:args/command_runner.dart:197:13)
           <asynchronous suspension>
           #7      FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:278:9)
           <asynchronous suspension>
           #8      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
           <asynchronous suspension>
           #9      AppContext.run (package:flutter_tools/src/base/context.dart:149:12)
           <asynchronous suspension>
           #10     FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:234:5)
           <asynchronous suspension>
           #11     run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:64:9)
           <asynchronous suspension>
           #12     run.<anonymous closure> (package:flutter_tools/runner.dart:62:12)
           <asynchronous suspension>
           #13     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
           <asynchronous suspension>
           #14     AppContext.run (package:flutter_tools/src/base/context.dart:149:12)
           <asynchronous suspension>
           #15     runInContext (package:flutter_tools/src/context_runner.dart:73:10)
           <asynchronous suspension>
           #16     main (package:flutter_tools/executable.dart:90:3)
           <asynchronous suspension>

Additional context
Add any other context about the problem here.

Deserializing payment methods from the Stripe API

I'm making a call to my REST API to fetch a user's list of saved payment methods-- which returns the JSON provided via the Stripe API for a List.

  Future<List<PaymentMethod>> fetchPaymentMethods() async {
      final response = await http.get(
        uriPaymentMethods(),
        headers: {
          "Accept": "application/json",
          "content-type": "application/json",
          if (_sessionToken != null)
            HttpHeaders.authorizationHeader: 'Bearer $_sessionToken',
        },
      );
      final responseJson = HttpUtil.returnResponse(response) as List;
      return responseJson
          .map((json) => PaymentMethod.fromJson(json))
          .toList();
  }

The .fromJson method attempts to deserialize the payment method and errors on the Card property. It seems as though the generated .fromJson method is expecting Card with a capital C -- but the Stripe API returns all properties in lowercase.

flutter: NoSuchMethodError: The method '[]' was called on null.
Receiver: null
Tried calling:
flutter: #0 Object.noSuchMethod (dart:core-patch/object_patch.dart:54:5)
#1 $$_CardFromJson
package:stripe_platform_interface/…/models/payment_methods.g.dart:97
#2 new _$_Card.fromJson
package:stripe_platform_interface/…/models/payment_methods.freezed.dart:1513
#3 _$CardFromJson
package:stripe_platform_interface/…/models/payment_methods.freezed.dart:1323
#4 new Card.fromJson
package:stripe_platform_interface/…/models/payment_methods.dart:156
#5 $$_PaymentMethodFromJson
package:stripe_platform_interface/…/models/payment_methods.g.dart:16
#6 new _$_PaymentMethod.fromJson
package:stripe_platform_interface/…/models/payment_methods.freezed.dart:439
#7 _$PaymentMethodFromJson
package:stripe_platform_interface/…/models/payment_methods.freezed.dart:16
#8 new PaymentMethod.fromJson
package:stripe_platform_interface/…/models/payment_methods.dart:66

Undefined behavior (app crash) with Google Pay on Android

When using the GooglePayButton widget I get strange behavior if I decide to cancel the payment by closing the open modal after pressing the pay button.

To reproduce on example app
I wanted to make a video demonstration but unfortunately, the google play screen is obscured (obviously) with any screen capture.
The steps are pretty simple:

  1. On the example App, choose Google Pay payment (Android)
  2. Then press the pay button
  3. Close the Google Pay screen, without making any payment. I've tried the X in the top right corner and the back button on the navigation bar of my Huawei phone and the app crashes trying to close the screen.

The error messages seem to be clear, I'm trying to take a deeper look.

log: RuntimeException
D/AndroidRuntime(19083): Shutting down VM
I/QarthLog(19083): [PatchStore] createDisableExceptionQarthFile
I/QarthLog(19083): [PatchStore] create disable file for com.flutter_stripe.example uid is 10473
E/AndroidRuntime(19083): FATAL EXCEPTION: main
E/AndroidRuntime(19083): Process: com.flutter_stripe.example, PID: 19083
E/AndroidRuntime(19083): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=991, result=0, data=null} to activity {com.flutter_stripe.example/com.flutter_stripe.example.MainActivity}: java.lang.NullPointerException: Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkNotNullParameter, parameter data
E/AndroidRuntime(19083): 	at android.app.ActivityThread.deliverResults(ActivityThread.java:5471)
E/AndroidRuntime(19083): 	at android.app.ActivityThread.handleSendResult(ActivityThread.java:5512)
E/AndroidRuntime(19083): 	at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:51)
E/AndroidRuntime(19083): 	at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:149)
E/AndroidRuntime(19083): 	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:103)
E/AndroidRuntime(19083): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2386)
E/AndroidRuntime(19083): 	at android.os.Handler.dispatchMessage(Handler.java:107)
E/AndroidRuntime(19083): 	at android.os.Looper.loop(Looper.java:213)
E/AndroidRuntime(19083): 	at android.app.ActivityThread.main(ActivityThread.java:8178)
E/AndroidRuntime(19083): 	at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(19083): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
E/AndroidRuntime(19083): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1101)
E/AndroidRuntime(19083): Caused by: java.lang.NullPointerException: Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkNotNullParameter, parameter data
E/AndroidRuntime(19083): 	at com.reactnativestripesdk.StripeSdkModule$mActivityEventListener$1.onActivityResult(Unknown Source:7)
E/AndroidRuntime(19083): 	at com.facebook.react.bridge.BaseActivityEventListener.onActivityResult(BaseActivityEventListener.kt:15)
E/AndroidRuntime(19083): 	at io.flutter.embedding.engine.FlutterEngineConnectionRegistry$FlutterEngineActivityPluginBinding.onActivityResult(FlutterEngineConnectionRegistry.java:739)
E/AndroidRuntime(19083): 	at io.flutter.embedding.engine.FlutterEngineConnectionRegistry.onActivityResult(FlutterEngineConnectionRegistry.java:426)
E/AndroidRuntime(19083): 	at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onActivityResult(FlutterActivityAndFragmentDelegate.java:677)
E/AndroidRuntime(19083): 	at io.flutter.embedding.android.FlutterFragment.onActivityResult(FlutterFragment.java:769)
E/AndroidRuntime(19083): 	at io.flutter.embedding.android.FlutterFragmentActivity.onActivityResult(FlutterFragmentActivity.java:509)
E/AndroidRuntime(19083): 	at android.app.Activity.dispatchActivityResult(Activity.java:8413)
E/AndroidRuntime(19083): 	at android.app.ActivityThread.deliverResults(ActivityThread.java:5464)
E/AndroidRuntime(19083): 	... 11 more
I/Process (19083): Sending signal. PID: 19083 SIG: 9
Lost connection to device.
Exited (sigterm)
flutter doctor -v
[✓] Flutter (Channel stable, 2.2.0, on Linux, locale en_GB.UTF-8)
    • Flutter version 2.2.0 at /home/anmentone/lib/flutter
    • Framework revision b22742018b (10 days ago), 2021-05-14 19:12:57 -0700
    • Engine revision a9d88a4d18
    • Dart version 2.13.0

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /home/anmentone/Android/Sdk
    • Platform android-30, build-tools 30.0.3
    • Java binary at: /usr/local/android-studio/jre/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.8+0-b944-P17168821)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • Chrome at google-chrome

[✓] Android Studio (version 4.2)
    • Android Studio at /usr/local/android-studio
    • Flutter plugin version 56.0.2
    • Dart plugin version 202.8488
    • Java version OpenJDK Runtime Environment (build 11.0.8+0-b944-P17168821)

[✓] IntelliJ IDEA Community Edition (version 2021.1)
    • IntelliJ at /usr/local/idea-IC-211.7142.45
    • Flutter plugin version 56.0.5
    • Dart plugin version 211.7233

[✓] VS Code (version 1.56.2)
    • VS Code at /usr/share/code
    • Flutter extension version 3.22.0

[✓] Connected device (2 available)
    • POT LX1 (mobile) • 39V4C19A18025168 • android-arm64  • Android 10 (API 29)
    • Chrome (web)     • chrome           • web-javascript • Google Chrome 90.0.4430.212

• No issues found!
Flutter version 1.0.1+2

Postal code still visibile in the form on Android

Postal code is still visible in the form, although is not enabled by default.

card_field.dart

  const CardField({
    required this.onCardChanged,
    Key? key,
    this.onFocus,
    this.decoration,
    this.enablePostalCode = false,
    this.style,
    this.autofocus = false,
    this.cursorColor,
    this.numberHintText,
    this.expirationHintText,
    this.cvcHintText,
    this.postalCodeHintText,
  }) : super(key: key);

com/flutter/stripe/StripeSdkCardPlatformView.kt

40 if (creationParams?.containsKey("postalCodeEnabled") == true) {
41 stripeSdkCardViewManager.setPostalCodeEnabled(cardView, creationParams["postalCodeEnabled"] as Boolean)        
42 }

I have seen the code flow on android and the value is only assigned if it is true.
The problem is that flutter by default sets it to false while on kotlin it doesn't. You can't set it to false because, as you see above, the value must be true to be set.

By default is true:

com/reactnativestripesdk/StripeSdkCardViewManager.kt

22 @ReactProp(name = "postalCodeEnabled") 
23 fun setPostalCodeEnabled(view: StripeSdkCardView, postalCodeEnabled: Boolean = true)  {
24   view.setPostalCodeEnabled(postalCodeEnabled); 
25 }

Package version: 1.0.1+2

Add a CI step for testing publishing through `pub publish --dry run`

Following up Remon's suggestion on #48:
Add a step for testing publishing. In my other package we found this check quick and very helpful in case we messed up with the project structure. Also I think we should consider building the apps (can be in a pr later of course) since we have quite some native code.

Focus issue with card view

Every other attempt to write into the native card view fails, at least on Android - it might be fixed with the FocusNode adjustment that currently happens on the native side made by @jamesblasco for iOS

Otherwise it needs to be investigated on on the Android side

SEPA Debit and iDeal payment methods

Awesome job on this guys!
For my app I'm looking for 2 payment methods on top of credit cards:

  • iDEAL payments (bank redirect)
  • Subscription based (recurring) payments through SEPA direct debit

The readme refers to this page which lists both methods: https://stripe.com/docs/payments/payment-methods/overview

I've tried to adjust the example code to work with the methods above, but not sure if it is even possible. Are these methods currently supported?
If the answer is no, please consider this feature request.
If it is already supported, some pointers on how to get started with these payment methods would be much appreciated!

[Android] IllegalArgumentException: The style on this component requires your app theme to be Theme.AppCompat (or a descendant)

Hi, Team,

I have the following problem with the card field.
I have done this:
Stripe.publishableKey = Constants.getPublishableKey();
And this is my pay button callback:
void onPressPayCallback() async { await Stripe.instance.createPaymentMethod(PaymentMethodParams.card()); }
And in order to make it work i have to put a CardFIeld widget:
Widget? _buildBodyContent(BuildContext context) { return Column( children: [ CardField( onFocus: (name) {}, numberHintText: "Number", expirationHintText: "Expiry", cvcHintText: "CVC", postalCodeHintText: "Postal Code", onCardChanged: (card) { print(card); }, ), Divider(height: 1), ]); }

However, when i press the button with the callback i have the error above.
Please, advise me on that error :)

My flutter doctor -v

[✓] Flutter (Channel stable, 2.0.1, on Mac OS X 10.15.7 19H15 darwin-x64, locale en-ES)
    • Flutter version 2.0.1 at 
    • Framework revision c5a4b4029c (3 months ago), 2021-03-04 09:47:48 -0800
    • Engine revision 40441def69
    • Dart version 2.12.0

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at
    • Platform android-30, build-tools 30.0.3
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.1, Build version 12A7403
    • CocoaPods version 1.10.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)

[✓] IntelliJ IDEA Ultimate Edition (version 2021.1)
    • IntelliJ at /Applications/IntelliJ IDEA.app
    • Flutter plugin version 55.1.5
    • Dart plugin version 211.6693.108

[✓] VS Code (version 1.41.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension can be installed from:
      🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (4 available)
    • sdk gphone x86 arm (mobile) • emulator-5554                        • android-x86    • Android 11 (API 30) (emulator)
    • iPhone 8 (mobile)           • B3CBF822-CFE4-45CB-9EA3-D732CCC55566 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-14-1 (simulator)
    • macOS (desktop)             • macos                                • darwin-x64     • Mac OS X 10.15.7 19H15 darwin-x64
    • Chrome (web)                • chrome                               • web-javascript • Google Chrome 90.0.4430.212

• No issues found!

The complete stacktrace is the following:

E/MethodChannel#flutter/platform_views( 5346): Failed to handle method call
E/MethodChannel#flutter/platform_views( 5346): android.view.InflateException: Binary XML file line #22 in com.eatandparty:layout/card_input_widget: Binary XML file line #22 in com.eatandparty:layout/card_input_widget: Error inflating class com.google.android.material.textfield.TextInputLayout
E/MethodChannel#flutter/platform_views( 5346): Caused by: android.view.InflateException: Binary XML file line #22 in com.eatandparty:layout/card_input_widget: Error inflating class com.google.android.material.textfield.TextInputLayout
E/MethodChannel#flutter/platform_views( 5346): Caused by: java.lang.reflect.InvocationTargetException
E/MethodChannel#flutter/platform_views( 5346): 	at java.lang.reflect.Constructor.newInstance0(Native Method)
E/MethodChannel#flutter/platform_views( 5346): 	at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
E/MethodChannel#flutter/platform_views( 5346): 	at android.view.LayoutInflater.createView(LayoutInflater.java:852)
E/MethodChannel#flutter/platform_views( 5346): 	at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1004)
E/MethodChannel#flutter/platform_views( 5346): 	at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:959)
E/MethodChannel#flutter/platform_views( 5346): 	at android.view.LayoutInflater.rInflate(LayoutInflater.java:1121)
E/MethodChannel#flutter/platform_views( 5346): 	at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1082)
E/MethodChannel#flutter/platform_views( 5346): 	at android.view.LayoutInflater.rInflate(LayoutInflater.java:1124)
E/MethodChannel#flutter/platform_views( 5346): 	at android.view.LayoutInflater.inflate(LayoutInflater.java:654)
E/MethodChannel#flutter/platform_views( 5346): 	at android.view.LayoutInflater.inflate(LayoutInflater.java:532)
E/MethodChannel#flutter/platform_views( 5346): 	at android.view.LayoutInflater.inflate(LayoutInflater.java:479)
E/MethodChannel#flutter/platform_views( 5346): 	at com.stripe.android.databinding.CardInputWidgetBinding.inflate(CardInputWidgetBinding.java:88)
E/MethodChannel#flutter/platform_views( 5346): 	at com.stripe.android.view.CardInputWidget.<init>(CardInputWidget.kt:63)
E/MethodChannel#flutter/platform_views( 5346): 	at com.stripe.android.view.CardInputWidget.<init>(CardInputWidget.kt:57)
E/MethodChannel#flutter/platform_views( 5346): 	at com.reactnativestripesdk.StripeSdkCardView.<init>(StripeSdkCardView.kt:27)
E/MethodChannel#flutter/platform_views( 5346): 	at com.reactnativestripesdk.StripeSdkCardViewManager.createViewInstance(StripeSdkCardViewManager.kt:47)
E/MethodChannel#flutter/platform_views( 5346): 	at com.flutter.stripe.StripeSdkCardPlatformView.<init>(StripeSdkCardPlatformView.kt:30)
E/MethodChannel#flutter/platform_views( 5346): 	at com.flutter.stripe.StripeSdkCardPlatformViewFactory.create(StripeSdkCardPlatformViewFactory.kt:19)
E/MethodChannel#flutter/platform_views( 5346): 	at io.flutter.plugin.platform.PlatformViewsController$1.createAndroidViewForPlatformView(PlatformViewsController.java:146)
E/MethodChannel#flutter/platform_views( 5346): 	at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.create(PlatformViewsChannel.java:101)
E/MethodChannel#flutter/platform_views( 5346): 	at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.onMethodCall(PlatformViewsChannel.java:59)
E/MethodChannel#flutter/platform_views( 5346): 	at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:233)
E/MethodChannel#flutter/platform_views( 5346): 	at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85)
E/MethodChannel#flutter/platform_views( 5346): 	at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:818)
E/MethodChannel#flutter/platform_views( 5346): 	at android.os.MessageQueue.nativePollOnce(Native Method)
E/MethodChannel#flutter/platform_views( 5346): 	at android.os.MessageQueue.next(MessageQueue.java:335)
E/MethodChannel#flutter/platform_views( 5346): 	at android.os.Looper.loop(Looper.java:183)
E/MethodChannel#flutter/platform_views( 5346): 	at android.app.ActivityThread.main(ActivityThread.java:7656)
E/MethodChannel#flutter/platform_views( 5346): 	at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#flutter/platform_views( 5346): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
E/MethodChannel#flutter/platform_views( 5346): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
E/MethodChannel#flutter/platform_views( 5346): Caused by: java.lang.IllegalArgumentException: The style on this component requires your app theme to be Theme.AppCompat (or a descendant).
E/MethodChannel#flutter/platform_views( 5346): 	at com.google.android.material.internal.ThemeEnforcement.checkTheme(ThemeEnforcement.java:243)
E/MethodChannel#flutter/platform_views( 5346): 	at com.google.android.material.internal.ThemeEnforcement.checkAppCompatTheme(ThemeEnforcement.java:213)
E/MethodChannel#flutter/platform_views( 5346): 	at com.google.android.material.internal.ThemeEnforcement.checkCompatibleTheme(ThemeEnforcement.java:148)
E/MethodChannel#flutter/platform_views( 5346): 	at com.google.android.material.internal.ThemeEnforcement.obtainTintedStyledAttributes(ThemeEnforcement.java:115)
E/MethodChannel#flutter/platform_views( 5346): 	at com.google.android.material.textfield.TextInputLayout.<init>(TextInputLayout.java:463)
E/MethodChannel#flutter/platform_views( 5346): 	at com.google.android.material.textfield.TextInputLayout.<init>(TextInputLayout.java:422)
E/MethodChannel#flutter/platform_views( 5346): 	... 31 more
E/flutter ( 5346): [ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: PlatformException(error, Binary XML file line #22 in com.eatandparty:layout/card_input_widget: Binary XML file line #22 in com.eatandparty:layout/card_input_widget: Error inflating class com.google.android.material.textfield.TextInputLayout, null, android.view.InflateException: Binary XML file line #22 in com.eatandparty:layout/card_input_widget: Binary XML file line #22 in com.eatandparty:layout/card_input_widget: Error inflating class com.google.android.material.textfield.TextInputLayout
E/flutter ( 5346): Caused by: android.view.InflateException: Binary XML file line #22 in com.eatandparty:layout/card_input_widget: Error inflating class com.google.android.material.textfield.TextInputLayout
E/flutter ( 5346): Caused by: java.lang.reflect.InvocationTargetException
E/flutter ( 5346): 	at java.lang.reflect.Constructor.newInstance0(Native Method)
E/flutter ( 5346): 	at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
E/flutter ( 5346): 	at android.view.LayoutInflater.createView(LayoutInflater.java:852)
E/flutter ( 5346): 	at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1004)
E/flutter ( 5346): 	at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:959)
E/flutter ( 5346): 	at android.view.LayoutInflater.rInflate(LayoutInflater.java:1121)
E/flutter ( 5346): 	at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1082)
E/flutter ( 5346): 	at android.view.LayoutInflater.rInflate(LayoutInflater.java:1124)
E/flutter ( 5346): 	at android.view.LayoutInflater.inflate(LayoutInflater.java:654)
E/flutter ( 5346): 	at android.view.LayoutInflater.inflate(LayoutInflater.java:532)
E/flutter ( 5346): 	at android.view.LayoutInflater.inflate(LayoutInflater.java:479)
E/flutter ( 5346): 	at com.stripe.android.databinding.CardInputWidgetBinding.inflate(CardInputWidgetBinding.java:88)
E/flutter ( 5346): 	at com.stripe.android.view.CardInputWidget.<init>(CardInputWidget.kt:63)
E/flutter ( 5346): 	at com.stripe.android.view.CardInputWidget.<init>(CardInputWidget.kt:57)
E/flutter ( 5346): 	at com.reactnativestripesdk.StripeSdkCardView.<init>(StripeSdkCardView.kt:27)
E/flutter ( 5346): 	at com.reactnativestripesdk.StripeSdkCardViewManager.createViewInstance(StripeSdkCardViewManager.kt:47)
E/flutter ( 5346): 	at com.flutter.stripe.StripeSdkCardPlatformView.<init>(StripeSdkCardPlatformView.kt:30)
E/flutter ( 5346): 	at com.flutter.stripe.StripeSdkCardPlatformViewFactory.create(StripeSdkCardPlatformViewFactory.kt:19)
E/flutter ( 5346): 	at io.flutter.plugin.platform.PlatformViewsController$1.createAndroidViewForPlatformView(PlatformViewsController.java:146)
E/flutter ( 5346): 	at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.create(PlatformViewsChannel.java:101)
E/flutter ( 5346): 	at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.onMethodCall(PlatformViewsChannel.java:59)
E/flutter ( 5346): 	at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:233)
E/flutter ( 5346): 	at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85)
E/flutter ( 5346): 	at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:818)
E/flutter ( 5346): 	at android.os.MessageQueue.nativePollOnce(Native Method)
E/flutter ( 5346): 	at android.os.MessageQueue.next(MessageQueue.java:335)
E/flutter ( 5346): 	at android.os.Looper.loop(Looper.java:183)
E/flutter ( 5346): 	at android.app.ActivityThread.main(ActivityThread.java:7656)
E/flutter ( 5346): 	at java.lang.reflect.Method.invoke(Native Method)
E/flutter ( 5346): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
E/flutter ( 5346): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
E/flutter ( 5346): Caused by: java.lang.IllegalArgumentException: The style on this component requires your app theme to be Theme.AppCompat (or a descendant).
E/flutter ( 5346): 	at com.google.android.material.internal.ThemeEnforcement.checkTheme(ThemeEnforcement.java:243)
E/flutter ( 5346): 	at com.google.android.material.internal.ThemeEnforcement.checkAppCompatTheme(ThemeEnforcement.java:213)
E/flutter ( 5346): 	at com.google.android.material.internal.ThemeEnforcement.checkCompatibleTheme(ThemeEnforcement.java:148)
E/flutter ( 5346): 	at com.google.android.material.internal.ThemeEnforcement.obtainTintedStyledAttributes(ThemeEnforcement.java:115)
E/flutter ( 5346): 	at com.google.android.material.textfield.TextInputLayout.<init>(TextInputLayout.java:463)
E/flutter ( 5346): 	at com.google.android.material.textfield.TextInputLayout.<init>(TextInputLayout.java:422)
E/flutter ( 5346): 	... 31 more
E/flutter ( 5346): )
E/flutter ( 5346): #0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:581:7)
E/flutter ( 5346): #1      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:158:18)
E/flutter ( 5346): <asynchronous suspension>
E/flutter ( 5346): #2      AndroidViewController.create (package:flutter/src/services/platform_views.dart:742:5)
E/flutter ( 5346): <asynchronous suspension>
E/flutter ( 5346): 
E/flutter ( 5346): [ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: MissingPluginException(No implementation found for method requestFocus on channel flutter.stripe/card_field/0)
E/flutter ( 5346): #0      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:156:7)
E/flutter ( 5346): <asynchronous suspension>
E/flutter ( 5346): 
E/flutter ( 5346): [ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: MissingPluginException(No implementation found for method onPlaceholderChanged on channel flutter.stripe/card_field/0)
E/flutter ( 5346): #0      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:156:7)
E/flutter ( 5346): <asynchronous suspension>
E/flutter ( 5346): 

[iOS] Not able to build because of - CocoaPods could not find compatible versions for pod "stripe_ios"

Hi, Team,

I have the following problem when building for iOS. I come across the error above - although, for sure, flutter_stripe implicitly includes this dependency.
Please, advise me on that error :)

My flutter doctor -v

[✓] Flutter (Channel stable, 2.0.1, on Mac OS X 10.15.7 19H15 darwin-x64, locale en-ES)
    • Flutter version 2.0.1 at 
    • Framework revision c5a4b4029c (3 months ago), 2021-03-04 09:47:48 -0800
    • Engine revision 40441def69
    • Dart version 2.12.0

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at
    • Platform android-30, build-tools 30.0.3
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.1, Build version 12A7403
    • CocoaPods version 1.10.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)

[✓] IntelliJ IDEA Ultimate Edition (version 2021.1)
    • IntelliJ at /Applications/IntelliJ IDEA.app
    • Flutter plugin version 55.1.5
    • Dart plugin version 211.6693.108

[✓] VS Code (version 1.41.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension can be installed from:
      🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (4 available)
    • sdk gphone x86 arm (mobile) • emulator-5554                        • android-x86    • Android 11 (API 30) (emulator)
    • iPhone 8 (mobile)           • B3CBF822-CFE4-45CB-9EA3-D732CCC55566 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-14-1 (simulator)
    • macOS (desktop)             • macos                                • darwin-x64     • Mac OS X 10.15.7 19H15 darwin-x64
    • Chrome (web)                • chrome                               • web-javascript • Google Chrome 90.0.4430.212

• No issues found!

The complete stacktrace is the following:

Launching lib/main.dart on iPhone 8 in debug mode...
Running pod install...
CocoaPods' output:
↳
      Preparing

    Analyzing dependencies

    Inspecting targets to integrate
      Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``)

    Finding Podfile changes
      A stripe_ios
      R stripe_payment
      - Flutter
      - firebase_auth
      - firebase_core
      - flutter_facebook_auth
      - flutter_keyboard_visibility
      - geolocator
      - google_maps_flutter
      - google_sign_in
      - video_player
      - wakelock
      - webview_flutter

    Fetching external sources
    -> Fetching podspec for `Flutter` from `Flutter`
    -> Fetching podspec for `firebase_auth` from `.symlinks/plugins/firebase_auth/ios`
    firebase_auth: Using Firebase SDK version '7.3.0' defined in 'firebase_core'
    -> Fetching podspec for `firebase_core` from `.symlinks/plugins/firebase_core/ios`
    firebase_core: Using Firebase SDK version '7.3.0' defined in 'firebase_core'
    -> Fetching podspec for `flutter_facebook_auth` from `.symlinks/plugins/flutter_facebook_auth/ios`
    -> Fetching podspec for `flutter_keyboard_visibility` from `.symlinks/plugins/flutter_keyboard_visibility/ios`
    -> Fetching podspec for `geolocator` from `.symlinks/plugins/geolocator/ios`
    -> Fetching podspec for `google_maps_flutter` from `.symlinks/plugins/google_maps_flutter/ios`
    -> Fetching podspec for `google_sign_in` from `.symlinks/plugins/google_sign_in/ios`
    -> Fetching podspec for `stripe_ios` from `.symlinks/plugins/stripe_ios/ios`
    -> Fetching podspec for `video_player` from `.symlinks/plugins/video_player/ios`
    -> Fetching podspec for `wakelock` from `.symlinks/plugins/wakelock/ios`
    -> Fetching podspec for `webview_flutter` from `.symlinks/plugins/webview_flutter/ios`

    Resolving dependencies of `Podfile`
      CDN: trunk Relative path: CocoaPods-version.yml exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: all_pods_versions_0_3_5.txt exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: Specs/0/3/5/Firebase/7.5.0/Firebase.podspec.json exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: Specs/0/3/5/Firebase/7.3.0/Firebase.podspec.json exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: Specs/0/3/5/Firebase/7.3.0/Firebase.podspec.json exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: all_pods_versions_a_d_d.txt exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: Specs/a/d/d/GoogleMaps/4.1.0/GoogleMaps.podspec.json exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: all_pods_versions_d_4_0.txt exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: Specs/d/4/0/GoogleSignIn/5.0.2/GoogleSignIn.podspec.json exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: all_pods_versions_9_b_5.txt exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: Specs/9/b/5/FBSDKCoreKit/9.1.0/FBSDKCoreKit.podspec.json exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: all_pods_versions_b_3_c.txt exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: Specs/b/3/c/FBSDKLoginKit/9.1.0/FBSDKLoginKit.podspec.json exists! Returning local because checking is only perfomed in repo update
    [!] CocoaPods could not find compatible versions for pod "stripe_ios":
      In Podfile:
        stripe_ios (from `.symlinks/plugins/stripe_ios/ios`)

    Specs satisfying the `stripe_ios (from `.symlinks/plugins/stripe_ios/ios`)` dependency were found, but they required a higher minimum deployment target.

    /Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:328:in `raise_error_unless_state'
    /Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:310:in `block in unwind_for_conflict'
    /Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:308:in `tap'
    /Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:308:in `unwind_for_conflict'
    /Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:684:in `attempt_to_activate'
    /Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:254:in `process_topmost_state'
    /Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:182:in `resolve'
    /Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolver.rb:43:in `resolve'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/resolver.rb:94:in `resolve'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:1074:in `block in resolve_dependencies'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/user_interface.rb:64:in `section'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:1072:in `resolve_dependencies'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:124:in `analyze'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:414:in `analyze'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:239:in `block in resolve_dependencies'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/user_interface.rb:64:in `section'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:238:in `resolve_dependencies'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:160:in `install!'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/command/install.rb:52:in `run'
    /Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/command.rb:52:in `run'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/bin/pod:55:in `<top (required)>'
    /usr/local/bin/pod:23:in `load'
    /usr/local/bin/pod:23:in `<main>'

Error running pod install
Error launching application on iPhone 8.

No implementation found for method requestFocus on channel flutter.stripe/card_field/0

okay first thing: Please mention that we have to upgrade kotlin version of our project to 1.5.0. I spent too much time on this because I was getting errors and the reason was that my kotlin version was 1.3.50

After upgrading it I am trying to use this library but I get following error when I try to use CardField:

E/flutter ( 9127): [ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: MissingPluginException(No implementation found for method requestFocus on channel flutter.stripe/card_field/0)
E/flutter ( 9127): #0      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:156:7)
E/flutter ( 9127): <asynchronous suspension>
E/flutter ( 9127): 
E/flutter ( 9127): [ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: MissingPluginException(No implementation found for method onPlaceholderChanged on channel flutter.stripe/card_field/0)
E/flutter ( 9127): #0      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:156:7)
E/flutter ( 9127): <asynchronous suspension>
E/flutter ( 9127): 
[GETX] CLOSE BOTTOMSHEET: 326924694
E/flutter ( 9127): [ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: MissingPluginException(No implementation found for method clearFocus on channel flutter.stripe/card_field/0)
E/flutter ( 9127): #0      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:156:7)
E/flutter ( 9127): <asynchronous suspension>

Full details from Logcat:

2021-05-25 13:46:24.237 9127-9127/com.takeaway.machers.machers_takeaway E/MethodChannel#flutter/platform_views: Failed to handle method call
    android.view.InflateException: Binary XML file line #22 in com.takeaway.machers.machers_takeaway:layout/card_input_widget: Binary XML file line #22 in com.takeaway.machers.machers_takeaway:layout/card_input_widget: Error inflating class <unknown>
    Caused by: android.view.InflateException: Binary XML file line #22 in com.takeaway.machers.machers_takeaway:layout/card_input_widget: Error inflating class <unknown>
    Caused by: java.lang.reflect.InvocationTargetException
        at java.lang.reflect.Constructor.newInstance0(Native Method)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
        at android.view.LayoutInflater.createView(LayoutInflater.java:854)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1006)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:961)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:1123)
        at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1084)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:1126)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:656)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:534)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:481)
        at com.stripe.android.databinding.CardInputWidgetBinding.inflate(CardInputWidgetBinding.java:88)
        at com.stripe.android.view.CardInputWidget.<init>(CardInputWidget.kt:63)
        at com.stripe.android.view.CardInputWidget.<init>(CardInputWidget.kt:57)
        at com.reactnativestripesdk.StripeSdkCardView.<init>(StripeSdkCardView.kt:27)
        at com.reactnativestripesdk.StripeSdkCardViewManager.createViewInstance(StripeSdkCardViewManager.kt:47)
        at com.flutter.stripe.StripeSdkCardPlatformView.<init>(StripeSdkCardPlatformView.kt:30)
        at com.flutter.stripe.StripeSdkCardPlatformViewFactory.create(StripeSdkCardPlatformViewFactory.kt:19)
        at io.flutter.plugin.platform.PlatformViewsController$1.createAndroidViewForPlatformView(PlatformViewsController.java:146)
        at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.create(PlatformViewsChannel.java:101)
        at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.onMethodCall(PlatformViewsChannel.java:59)
        at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:233)
        at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85)
        at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:818)
        at android.os.MessageQueue.nativePollOnce(Native Method)
        at android.os.MessageQueue.next(MessageQueue.java:336)
        at android.os.Looper.loop(Looper.java:174)
        at android.app.ActivityThread.main(ActivityThread.java:7356)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
     Caused by: java.lang.IllegalArgumentException: The style on this component requires your app theme to be Theme.AppCompat (or a descendant).
        at com.google.android.material.internal.ThemeEnforcement.checkTheme(ThemeEnforcement.java:243)
        at com.google.android.material.internal.ThemeEnforcement.checkAppCompatTheme(ThemeEnforcement.java:213)
        at com.google.android.material.internal.ThemeEnforcement.checkCompatibleTheme(ThemeEnforcement.java:148)
        at com.google.android.material.internal.ThemeEnforcement.obtainTintedStyledAttributes(ThemeEnforcement.java:115)
        at com.google.android.material.textfield.TextInputLayout.<init>(TextInputLayout.java:463)
        at com.google.android.material.textfield.TextInputLayout.<init>(TextInputLayout.java:422)
        at java.lang.reflect.Constructor.newInstance0(Native Method) 
        at java.lang.reflect.Constructor.newInstance(Constructor.java:343) 
        at android.view.LayoutInflater.createView(LayoutInflater.java:854) 
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1006) 
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:961) 
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:1123) 
        at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1084) 
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:1126) 
        at android.view.LayoutInflater.inflate(LayoutInflater.java:656) 
        at android.view.LayoutInflater.inflate(LayoutInflater.java:534) 
        at android.view.LayoutInflater.inflate(LayoutInflater.java:481) 
        at com.stripe.android.databinding.CardInputWidgetBinding.inflate(CardInputWidgetBinding.java:88) 
        at com.stripe.android.view.CardInputWidget.<init>(CardInputWidget.kt:63) 
        at com.stripe.android.view.CardInputWidget.<init>(CardInputWidget.kt:57) 
        at com.reactnativestripesdk.StripeSdkCardView.<init>(StripeSdkCardView.kt:27) 
        at com.reactnativestripesdk.StripeSdkCardViewManager.createViewInstance(StripeSdkCardViewManager.kt:47) 
        at com.flutter.stripe.StripeSdkCardPlatformView.<init>(StripeSdkCardPlatformView.kt:30) 
        at com.flutter.stripe.StripeSdkCardPlatformViewFactory.create(StripeSdkCardPlatformViewFactory.kt:19) 
        at io.flutter.plugin.platform.PlatformViewsController$1.createAndroidViewForPlatformView(PlatformViewsController.java:146) 
        at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.create(PlatformViewsChannel.java:101) 
        at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.onMethodCall(PlatformViewsChannel.java:59) 
        at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:233) 
        at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85) 
        at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:818) 
        at android.os.MessageQueue.nativePollOnce(Native Method) 
        at android.os.MessageQueue.next(MessageQueue.java:336) 
        at android.os.Looper.loop(Looper.java:174) 
        at android.app.ActivityThread.main(ActivityThread.java:7356) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930) 
2021-05-25 13:46:24.254 9127-9169/com.takeaway.machers.machers_takeaway E/flutter: [ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: PlatformException(error, Binary XML file line #22 in com.takeaway.machers.machers_takeaway:layout/card_input_widget: Binary XML file line #22 in com.takeaway.machers.machers_takeaway:layout/card_input_widget: Error inflating class <unknown>, null, android.view.InflateException: Binary XML file line #22 in com.takeaway.machers.machers_takeaway:layout/card_input_widget: Binary XML file line #22 in com.takeaway.machers.machers_takeaway:layout/card_input_widget: Error inflating class <unknown>
    Caused by: android.view.InflateException: Binary XML file line #22 in com.takeaway.machers.machers_takeaway:layout/card_input_widget: Error inflating class <unknown>
    Caused by: java.lang.reflect.InvocationTargetException
        at java.lang.reflect.Constructor.newInstance0(Native Method)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
        at android.view.LayoutInflater.createView(LayoutInflater.java:854)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1006)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:961)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:1123)
        at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1084)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:1126)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:656)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:534)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:481)
        at com.stripe.android.databinding.CardInputWidgetBinding.inflate(CardInputWidgetBinding.java:88)
        at com.stripe.android.view.CardInputWidget.<init>(CardInputWidget.kt:63)
        at com.stripe.android.view.CardInputWidget.<init>(CardInputWidget.kt:57)
        at com.reactnativestripesdk.StripeSdkCardView.<init>(StripeSdkCardView.kt:27)
        at com.reactnativestripesdk.StripeSdkCardViewManager.createViewInstance(StripeSdkCardViewManager.kt:47)
        at com.flutter.stripe.StripeSdkCardPlatformView.<init>(StripeSdkCardPlatformView.kt:30)
        at com.flutter.stripe.StripeSdkCardPlatformViewFactory.create(StripeSdkCardPlatformViewFactory.kt:19)
        at io.flutter.plugin.platform.PlatformViewsController$1.createAndroidViewForPlatformView(PlatformViewsController.java:146)
        at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.create(PlatformViewsChannel.java:101)
        at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.onMethodCall(PlatformViewsChannel.java:59)
        at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:233)
        at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85)
        at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:818)
        at android.os.MessageQueue.nativePollOnce(Native Method)
        at android.os.MessageQueue.next(MessageQueue.java:336)
        at android.os.Looper.loop(Looper.java:174)
        at android.app.ActivityThread.main(ActivityThread.java:7356)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
     Caused by: java.lang.IllegalArgumentException: The style on this component requires your app theme to be Theme.AppCompat (or a descendant).
        at com.google.android.material.internal.ThemeEnforcement.checkTheme(ThemeEnforcement.java:243)
        at com.google.android.material.internal.ThemeEnforcement.checkAppCompatTheme(ThemeEnforcement.java:213)
        at com.google.android.material.internal.ThemeEnforcement.checkCompatibleTheme(ThemeEnforcement.java:148)
        at com.google.android.material.internal.ThemeEnforcement.obtainTintedStyledAttributes(ThemeEnforcement.java:115)
        at com.google.android.material.textfield.TextInputLayout.<init>(TextInputLayout.java:463)
        at com.google.android.material.textfield.TextInputLayout.<init>(TextInputLayout.java:422)
        at java.lang.reflect.Constructor.newInstance0(Native Method) 
        at java.lang.reflect.Constructor.newInstance(Constructor.java:343) 
        at android.view.LayoutInflater.createView(LayoutInflater.java:854) 
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1006) 
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:961) 
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:1123) 
        at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1084) 
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:1126) 
        at android.view.LayoutInflater.inflate(LayoutInflater.java:656) 
        at android.view.LayoutInflater.inflate(LayoutInflater.java:534) 
        at android.view.LayoutInflater.inflate(LayoutInflater.java:481) 
        at com.stripe.android.databinding.CardInputWidgetBinding.inflate(CardInputWidgetBinding.java:88) 
        at com.stripe.android.view.CardInputWidget.<init>(CardInputWidget.kt:63) 
        at com.stripe.android.view.CardInputWidget.<init>(CardInputWidget.kt:57) 
        at com.reactnativestripesdk.StripeSdkCardView.<init>(StripeSdkCardView.kt:27) 
        at com.reactnativestripesdk.StripeSdkCardViewManager.createViewInstance(StripeSdkCardViewManager.kt:47) 
        at com.flutter.stripe.StripeSdkCardPlatformView.<init>(StripeSdkCardPlatformView.kt:30) 
        at com.flutter.stripe.StripeSdkCardPlatformViewFactory.create(StripeSdkCardPlatformViewFactory.kt:19) 
        at io.flutter.plugin.platform.PlatformViewsController$1.createAndroidViewForPlatformView(PlatformViewsController.java:146) 
        at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.create(PlatformViewsChannel.java:101) 
        at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.onMethodCall(PlatformViewsChannel.java:59) 
        at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:233) 
        at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85) 
        at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:818) 
        at android.os.MessageQueue.nativePollOnce(Native Method) 
        at android.os.MessageQueue.next(MessageQueue.java:336) 
        at android.os.Looper.loop(Looper.java:174) 
        at android.app.ActivityThread.main(ActivityThread.java:7356) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930) 
    )
    #0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dar
2021-05-25 13:46:24.254 9127-9169/com.takeaway.machers.machers_takeaway E/flutter: [ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: MissingPluginException(No implementation found for method requestFocus on channel flutter.stripe/card_field/3)
    #0      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:156:7)
    <asynchronous suspension>
2021-05-25 13:46:24.275 9127-9169/com.takeaway.machers.machers_takeaway E/flutter: [ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: MissingPluginException(No implementation found for method onPlaceholderChanged on channel flutter.stripe/card_field/3)
    #0      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:156:7)
    <asynchronous suspension>

Stripe Terminal SDK Intergration

Would it be possible to include the terminal SDK into this new project, there is a andriod and iOS SDK available from stripe but no flutter implementation that I can find currently.

There is a growing use case for accepting in person payments via stripe as well as online payments
https://stripe.com/docs/terminal

Example App Google Pay Button Crash

Describe the bug
The example app crashes when closing the google pay dialog after opening it from the google pay button.

Error:
Failure delivering result ResultInfo{who=null, request=991, result=0, data=Intent { (has extras) }} to activity {com.flutter.stripe.example/com.flutter.stripe.example.MainActivity}: kotlin.UninitializedPropertyAccessException: lateinit property stripe has not been initialized

To Reproduce
Steps to reproduce the behavior:

  1. Launch the example app.
  2. Open google pay screen.
  3. Tap google pay button.
  4. Close google pay dialog that comes up.

Smartphone / tablet

  • Android Simulator API 30
  • Android Device Android 10

Apple pay recurring subscription

Hello,

I am currently looking into this package and cannot find an example or solution to make subscriptions with Apple pay.

So far it seems it is impossible to do it with the current version or am I wrong?

Thanks in advance.

App crash on Setup Future Payment example

Describe the bug
Hi, I'm trying setup_future_payment example but there is an exception from native Android code.
The error is generated by retrievePaymentIntent method

E/AndroidRuntime( 6283): FATAL EXCEPTION: AsyncTask #2
E/AndroidRuntime( 6283): Process:  PID: 6283
E/AndroidRuntime( 6283): java.lang.RuntimeException: Methods marked with @UiThread must be executed on the main thread. Current thread: AsyncTask #2
E/AndroidRuntime( 6283): 	at io.flutter.embedding.engine.FlutterJNI.ensureRunningOnMainThread(FlutterJNI.java:1230)
E/AndroidRuntime( 6283): 	at io.flutter.embedding.engine.FlutterJNI.invokePlatformMessageResponseCallback(FlutterJNI.java:905)
E/AndroidRuntime( 6283): 	at io.flutter.embedding.engine.dart.DartMessenger$Reply.reply(DartMessenger.java:160)
E/AndroidRuntime( 6283): 	at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler$1.success(MethodChannel.java:238)
E/AndroidRuntime( 6283): 	at com.facebook.react.bridge.Promise.resolve(Promise.java:17)
E/AndroidRuntime( 6283): 	at com.reactnativestripesdk.StripeSdkModule.retrievePaymentIntent$lambda-7(StripeSdkModule.kt:418)
E/AndroidRuntime( 6283): 	at com.reactnativestripesdk.StripeSdkModule.lambda$IKcyWuzmECIpax6mKWLUzTGJuho(Unknown Source:0)
E/AndroidRuntime( 6283): 	at com.reactnativestripesdk.-$$Lambda$StripeSdkModule$IKcyWuzmECIpax6mKWLUzTGJuho.run(Unknown Source:6)
E/AndroidRuntime( 6283): 	at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:305)
E/AndroidRuntime( 6283): 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
E/AndroidRuntime( 6283): 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
E/AndroidRuntime( 6283): 	at java.lang.Thread.run(Thread.java:923)
I/Process ( 6283): Sending signal. PID: 6283 SIG: 9

CardField text color is always white on iOS

The text from CardField is always white no matter what color I set.
This only happens on iOS. Android is fine.

My device:
iPhone 7, iOS 14.4, Flutter 2.2.0

Code:

CardField(
	style: TextStyle(
	  color: Colors.black,
	),
	onCardChanged: (card) {
	  setState(() {
	    _card = card;
	  });
	},
)

flutter_1
flutter_2

Missing API keys in the Authorization header

In my flutter app I added the public key, in the serverI added my dev keys In the server.env.example file of the server but when I try the server returns this error.

UnhandledPromiseRejectionWarning: Error: You did not provide an API key. You need to provide your API key in the Authorization header, using Bearer auth (e.g. 'Authorization: Bearer YOUR_SECRET_KEY'). See https://stripe.com/docs/api#authentication for details, or we can help at https://support.stripe.com/.
    at IncomingMessage.<anonymous> (/Users/francescovezzani/Developer/TheLounge/App/the_lounge/server/node_modules/stripe/lib/StripeResource.js:174:21)
    at Object.onceWrapper (events.js:421:28)
    at IncomingMessage.emit (events.js:327:22)
    at IncomingMessage.EventEmitter.emit (domain.js:467:12)
    at endReadableNT (internal/streams/readable.js:1327:12)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)
(node:13928) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 4)

Am I missing configuration, where I need to add the secret key?

Google Pay Support

Should the plugin contain components to activate & use Google Pay?

The actual interfaces between Google Pay & Stripe are:

// get things ready for payment
GooglePayConfig(publishableKey).tokenizationSpecification

// submit the json result from google pay to Stripe
// at this moment, the payment request should be valid, errors are handled earlier
PaymentMethodCreateParams.createFromGooglePay(json)

There is a bit more to it than Apple Pay I think, for example these additional dependencies - which can (& will) outdate:

  implementation 'com.google.android.gms:play-services-wallet:18.1.1'
  implementation 'androidx.appcompat:appcompat:1.2.0'

Developers are also required to modify AndroidManifest.xml files.


If this were not to be included in this package, then the Dart side would act as a JSON messenger between a google pay plugin (to generate tokenization spec) and the stripe side (to receive json results).

IMHO it is acceptable to include Google Pay fully in this package as Stripe ships with a few APIs already (com.stripe.android.googlepay.*).

Setup CI/CD pipeline

Problem

We currently don't have a CI/CD pipeline set-up yet for regression testing and automatically building/deploying the package to pub.

I think as the project grows this is going to be important to make sure we are not breaking things and not having any "bus factor" on the project (any maintainer with write access on the repository should be able to easily deploy the package to pub.dev by creating a tag on the Git without too much troubles?)

Just a proposal to make sure that this repository and project scalable in the longer term.

Solution

  1. CI pipeline
    We need to have a CI pipeline for:
  • Running automated regression tests so that things don't break after someone makes a pull request
    (Though, this is dependant on #19 right now since we don't have good test coverage currently), both for unit tests and integration tests just like flutter/flutter repository.
  1. CD pipeline
    I think another pipeline that triggers on tag creation to automatically build the binary and package and publish it to pub would also be essential to this repository.

What do you think?
Happy to take this task while also helping with testing and adding automated tests on the project \o/

Card details not complete exception on createPaymentMethod

Describe the bug
createPaymentMethod catch an exception

To Reproduce
I try to create a payment method

Implementation

              final billingDetails = BillingDetails(
                email: '[email protected]',
                phone: '+48888000888',
                address: Address(
                  city: 'Houston',
                  country: 'US',
                  line1: '1459  Circle Drive',
                  line2: '',
                  state: 'Texas',
                  postalCode: '77063',
                ),
              );

              final createPaymentMethod = await Stripe.instance
                  .createPaymentMethod(PaymentMethodParams.card(
                      setupFutureUsage: PaymentIntentsFutureUsage.OnSession,
                      billingDetails: billingDetails));

Exception:

Reloaded 3 of 2229 libraries in 2.865ms.
I/System.out(27603): HI
I/chatty  (27603): uid=11022 identical 2 lines
I/System.out(27603): HI
E/DartMessenger(27603): Uncaught exception in binary message listener
E/DartMessenger(27603): com.reactnativestripesdk.PaymentMethodCreateParamsException: Card details not complete
E/DartMessenger(27603): 	at com.reactnativestripesdk.StripeSdkModule.createPaymentMethod(StripeSdkModule.kt:340)
E/DartMessenger(27603): 	at com.flutter.stripe.StripeAndroidPlugin.onMethodCall(StripeAndroidPlugin.kt:49)
E/DartMessenger(27603): 	at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:233)
E/DartMessenger(27603): 	at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85)
E/DartMessenger(27603): 	at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:818)
E/DartMessenger(27603): 	at android.os.MessageQueue.nativePollOnce(Native Method)
E/DartMessenger(27603): 	at android.os.MessageQueue.next(MessageQueue.java:335)
E/DartMessenger(27603): 	at android.os.Looper.loop(Looper.java:183)
E/DartMessenger(27603): 	at android.app.ActivityThread.main(ActivityThread.java:7656)
E/DartMessenger(27603): 	at java.lang.reflect.Method.invoke(Native Method)
E/DartMessenger(27603): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
E/DartMessenger(27603): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
E/flutter (27603): [ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: MissingPluginException(No implementation found for method createPaymentMethod on channel flutter.stripe/payments)
E/flutter (27603): #0      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:156:7)
E/flutter (27603): <asynchronous suspension>
E/flutter (27603): #1      MethodChannel.invokeMapMethod (package:flutter/src/services/platform_channel.dart:358:43)
E/flutter (27603): <asynchronous suspension>
E/flutter (27603): #2      MethodChannelStripe.createPaymentMethod (package:stripe_platform_interface/src/method_channel_stripe.dart:53:20)
E/flutter (27603): <asynchronous suspension>
E/flutter (27603): #3      Stripe.createPaymentMethod (package:flutter_stripe/src/stripe.dart:118:29)
E/flutter (27603): <asynchronous suspension>
E/flutter (27603): #4      _PaymentScreenState.build.<anonymous closure>
E/flutter (27603): <asynchronous suspension>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.