Flutter SDK for Stripe.

Overview

Flutter Stripe

pub package build

The Stripe Flutter SDK allows you to build delightful payment experiences in your native Android and iOS apps using Flutter. We provide powerful and customizable UI screens and elements that can be used out-of-the-box to collect your users' payment details.

stripe-flutter_cover

Features

Simplified Security: We make it simple for you to collect sensitive data such as credit card numbers and remain PCI compliant. This means the sensitive data is sent directly to Stripe instead of passing through your server. For more information, see our Integration Security Guide.

Apple Pay: We provide a seamless integration with Apple Pay.

Google Pay: The plugin can easily act as payment provider for the Pay plugin that enables you to seamlessly integrate Google Pay or Apple Pay. All you need to do is add your stripe publishable key to the payment profile.

Payment methods: Accepting more payment methods helps your business expand its global reach and improve checkout conversion.

SCA-Ready: The SDK automatically performs native 3D Secure authentication if needed to comply with Strong Customer Authentication regulation in Europe.

Native UI: We provide native screens and elements to securely collect payment details on Android and iOS.

Pre-built payments UI: Learn how to integrate Payment Sheet, the new pre-built payments UI for mobile apps. This pre-built UI lets you accept cards, Apple Pay, and Google Pay out of the box, and includes support for saving & reusing cards.

Recommended usage

If you're selling digital products or services within your app, (e.g. subscriptions, in-game currencies, game levels, access to premium content, or unlocking a full version), you must use the app store's in-app purchase APIs. See Apple's and Google's guidelines for more information. For all other scenarios you can use this SDK to process payments via Stripe.

Installation

dart pub add flutter_stripe

Requirements

Android

  • Android 5.0 (API level 21) and above
  • Kotlin version 1.5.0 and above: example
  • Using a descendant of Theme.AppCompat for your activity: example, example night theme
  • Using an up-to-date Android gradle build tools version: example and an up-to-date gradle version accordingly: example
  • Using FlutterFragmentActivity instead of FlutterActivity in MainActivity.kt: example

This is caused by the Stripe SDK requires the use of the AppCompat theme for their UI components and the Support Fragment Manager for the Payment Sheets

iOS

Compatible with apps targeting iOS 11 or above.

Usage example

// main.dart
import 'package:flutter_stripe/flutter_stripe.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();

  // set the publishable key for Stripe - this is mandatory
  Stripe.publishableKey = stripePublishableKey;
  runApp(PaymentScreen());
}

// payment_screen.dart
class PaymentScreen extends StatelessWidget {

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(),
      body: Column(
        children: [
          CardField(
            onCardChanged: (card) {
              print(card);
            },
          ),
          TextButton(
            onPressed: () async {
              // create payment method
              final paymentMethod =
                  await Stripe.instance.createPaymentMethod(PaymentMethodParams.card());
            },
            child: Text('pay'),
          )
        ],
      ),
    );
  }
}

Stripe initialization

To initialize Stripe in your Flutter app, use the Stripe base class.

Stripe offers publishableKey, stripeAccountId, threeDSecureParams and merchantIdentifier. Only publishableKey is required.

Dart API

The library offers several methods to handle stripe related actions:

Future<PaymentMethod> createPaymentMethod(...);
Future<PaymentIntent> handleCardAction(...);
Future<PaymentIntent> confirmPaymentMethod(...);
Future<void> configure3dSecure(...);
Future<bool> isApplePaySupported();
Future<void> presentApplePay(...);
Future<void> confirmApplePayPayment(...);
Future<SetupIntent> confirmSetupIntent(...);
Future<PaymentIntent> retrievePaymentIntent(...);
Future<String> createTokenForCVCUpdate(...);

Future<void> initPaymentSheet(...);
Future<void> presentPaymentSheet(...);
Future<void> confirmPaymentSheetPayment()

The example app offers examples on how to use these methods.

Pay Plugin support

flutter_stripe fully supports the Pay plugin from the Google Pay team. By including a few lines you can integrate Stripe as a payment processor for Google / Apple Pay:

Future<void> onGooglePayResult(paymentResult) async {
    final response = await fetchPaymentIntentClientSecret();
    final clientSecret = response['clientSecret'];
    final token = paymentResult['paymentMethodData']['tokenizationData']['token'];
    final tokenJson = Map.castFrom(json.decode(token));

    final params = PaymentMethodParams.cardFromToken(
      token: tokenJson['id'],
    );
    // Confirm Google pay payment method
    await Stripe.instance.confirmPaymentMethod(
      clientSecret,
      params,
    );
}

Run the example app

  • Navigate to the example folder cd example
  • Install the dependencies
    • flutter pub get
  • Set up env vars for the flutter app and a local backend.
    • Get your test Stripe API keys
    • cp lib/.env.example.dart lib/.env.dart and set your Stripe publishable key.
    • cp server/.env.example server/.env and set the variable values in your newly created .env file.
  • Install the server dependencies: yarn --cwd "server"
  • Start the example
    • Terminal 1: yarn --cwd "server" start
    • Terminal 2: flutter run
Additional steps for webhook forwarding

Contributing

You can help us make this project better, feel free to open an new issue or a pull request.

Setup

This project uses melos to manage all the packages inside this repo.

  • Install melos: dart pub global activate melos
  • Setup melos in your local folder: melos bootstrap
Useful commands
  • Format melos run format
  • Analyze melos run analyze
  • Test melos run test
  • Pub get melos run get
