You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- The Card field on Android has focus issues - it's being tracked in [#14](https://github.com/flutter-stripe/flutter_stripe/issues/14) and related to issues in the Flutter framework. If this is a
176
-
blocker for your project consider using the PaymentSheet alternative
175
+
- The Card field on Android has focus issues on older Flutter versions - it has been fixed by the Flutter framework in
176
+
the master branch. The issue is being tracked in [#14](https://github.com/flutter-stripe/flutter_stripe/issues/14).
> 🚨 flutter_stripe is in beta - please provide feedback (and/or contribute) if you find issues 💙️
8
10
11
+
9
12
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.
@@ -17,13 +22,19 @@ The Stripe Flutter SDK allows you to build delightful payment experiences in you
17
22
18
23
**Apple Pay**: We provide a [seamless integration with Apple Pay](https://stripe.com/docs/apple-pay).
19
24
25
+
**Google Pay**: The plugin can easily act as payment provider for the [Pay plugin](#Pay-Plugin-support) 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.
26
+
20
27
**Payment methods**: Accepting more [payment methods](https://stripe.com/docs/payments/payment-methods/overview) helps your business expand its global reach and improve checkout conversion.
21
28
22
29
**SCA-Ready**: The SDK automatically performs native [3D Secure authentication](https://stripe.com/docs/payments/3d-secure) if needed to comply with [Strong Customer Authentication](https://stripe.com/docs/strong-customer-authentication) regulation in Europe.
23
30
24
31
**Native UI**: We provide native screens and elements to securely collect payment details on Android and iOS.
25
32
26
-
**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.
33
+
**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.
34
+
35
+
#### Recommended usage
36
+
37
+
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](https://developer.apple.com/app-store/review/guidelines/#payments) and [Google's](https://support.google.com/googleplay/android-developer/answer/9858738?hl=en&ref_topic=9857752) guidelines for more information. For all other scenarios you can use this SDK to process payments via Stripe.
27
38
28
39
## Installation
29
40
@@ -35,7 +46,12 @@ dart pub add flutter_stripe
35
46
36
47
#### Android
37
48
38
-
Android 5.0 (API level 21) and above
49
+
- Android 5.0 (API level 21) and above
50
+
- Kotlin version 1.5.0 and above: [example](https://github.com/flutter-stripe/flutter_stripe/blob/79b201a2e9b827196d6a97bb41e1d0e526632a5a/example/android/build.gradle#L2)
51
+
- Using a descendant of `Theme.AppCompact` for your activity: [example](https://github.com/flutter-stripe/flutter_stripe/blob/384d390c8a90d19dc62c73faa5226fa931fd6d44/example/android/app/src/main/res/values/styles.xml#L15)
52
+
- Using `FlutterFragmentActivity` instead of `FlutterActivity` in `MainActivity.kt`: [example](https://github.com/flutter-stripe/flutter_stripe/blob/79b201a2e9b827196d6a97bb41e1d0e526632a5a/example/android/app/src/main/kotlin/com/flutter/stripe/example/MainActivity.kt#L6)
53
+
54
+
This is caused by the Stripe SDK requires the use of the AppCompact theme for their UI components and the Support Fragment Manager for the Payment Sheets
The example app offers examples on how to use these methods.
104
131
132
+
## Pay Plugin support
133
+
134
+
flutter_stripe fully supports the [Pay plugin](https://pub.dev/packages/pay) from the Google Pay team. By including a few lines you can integrate Stripe as a payment processor for Google / Apple Pay:
final response = await fetchPaymentIntentClientSecret();
139
+
final clientSecret = response['clientSecret'];
140
+
final token = paymentResult['paymentMethodData']['tokenizationData']['token'];
141
+
final tokenJson = Map.castFrom(json.decode(token));
142
+
143
+
final params = PaymentMethodParams.cardFromToken(
144
+
token: tokenJson['id'],
145
+
);
146
+
// Confirm Google pay payment method
147
+
await Stripe.instance.confirmPaymentMethod(
148
+
clientSecret,
149
+
params,
150
+
);
151
+
}
152
+
```
153
+
105
154
## Run the example app
106
155
156
+
- Navigate to the example folder `cd example`
107
157
- Install the dependencies
108
-
-`flutter pub get`
109
-
- Set up env vars for the flutter app and a local backend.
110
-
-[Get your test Stripe API keys](https://stripe.com/docs/keys)
111
-
-`cp lib/.env.dart lib/.env.dart` and set your Stripe publishable key.
112
-
-`cp server/.env.example server/.env` and set the variable values in your newly created `.env` file.
158
+
-`flutter pub get`
159
+
- Set up env vars for the flutter app and a local backend.
160
+
-[Get your test Stripe API keys](https://stripe.com/docs/keys)
161
+
-`cp lib/.env.example.dart lib/.env.dart` and set your Stripe publishable key.
162
+
-`cp server/.env.example server/.env` and set the variable values in your newly created `.env` file.
163
+
- Install the server dependencies: `yarn --cwd "server"`
113
164
- Start the example
114
-
- Terminal 1: `cd server && yarn example start:server`
115
-
- Terminal 2: `flutter run`
165
+
- Terminal 1: `yarn --cwd "server" start`
166
+
- Terminal 2: `flutter run`
116
167
117
168
##### Additional steps for webhook forwarding
118
169
@@ -121,5 +172,27 @@ The example app offers examples on how to use these methods.
121
172
122
173
## Known issues
123
174
124
-
- the Card field on Android has focus issues - it's being tracked in [#14](https://github.com/flutter-stripe/flutter_stripe/issues/14) and related to issues in the Flutter framework. If this is a
125
-
blocker for your project consider using the PaymentSheet alternative
175
+
- The Card field on Android has focus issues on older Flutter versions - it has been fixed by the Flutter framework in
176
+
the master branch. The issue is being tracked in [#14](https://github.com/flutter-stripe/flutter_stripe/issues/14).
177
+
178
+
## Contributing
179
+
180
+
You can help us make this project better, feel free to open an new issue or a pull request.
181
+
182
+
##### Setup
183
+
184
+
This project uses [melos](https://github.com/invertase/melos) to manage all the packages inside this repo.
185
+
186
+
- Install melos: `dart pub global activate melos`
187
+
- Setup melos in your local folder: `melos bootstrap`
188
+
189
+
##### Useful commands
190
+
191
+
- Format `melos run format`
192
+
- Analyze `melos run analyze`
193
+
- Test `melos run test`
194
+
- Pub get `melos run get`
195
+
196
+
##### Publishing
197
+
198
+
- Use `melos version` and `melos publish` to keep all the repositories in sync
0 commit comments