Publishing
  • Use melos version and melos publish to keep all the repositories in sync
Comments
  • Could not resolve com.stripe:stripe-android:20.12.+

    Could not resolve com.stripe:stripe-android:20.12.+

    • What went wrong: Execution failed for task ':app:checkDebugAarMetadata'.

    Could not resolve all files for configuration ':app:debugRuntimeClasspath'. Could not resolve com.stripe:stripe-android:20.12.+. Required by: project :app > project :stripe_android > Failed to list versions for com.stripe:stripe-android. > Unable to load Maven meta-data from https://jcenter.bintray.com/com/stripe/stripe-android/maven-metadata.xml. > Could not HEAD 'https://jcenter.bintray.com/com/stripe/stripe-android/maven-metadata.xml'. > Read timed out

    bug blocked 
    opened by ufukhawk 70
  • Focus issue with card view

    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

    blocked 
    opened by jonasbark 68
  • Web Support

    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

    • Currently we use https://pub.dev/packages/stripe_sdk for web.
    enhancement 
    opened by subinsv 57
  • PlatformException(flutter_stripe initialization failed, The plugin failed to initialize. Are you using FlutterFragmentActivity?

    PlatformException(flutter_stripe initialization failed, The plugin failed to initialize. Are you using FlutterFragmentActivity?

    I am trying to set up a payment using this plugin but can't able to initialize it. I followed the setup instruction for android but facing this issue.

    PlatformException(flutter_stripe initialization failed, The plugin failed to initialize. Are you using FlutterFragmentActivity?
    

    Initialization

    android/app/src/main/kotlin/com/example/myapp/MainActivity.kt

    import io.flutter.embedding.android.FlutterActivity
    import io.flutter.embedding.android.FlutterFragmentActivity
    class MainActivity: FlutterFragmentActivity() {
    }
    

    build.gradle

    ext.kotlin_version = '1.5.10'
    
     dependencies {
            classpath 'com.android.tools.build:gradle:4.1.1'
            classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        }
    

    Smartphone / tablet

    • Device: Samsung Galaxy A10
    • OS: Android 10
    • Package version: 1.0.2
    • Flutter version 2.0.6

    Is there any other implementation that I have missed?

    Android 
    opened by coder-Aayush 30
  •  iOS inAppBrowser

    iOS inAppBrowser "Return to Merchant" button does not return back with iDeal, Bancontact and FPX

    Describe the bug I tried paying with iDeal in the example app. The iOS can open the payment link in two ways:

    1. Opening safari as a different app
    2. Opening InAppBrowser

    After authorising the payment, the browser should redirect user to the app. This happens only when Safari is opened as a different app. The "Return to Merchant" button gives me this log every time I tap it: Deep Link does not contain valid required params. URL params: { "redirect_status" = succeeded; "setup_intent" = "<.....>"; "setup_intent_client_secret" = "<......>"; }

    To Reproduce Steps to reproduce the behavior:

    1. Download the example app
    2. Change the stripe publishable key
    3. Pay with iDeal
    4. The inAppBrowser is opened
    5. Authorise or decline the payment
    6. Back to merchant is "blocked". Does not take the user back to the app

    Expected behavior After the payment was authorised/declined, the inAppBrowser should open the app

    Smartphone / tablet

    • Device: Simulator iPhone 11 Pro Max

    • OS: 14.5

    • Package version: 2.0.2

    • Flutter version 2.5.2

    • Device: Simulator iPhone X

    • OS: 15.1

    • Package version: 2.0.2

    • Flutter version 2.5.2

    Additional context Here is a video of the issue: Uploading Simulator Screen Recording - iPhone 11 Pro Max - 2021-11-23 at 11.42.46.mp4…

    bug iOS blocked 
    opened by vladms 29
  • Throws Card details not complete

    Throws Card details not complete

    I am testing on an android device sometimes it works, but most of the time it gives this error StripeException(error: LocalizedErrorMessage(code: FailureCode.Failed, localizedMessage: Card details not complete, message: Card details not complete, stripeErrorCode: null, declineCode: null, type: null))

    and my payment method log

    PaymentMethod(id: pm_*************, livemode: false, type: Card, billingDetails: BillingDetails(email: null, address: Address(city: null, country: null, line1: null, line2: null, postalCode: null, state: null), phone: null, name: null), card: Card(brand: Visa, country: US, expYear: 2024, expMonth: 12, funding: credit, last4: 4242), sepaDebit: SepaDebit(country: null, bankCode: null, fingerprint: null, last4: null), bacsDebit: BacsDebit(sortCode: null, fingerprint: null, last4: null), auBecsDebit: AuBecsDebit(fingerprint: null, last4: null, bsbNumber: null), sofort: Sofort(country: null), ideal: Ideal(bankIdentifierCode: null, bank: null), fpx: Fpx(bank: null, accountHolderType: null), upi: Upi(vpa: null), customerId: null)

    also cvc and card number is printing null

    Awaiting response 
    opened by imrishuroy 28
  • Building for iOS Gives Error

    Building for iOS Gives Error

    platform :ios, '13.0'

    Flutter 2.10.3 • channel stable • https://github.com/flutter/flutter.git
    Framework • revision 7e9793dee1 (4 months ago) • 2022-03-02 11:23:12 -0600
    Engine • revision bd539267b4
    Tools • Dart 2.16.1 • DevTools 2.9.2
    
    

    Flutter Doctor

    Doctor summary (to see all details, run flutter doctor -v):
    [✓] Flutter (Channel stable, 2.10.3, on macOS 12.0.1 21A559 darwin-arm, locale
        en-AE)
    [✓] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
    [✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
    [✓] Chrome - develop for the web
    [✓] Android Studio (version 2020.3)
    [✓] VS Code (version 1.66.2)
    [✓] Connected device (3 available)
    [✓] HTTP Host Availability
    
    
    

    Below is the error:-

    Error output from Xcode build:
    ↳
        objc[14109]: Class AMSupportURLConnectionDelegate is implemented in both /usr/lib/libamsupport.dylib (0x1d9c77130) and /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x1087202c8). One of the two will be used. Which one is undefined.
        objc[14109]: Class AMSupportURLSession is implemented in both /usr/lib/libamsupport.dylib (0x1d9c77180) and /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x108720318). One of the two will be used. Which one is undefined.
        ** BUILD FAILED **
    
    
    Xcode's output:
    ↳
        Writing result bundle at path:
        	/var/folders/xy/gyvq1qyj0kbbhw07knmgjtvh0000gn/T/flutter_tools.ivCN1a/flutter_ios_build_temp_dirMZcqZG/temporary_xcresult_bundle
    
        ld: file not found: /Users/akshaylamba/Library/Developer/Xcode/DerivedData/Runner-hglmusdhznnwzkhgsbvagtqnbpfn/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/StripeCore.build/Objects-normal/x86_64/StripeFile.o
        clang: error: linker command failed with exit code 1 (use -v to see invocation)
        ld: file not found: /Users/akshaylamba/Library/Developer/Xcode/DerivedData/Runner-hglmusdhznnwzkhgsbvagtqnbpfn/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/StripeCore.build/Objects-normal/arm64/StripeFile.o
        clang: error: linker command failed with exit code 1 (use -v to see invocation)
        error: the following command failed with exit code 1 but produced no further output
        Ld /Users/akshaylamba/Library/Developer/Xcode/DerivedData/Runner-hglmusdhznnwzkhgsbvagtqnbpfn/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/StripeCore.build/Objects-normal/arm64/Binary/StripeCore normal arm64 (in target 'StripeCore' from project 'Pods')
        note: Using new build system
        note: Planning
        note: Build preparation complete
        note: Building targets in dependency order
        /Users/akshaylamba/Documents/Pasiv/PasivFinal/pasiv-lite/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 15.2.99. (in target 'abseil' from project 'Pods')
        /Users/akshaylamba/Documents/Pasiv/PasivFinal/pasiv-lite/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 15.2.99. (in target 'gRPC-C++' from project 'Pods')
        /Users/akshaylamba/Documents/Pasiv/PasivFinal/pasiv-lite/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 15.2.99. (in target 'Toast' from project 'Pods')
        /Users/akshaylamba/Documents/Pasiv/PasivFinal/pasiv-lite/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 15.2.99. (in target 'FMDB' from project 'Pods')
        /Users/akshaylamba/Documents/Pasiv/PasivFinal/pasiv-lite/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 15.2.99. (in target 'leveldb-library' from project 'Pods')
        /Users/akshaylamba/Documents/Pasiv/PasivFinal/pasiv-lite/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 15.2.99. (in target 'gRPC-C++-gRPCCertificates-Cpp' from project 'Pods')
        /Users/akshaylamba/Documents/Pasiv/PasivFinal/pasiv-lite/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 15.2.99. (in target 'gRPC-Core' from project 'Pods')
        /Users/akshaylamba/Documents/Pasiv/PasivFinal/pasiv-lite/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 15.2.99. (in target 'BoringSSL-GRPC' from project 'Pods')
    
        Result bundle written to path:
        	/var/folders/xy/gyvq1qyj0kbbhw07knmgjtvh0000gn/T/flutter_tools.ivCN1a/flutter_ios_build_temp_dirMZcqZG/temporary_xcresult_bundle
    
    
    Error (Xcode): File not found: /Users/akshaylamba/Library/Developer/Xcode/DerivedData/Runner-hglmusdhznnwzkhgsbvagtqnbpfn/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/StripeCore.build/Objects-normal/x86_64/StripeFile.o
    
    Error (Xcode): File not found: /Users/akshaylamba/Library/Developer/Xcode/DerivedData/Runner-hglmusdhznnwzkhgsbvagtqnbpfn/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/StripeCore.build/Objects-normal/arm64/StripeFile.o
    
    Could not build the application for the simulator.
    Error launching application on iPhone 12 mini.
    
    
    Awaiting response needs triage 
    opened by ADLsourceCode 27
  • Android CardField getting invalid card details

    Android CardField getting invalid card details

    Describe the bug While adding card details in CardField in android getting Invalid card details even it's correct on onCardChanged. Also not getting last4 it's returning null.

    Note : Same things working in iOS.

    CardFieldInputDetails(complete: true, last4: null, expiryMonth: 5, expiryYear: 23, postalCode: null, brand: null, number: null, cvc: null, validExpiryDate: CardValidationState.Valid, validCVC: CardValidationState.Valid, validNumber: CardValidationState.Valid)

    To Reproduce Steps to reproduce the behavior:

    1. Entering card number 4242424242424242 into the cardfield.
    2. Entering expiry date and cvc.
    3. It's getting error symbol on card icon.

    Expected behavior It should allow the card when all details are correct.

    Smartphone / tablet

    • Device: Android Emulator
    • OS: Android 11
    • Package version: flutter_stripe: ^3.2.0
    • Flutter version 3.0.2
    blocked 
    opened by 142hitesh 26
  • CardField onCardChanged(card) CardFieldInputDetails not correct when editing on Android and iOS

    CardField onCardChanged(card) CardFieldInputDetails not correct when editing on Android and iOS

    Describe the bug There's a couple of issues on both Android and iOS for the CardField's onCardChanged(card), which is causing issues for my error handling. The state of the CardFieldInputDetails complete, validExpiryDate, validCVC, and validNumber fields are not correct when editing the CardField widget.

    To Reproduce Steps to reproduce the behavior:

    • Issues depend on iOS or Android, although some issues are shared, so I'll separate them below:
    • Before each bullet point, pre-fill the CardField with a valid test card and follow the steps to reproduce.

    Android only

    • Start editing from the CVC text field and hit backspace once. When removing 1 digit from CVC on Android, the CardFieldInputDetails' complete field is still true. This is an issue because we use the card?.complete field to determine whether a user can proceed to pay.
    • Start editing from CVC and remove the CVC and expiration date. Remove 2 digits from card number and then re-add them in. Note the CardFieldInputDetails validNumber field is CardValidationState.Incomplete even though it is complete and we have focus on the expiration date text field. Pressing 1 digit into the expiration date textfield changes validNumber to CardValidationState.Valid but the timing is off here. This also occurs when re-adding the expiration date. It will focus on the CVC textfield, but the validExpiryDate field is still CardValidationState.Incomplete until you press 1 digit into the CVC text field.

    iOS only

    • Start editing from the CVC text field and remove the CVC and expiration date until you are editing the card number. Note that the CardFieldInputDetails validExpiryDate field is still CardValidationState.Valid even though it's empty and we're on the card number text field.

    Both Android and iOS

    • Start editing from the CVC text field and press backspace 3 times to completely remove the CVC. Press backspace 1 more time to remove 1 digit from the expiration date and note that the CardFieldInputDetails validExpiryDate is still CardValidationState.Valid. This also happens when we remove the expiration date, press backspace 1 more time to remove 1 digit from the credit card number, and the validNumber field is still CardValidationState.Valid.

    Expected behavior I expect the CardFieldInputDetails that's passed back from onCardChanged(card) to return correct states for complete, validExpiryDate, validCVC, and validNumber fields when editing the card information.

    Smartphone / tablet

    • Device: [e.g. iPhone 13, Android Pixel 4 XL]
    • OS: [e.g. iOS 13, Android 11]
    • Package version: [e.g. 3.1.0]
    • Flutter version [e.g. 2.10.5.]

    Additional context I can provide GIFs of these examples if that would help. Just let me know. Not sure if providing the code I tested on is helpful since it's pretty bare-boned, but here it is:

    class StripeCardFieldPlaygroundPage extends HookWidget {
      @override
      Widget build(BuildContext context) {
        final controller = CardEditController();
        final controllerDetails = useState('');
        final formKey = useMemoized(() => GlobalKey<FormState>());
    
        return Scaffold(
          appBar: AppBar(
            leading: Semantics(
              label: 'Back',
              child: IconButton(
                icon: Image.asset(
                  'assets/back.png',
                  color: Theme.of(context).iconTheme.color,
                ),
                onPressed: () => context.popRoute(),
              ),
            ),
            title: const Text('Stripe Playground'),
          ),
          body: Form(
            key: formKey,
            child: Padding(
              padding: const EdgeInsets.all(24.0),
              child: Column(
                mainAxisAlignment: MainAxisAlignment.center,
                children: [
                  CardField(
                    autofocus: true,
                    controller: controller,
                    cursorColor: Colors.black.withOpacity(0.5),
                    onCardChanged: (card) {
                      // if (card?.complete ?? false) {
                      //   FocusScope.of(context).unfocus();
                      // }
                      controllerDetails.value = '''
                        Card complete: ${card?.complete}
                        last4: ${card?.last4}
                        expiryMonth: ${card?.expiryMonth}
                        expiryYear: ${card?.expiryYear}
                        postalCode: ${card?.postalCode}
                        brand: ${card?.brand}
                        number: ${card?.number}
                        cvc: ${card?.cvc}
    
                        validExpiryDate: ${card?.validExpiryDate.name}
                        validCVC: ${card?.validCVC.name}
                        validNumber: ${card?.validNumber.name}
                      ''';
                    },
                  ),
                  Text(controllerDetails.value),
                  TextButton(
                    onPressed: () {
                      formKey.currentState!.validate();
                    },
                    child: const Text('Validate CardField'),
                  )
                ],
              ),
            ),
          ),
        );
      }
    }
    
    needs triage 
    opened by samleecampspot 24
  • Flutter Web Stripe.instance.createPaymentMethod Issue

    Flutter Web Stripe.instance.createPaymentMethod Issue

    When I execute this:

    final paymentMethod = await Stripe.instance.createPaymentMethod(PaymentMethodParams.card( paymentMethodData: PaymentMethodData(billingDetails: billingDetails, shippingDetails: shippingDetails), ));

    I receive an Unimplemented Error

    Where:

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

      final shippingDetails = ShippingDetails(
        phone: '+48888000888',
        address: Address(
          city: 'Houston',
          country: 'US',
          line1: '1459  Circle Drive',
          line2: '',
          state: 'Texas',
          postalCode: '77063',
        ),
      );
    

    Error comes from:

    web_stripe.dart

    @override Future createPaymentMethod( PaymentMethodParams data, [ Map<String, String> options = const {}, ]) async { final type = data.toJson()['type']; switch (type) { case 'Card': return createCardPaymentMethod(data, options); case 'Alipay': return createCardPaymentMethod(data, options); }

    throw UnimplementedError();
    

    }

    The issue is that data.toJson()['type'];is null. . Running on VSCode, WIndows

    flutter_stripe: ^3.0.2 flutter_stripe_web: ^1.0.2

    web 
    opened by glennarixxi 24
  • Activity doesn't exist yet. You can safely retry this method.

    Activity doesn't exist yet. You can safely retry this method.

    Describe the bug After updating version "3.1.0", getting below error.

    Error: StripeException(error: LocalizedErrorMessage(code: FailureCode.Failed, localizedMessage: null, message: Activity doesn't exist yet. You can safely retry this method., stripeErrorCode: null, declineCode: null, type: null))

    To Reproduce Steps to reproduce the behavior:

    1. Update stripe version
    2. Create payment method
    3. On confirm payment
    4. Getting error: Error: StripeException(error: LocalizedErrorMessage(code: FailureCode.Failed, localizedMessage: null, message: Activity doesn't exist yet. You can safely retry this method., stripeErrorCode: null, declineCode: null, type: null))

    Expected behavior It should works as it's work previously.

    Smartphone / tablet

    • Device: [Android emulator]
    • OS: [Android 10]
    • Package version: [3.1.0]
    • Flutter version [3.0.0.]
    bug Android 
    opened by ShwetaChauhan18 23
  • feat: tokens for web

    feat: tokens for web

    • Adds support for creating card, bank account and pii tokens for web

    https://user-images.githubusercontent.com/19904063/211151355-118bd45c-265e-449d-bf22-a4ce7c9481ee.mov

    Closes https://github.com/flutter-stripe/flutter_stripe/issues/956

    opened by jamesblasco 0
  • bug: cannot add web verison

    bug: cannot add web verison

    I'm using both the latest, as the documentation doesn't tell us what to use.

      flutter_stripe: ^7.0.0
      flutter_stripe_web: ^2.1.0
    

    Because flutter_stripe_web >=2.0.0 depends on stripe_platform_interface ^6.0.0 and flutter_stripe 7.0.0 depends on stripe_platform_interface ^7.0.0, flutter_stripe_web >=2.0.0 is incompatible with flutter_stripe 7.0.0. And because no versions of flutter_stripe match >7.0.0 <8.0.0, flutter_stripe_web >=2.0.0 is incompatible with flutter_stripe ^7.0.0. So, because vegiano depends on both flutter_stripe ^7.0.0 and flutter_stripe_web ^2.1.0, version solving failed. pub get failed (1; So, because vegiano depends on both flutter_stripe ^7.0.0 and flutter_stripe_web ^2.1.0, version solving failed.) exit code 1

    needs triage 
    opened by ollydixon 0
  • Stripe Connect

    Stripe Connect

    Hi, I am using flutter_stripe module in one of my project. I need to use Stripe connect to charge a fee. Does your module support Stripe connect? If so can you provide an example how to use it? If not will you consider adding Stripe connect to your module.

    Thanks

    needs triage 
    opened by ruhul080 1
  • Allow specifying returnUrl in iDEAL Sdk's webview flow

    Allow specifying returnUrl in iDEAL Sdk's webview flow

    Currently, you can only specify a returnUrl for iDEAL if you are using the payment sheet:

    https://github.com/flutter-stripe/flutter_stripe/blob/4d47412fe49353c955c9ecabe9b1875e4ebc3fbe/packages/stripe_platform_interface/lib/src/models/payment_sheet.freezed.dart#L85

    If you are using the sdk's webview you don't have any option to specify a returnUrl. So, in iOS we are forced to use custom URL scheme instead of being able to use universal links.

    https://github.com/flutter-stripe/flutter_stripe/blob/4d47412fe49353c955c9ecabe9b1875e4ebc3fbe/packages/stripe_ios/ios/Classes/Stripe%20Sdk/Mappers.swift#L746-L748

    Also for web, returnUrl is still hardcoded to window.location.href, so it always redirects to the last page the user was.

    https://github.com/flutter-stripe/flutter_stripe/blob/4d47412fe49353c955c9ecabe9b1875e4ebc3fbe/packages/stripe_web/lib/src/web_stripe.dart#L153

    Would it be possible to expose returnUrl in confirmPayment() method so that we can use universal links in iOS and have more flexibility in web?


    My current hacky workaround to be able to use universal links in iOS:

    Instead of using setting my custom schema in Stripe.urlScheme, I use Stripe.urlScheme = 'https://myapp.com/payment/callback?schema='. So when the SDK maps it, instead of being com.myapp://safepay, it becomes https://myapp.com/payment/callback?schema=%3A%2F%2Fsafepay. Eg.:

    https://myapp.com/payment/callback?payment_intent=pi_xxxxxxxxxWIG37j61caLvTcd&payment_intent_client_secret=pi_xxxxxxcaLvTcd_secret_iycU5xxxxxx0Zq5YwcA0&redirect_status=succeeded&schema=%3A%2F%2Fsafepay
    

    In this way, the SDK can still read the parameters from Stripe, and my router can still route the user to the right screen using the universal link.

    needs triage 
    opened by davidmigloz 0
  • CardField is constantly redrawing causing animation lag

    CardField is constantly redrawing causing animation lag

    Describe the bug I integrated Stripe into my app and use the Webhook payment method. Once I got clientSecret from the backend I call Stripe.instance.confirmPayment and display simple animation but the animation lags because CardField constantly redraws wasting processor time (my understanding is that both Android native view renders in the main thread and Flutter also use the same thread what actually cause lags). I looked through the Android code and found that the requestLayout method is called infinitely times (possibly Android Framework calls it). From the Android documentation "If either [requestLayout()](requestLayout or invalidate) were called, the framework will take care of measuring, laying out, and drawing the tree as appropriate" [https://developer.android.com/reference/android/view/View#event-handling-and-threading](Android doc).

    I added simple logging to prove it:

    ` var i = 0

    override fun requestLayout() { Log.d(this.javaClass.canonicalName, "requestLayout ${i++}") super.requestLayout() post(mLayoutRunnable) }`

    And here is what I got image

    https://user-images.githubusercontent.com/31043679/209629865-2ecad273-a032-4f86-84f4-34eb67ace78f.mp4

    Could you fix the issue because it impacts flutter animation, please?

    To Reproduce

    1. Add logging into the CardFieldView.kt file (requestLayout method)
    2. Open the Webhook payment screen in the example app
    3. Observe how many times CardFieldView redraws

    Expected behavior CardFieldView should be redrawn only if needed

    Smartphone / tablet

    • Device: ZTE blade a51, Huawei P Smart plus
    • OS: [Android 11, Android 9]
    • Package version: [7.0.0]
    • Flutter version [3.3.10]
    needs triage 
    opened by romawizard 0
  • Incorrect iOS build version in documentation

    Incorrect iOS build version in documentation

    Describe the bug Documentation for iOS says the minimum iOS version is 12.0. The minimum version is actually 13.0.

    To Reproduce Steps to reproduce the behavior:

    1. Try updating pods with minimum iOS version set to 12.0
    2. See the error:
    [!] 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.
    

    Expected behavior The pods should update.

    Package info

    • OS: iOS
    • Package version: 7.0.0
    • Flutter version 3.3.10

    Additional context See this line for the current minimum iOS version. It appears to have been updated in this commit just over a month ago.

    documentation 
    opened by jaween 2
Releases(7.0.0)
  • 7.0.0(Nov 17, 2022)

    7.0.0

    Breaking Changes

    • This library now supports iOS 13 and up, due to stripe-ios increasing the deployment target

    Features

    • Added Link support in Payment Sheet.
    • Added the resetPaymentSheetCustomer method to clear persisted authentication state in the PaymentSheet.
    • Added preferredNetwork and availableNetworks fields to the CardResult payment method.
    • Added support for custom fonts to CardForm and CardView on Android.
    • Added support for customizing the call to action button label in Payment Sheet by providing the primaryButtonLabel property to initPaymentSheet().

    Fixes

    • Several fixes by the Stripe sdk v.0.20.0.
    Source code(tar.gz)
    Source code(zip)
  • 5.0.0(Sep 4, 2022)

    Breaking changes

    • Your compileSdkVersion (in android/build.gradle) now must be at least 32. Changing your compileSdkVersion does not change runtime behavior.

    Features

    • Added support for pay_dark and standard_dark to the GooglePayButton component. This allows you to display the dark Google Pay button.
    • Added support for borderColor, borderRadius, and cursorColor to CardForm's cardStyle prop on iOS (already exists on Android).
    • Added the collectBankAccountToken & collectFinancialConnectionsAccounts functions.
    • confirmPayment can now be called with just a client secret (e.g. await confirmPayment("payment-intent-id")), in other words the payment method can be excluded. If the payment method is excluded, it is assumed by the SDK that you have attached the payment method on the server-side during payment intent creation.
    • Payment Sheet now supports Link on iOS. #1086.

    Other changes

    • Several fixes by the Stripe sdk v.0.16.0.
    • Several fixes by the Stripe sdk v.0.17.0.
    • Several fixes by the Stripe sdk v.0.18.0.
    Source code(tar.gz)
    Source code(zip)
  • 4.0.0(Jul 22, 2022)

    4.0.0

    ** Breaking changes **

    • Added support for iOS 15 paymentSummaryItems: PKDeferredPaymentSummaryItem and PKRecurringPaymentSummaryItem. Adding a summary item before was:
     ApplePayCartSummaryItem(
        label: 'Product Test',
        amount: '0.01',
    );
    

    Becomes

    ApplePayCartSummaryItem.immediate(
      label: 'Product Test',
      amount: '0.01',
    );
    
    • Changed paymentsheet parameters to make it more clear which settings are used for Google Pay and Apple Pay. Changes: merchantCountryCode is now moved into both PaymentSheetApplePayand PaymentSheetGooglePay, currencyCode and testEnv is now part of the PaymentSheetGooglePay object.

    • Added possibility to add ApplePayCartSummaryItem to the paymensheet.

    Other changes

    • Support for affirm payment method.
    • Several fixes by the Stripe sdk v.0.15.0.
    Source code(tar.gz)
    Source code(zip)
  • 3.3.0(Jul 11, 2022)

    What's Changed

    • Added the canAddCardToWallet method.
    • Several fixes by the Stripe sdk v.0.14.0.

    Full Changelog: https://github.com/flutter-stripe/flutter_stripe/compare/3.2.0...3.3.0

    Source code(tar.gz)
    Source code(zip)
  • 3.2.0(Jun 30, 2022)

  • 3.1.0(Jun 30, 2022)

    • Added styling parameters for the payment sheet.
    • Better error logging for Google Pay.
    • Fix #462 Not returning back when using in app browser.
    • Fix bug that threw not implemented exception in the nextCardAction method when using 3d Secure.
    • Make Flutter Stripe backwards compatible with Flutter v2.
    • Fix #731 Styling for the Cardform field.
    • Several fixes by the Stripe sdk v.0.10.0, v.0.11.0 and v.0.12.0 .
    Source code(tar.gz)
    Source code(zip)
  • 3.0.0(Jun 30, 2022)

    ** Breaking changes **

    • Support for Flutter 3 and support Dart sdk 2.16 and higher.
    • Only supports application running on Freezed v2.0.0 and higher
    • Changed parameter structure for createPaymentMethod, confirmPayment, confirmSetupIntent in line with latest changes of the Stripe SDK. For example
     Stripe.instance.confirmPayment(
            clientSecret,
            PaymentMethodParams.ideal(
            	bankName:   'revolut',
            ),
          );
    

    Becomes

     Stripe.instance.confirmPayment(
            clientSecret,
            PaymentMethodParams.ideal(
              paymentMethodData:
                  PaymentMethodDataIdeal( 'revolut'),
            ),
          );
    
    • Change styling parameter structure for Cardformfield in order to support more styling options.

    Other changes

    • Support for paypal (accessible in private beta on Stripe)
    • Several fixes by the Stripe sdk v.0.8.0 and v.0.9.0
    Source code(tar.gz)
    Source code(zip)
  • v2.5.0(Apr 26, 2022)

    • BREAKING CHANGE: Mostly fixes and changes to types, but some method's now accept slightly different parameters:
      • Removed setUrlSchemeOnAndroid in favor of setReturnUrlSchemeOnAndroid. setReturnUrlSchemeOnAndroid functions exactly the same, this is just a rename.
      • Removed handleCardAction in favor of handleNextAction. handleNextAction functions exactly the same, this is just a rename.
    • BREAKING: This library now supports iOS 12 and up, due to stripe-ios increasing the deployment target.
      • To upgrade your iOS deployment target to 12.0, you can either do so in Xcode under your Build Settings, or by modifying IPHONEOS_DEPLOYMENT_TARGET in your project.pbxproj directly. You will also need to update your Podfile to target :ios, '12.0'.
    • Feat: add card ID and bankAccount ID to token response
    • Feat: Add support for ACHv2
    • Feat: Add support for setting a card's currency when creating a Token
    • Feat: Added support for placeholderColor, textErrorColor , borderColor, borderRadius, and borderWidth for AuBECSDebitForm on iOS
    • Several fixes by the Stripe sdk v0.7.0
    • Updated freezed dependency to allow 2.x
    Source code(tar.gz)
    Source code(zip)
  • 2.4.0(Mar 22, 2022)

    • Add support for paying with Klarna.
    • Several fixes by the Stripe sdk v0.4.0
    • Fix #632 added return_url to payment sheet. Needed for Ideal payments
    • Fix #185 make sure that address will be added to the payment intent.
    Source code(tar.gz)
    Source code(zip)
  • 2.3.0(Mar 2, 2022)

  • 2.2.0(Feb 14, 2022)

    • Add currency code to the Paymentsheet
    • Add validation state to cardfield
    • Deprecated CreatetokenParams use CreateTokenParams.card instead
    • Several fixes by the Stripe sdk v0.2.4
    • Fix #416 ocassional crash on Android on the Paymentsheetfragment
    Source code(tar.gz)
    Source code(zip)
  • 2.0.2(Nov 29, 2021)

  • 2.0.1(Nov 29, 2021)

  • 2.0.0(Nov 29, 2021)

    First stable release

    Breaking changes

    • Temporarily disable Wechat

    Other changes

    • add openApplePaySetup method
    • several fixes by Stripe SDK (v0.2.1, v0.2.2)
    • Focus issues on Android #14 are fixed
    Source code(tar.gz)
    Source code(zip)
  • v.1.3.0(Sep 6, 2021)

    BREAKING CHANGES

    • Deprecate redundant parameters for payment sheet.

    Other changes

    • Add new multiline card form.
    • Add Stripe Google pay integration.
    • Add WeChat payment method.
    • Improved example app.
    Source code(tar.gz)
    Source code(zip)
  • 1.2.0(Jul 28, 2021)

    Breaking changes

    • Rename confirmPaymentMethod to confirmPayment accordingly with the change in the native SDK

    Other changes

    • Sync with latest Stripe sdk.
    • Add StripeException that encapsulates finer grained and localized error messaging coming from the Stripe SDK.
    • Add CardEditController to handle the clear, focus, blur methods from the cardfield.
    • Implement FontFamily on iOS.
    • Add dangerouslyUpdateCardDetails to allow custom UIs. (Please be sure to understand the severe implications of this approach here).
    Source code(tar.gz)
    Source code(zip)
  • 1.1.0(Jul 28, 2021)

    Breaking changes

    • Make paymentIntentClientSecret nullable for SetupPaymentSheetParameters and add setupIntentClientSecret.
    • Rename ThreeDSecureSubmitButtonThemeData to ThreeDSecureButtonThemeData in order to facilitate for a generic class to customise 3D secure buttons.

    Other changes

    • Sync with latest Stripe sdk.
    • Fix #147 add urlscheme to initialise method. Thanks to @dariuspo.
    • Improved focus behavior on Cardfield.
    • Add dangerouslyGetFullCardDetails and FontFamily to cardfield.
    • Better debug logging in case something goes wrong.
    Source code(tar.gz)
    Source code(zip)
  • 1.0.2(Jun 7, 2021)

  • v1.0.0+3(May 12, 2021)

Stream Feed official Flutter SDK. Build your own feed experience using Dart and Flutter.

Official Flutter packages for Stream Activity Feeds The official Dart client for Stream Activity Feeds, a service for building activity feed applicati

Stream 67 Sep 26, 2022
Pensil Community official Flutter SDK. Build your own community experience using Dart and Flutter.

Official flutter package for Pensil The official Dart client for Pensil communities, a service for building communites applications. This library can

Pensil Inc 6 Oct 6, 2022
A Flutter plugin for the Google Mobile Ads SDK

A Flutter plugin for the Google Mobile Ads SDK

Google Ads 251 Jan 2, 2023
P2P payment solution using Stream's Flutter SDK and Rapyd's Wallet API

Peer-to-peer payment integration to a messaging app using Flutter ?? This project shows how to integrate a peer-to-peer payment solution to your Strea

Souvik Biswas 15 Dec 8, 2022
Official plugin for using Thepeer SDK with flutter https://thepeer.co

Flutter Thepeer This package makes it easy to use the Thepeer in a flutter project. ?? Screen Shots ?? How to Use plugin ThePeer Send Launch ThepeerSe

The Peer 23 Dec 27, 2022
Hybrid App build on flutter SDK able to run on Android, IOS, web, desktop

Codeforces Visualizer APP Ready to use Flutter Application. Uses codeforces API. Useful for codeforces programmers. ScreenShots Single User Page Compa

vikas yadav 13 Dec 31, 2022
A simple chat app UI using flutter SDK project.

Chatty App A simple chat app UI using flutter SDK project. Screenshot Getting Started This project is a starting point for a Flutter application. A fe

Tengku Belmiro 5 Jul 15, 2022
A Flutter plugin that supports Pangle SDK on Android and iOS.

Thanks for non-commercial open source development authorization by JetBrains. 穿山甲 Flutter SDK `pangle_flutter`是一款集成了字节跳动穿山甲 Android 和 iOS SDK的 Flutter

null 121 Dec 2, 2022
Cross platform application for iOS and Android using Google's SDK Flutter.

scout Cross platform application for iOS and Android using Google's SDK Flutter. Launch screen for the application. The menu for selecting cookies. Cu

null 0 Nov 9, 2021
Official Flutter SDK for Khalti Payment systems

Khalti Payment Gateway for Flutter Use Khalti Payment Gateway solution in your app or website to simplify payment for your customers. You do not need

Khalti 16 Oct 13, 2022
This project is the HERE SDK reference application for Flutter

HERE SDK Reference Application for Flutter The reference application for the HERE SDK for Flutter (Navigate Edition) shows how a complex and release-r

HERE Technologies 32 Dec 15, 2022
A Social App Built Using FLutter SDK.

Hi ?? , I'm Faheem ??‍?? A Social App Built Using FLutter SDK. The main objective of this application is to provide a single platform for the Students

Faheem Ahmad 26 Nov 10, 2022
Flutter Video Conferencing SDK & Sample App

100ms Flutter SDK ?? Here you will find everything you need to build experiences with video using 100ms iOS/Android SDK. Dive into our SDKs, quick sta

100ms 79 Dec 22, 2022
Real-world movie database mobile application with the Flutter SDK and DDD clean architecture.

Moving Pictures Moving Pictures is a mobile application built with the Flutter SDK for Android and iOS. It’s an application that gets the information

Nifemi 57 Jan 7, 2023
Sample app to demonstrate the integration and working of Dyte SDK for mobile, using Flutter.

Flutter Sample App by dyte Sample App to demonstrate Dyte SDK in flutter Explore the docs » View Demo · Report Bug · Request Feature Table of Contents

Dyte 12 Jan 1, 2023
A Flutter plugin for Yandex AppMetrica SDK, a marketing platform for app install attribution, app analytics, and push campaigns.

appmetrica_sdk A Flutter plugin for Yandex AppMetrica SDK. Plugin implementation status Implemented Events Profiles Not implemented yet Revenue. Comin

EM ALL iT Studio 15 Oct 21, 2021
Quickstart guide for the Agora Flutter SDK(Android/iOS)

Agora Flutter Quickstart This tutorial describes how to create an Agora account and build a sample app with Agora using Flutter. Other Languages: 简体中文

Agora.io Community 501 Dec 30, 2022
Official plugin for using Thepeer SDK with flutter https://thepeer.co

Flutter Thepeer This package makes it easy to use the Thepeer in a flutter project. ?? Screen Shots ?? How to Use plugin Adding MaterialSupport Add th

Thepeer 23 Dec 27, 2022
GrowthBook SDK for flutter

GrowthBook SDK for flutter. Overview GrowthBook is an open source feature flagging and experimentation platform that makes it easy to adjust what feat

Alippo 8 Dec 15, 2022