Skip to content

Commit d84a811

Browse files
authored
docs: improve readme (flutter-stripe#539)
* docs: improve readme * fix: typo * fix: update readme
1 parent 458ae0b commit d84a811

File tree

4 files changed

+46
-19
lines changed

4 files changed

+46
-19
lines changed

README.md

+26-7
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,19 @@ dart pub add flutter_stripe
4343

4444
#### Android
4545

46-
- Android 5.0 (API level 21) and above
47-
- Kotlin version 1.5.0 and above: [example](https://github.com/flutter-stripe/flutter_stripe/blob/79b201a2e9b827196d6a97bb41e1d0e526632a5a/example/android/build.gradle#L2)
48-
- Using a descendant of `Theme.AppCompat` for your activity: [example](https://github.com/flutter-stripe/flutter_stripe/blob/main/example/android/app/src/main/res/values/styles.xml#L15), [example night theme](https://github.com/flutter-stripe/flutter_stripe/blob/main/example/android/app/src/main/res/values-night/styles.xml#L16)
49-
- Using an up-to-date Android gradle build tools version: [example](https://github.com/flutter-stripe/flutter_stripe/blob/main/example/android/build.gradle#L9) and an up-to-date gradle version accordingly: [example](https://github.com/flutter-stripe/flutter_stripe/blob/main/example/android/gradle/wrapper/gradle-wrapper.properties#L6)
50-
- 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)
5146

52-
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
47+
This plugin requires several changes to be able to work on Android devices. Please make sure you follow all these steps:
48+
49+
1. Use Android 5.0 (API level 21) and above
50+
2. Use Kotlin version 1.5.0 and above: [example](https://github.com/flutter-stripe/flutter_stripe/blob/79b201a2e9b827196d6a97bb41e1d0e526632a5a/example/android/build.gradle#L2)
51+
3. Using a descendant of `Theme.AppCompat` for your activity: [example](https://github.com/flutter-stripe/flutter_stripe/main/example/android/app/src/main/res/values/styles.xml#L15), [example night theme](https://github.com/flutter-stripe/flutter_stripe/blob/main/example/android/app/src/main/res/values-night/styles.xml#L16)
52+
4. Using an up-to-date Android gradle build tools version: [example](https://github.com/flutter-stripe/flutter_stripe/blob/main/example/android/build.gradle#L9) and an up-to-date gradle version accordingly: [example](https://github.com/flutter-stripe/flutter_stripe/blob/main/example/android/gradle/wrapper/gradle-wrapper.properties#L6)
53+
5. 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)
54+
6. Rebuild the app, as the above changes don't update with hot reload
55+
56+
These changes are needed because the Android Stripe SDK requires the use of the AppCompat theme for their UI components and the Support Fragment Manager for the Payment Sheets
57+
58+
If you are having troubles to make this package to work on Android, join [this discussion](https://github.com/flutter-stripe/flutter_stripe/discussions/538) to get some support
5359

5460
#### iOS
5561

@@ -61,8 +67,21 @@ Now you can use Stripe with Flutter web! Notice right now it is highly experimen
6167

6268
Check the steps needed [here](https://github.com/flutter-stripe/flutter_stripe/tree/main/packages/stripe_web)
6369

70+
## Usage
71+
72+
The library provides three UI componets for accepting card payments: the `CardField`, `CardForm`, and the `Paymentsheet`.
73+
74+
We recommend using the `PaymentSheet` for the most easy and smooth Stripe integration. It provides out of the box support for:
75+
- Localized labels and error messages to the users
76+
- Build-in animations
77+
- Build-in Google Pay and Apple Pay buttons
78+
- Handling 3D-secure
79+
80+
Notice that `PaymentSheet` is only available for Android and iOS.
81+
82+
On the other side the `CardField` allows you to create a more customizable payment flow inside your app.
6483

65-
## Usage example
84+
### Example
6685

6786
```dart
6887
// main.dart

packages/stripe/README.md

+17-11
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,18 @@ dart pub add flutter_stripe
4343

4444
#### Android
4545

46-
- Android 5.0 (API level 21) and above
47-
- Kotlin version 1.5.0 and above: [example](https://github.com/flutter-stripe/flutter_stripe/blob/79b201a2e9b827196d6a97bb41e1d0e526632a5a/example/android/build.gradle#L2)
48-
- Using a descendant of `Theme.AppCompat` for your activity: [example](https://github.com/flutter-stripe/flutter_stripe/main/example/android/app/src/main/res/values/styles.xml#L15), [example night theme](https://github.com/flutter-stripe/flutter_stripe/blob/main/example/android/app/src/main/res/values-night/styles.xml#L16)
49-
- Using an up-to-date Android gradle build tools version: [example](https://github.com/flutter-stripe/flutter_stripe/blob/main/example/android/build.gradle#L9) and an up-to-date gradle version accordingly: [example](https://github.com/flutter-stripe/flutter_stripe/blob/main/example/android/gradle/wrapper/gradle-wrapper.properties#L6)
50-
- 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)
46+
This plugin requires several changes to be able to work on Android devices. Please make sure you follow all these steps:
5147

52-
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
48+
1. Use Android 5.0 (API level 21) and above
49+
2. Use Kotlin version 1.5.0 and above: [example](https://github.com/flutter-stripe/flutter_stripe/blob/79b201a2e9b827196d6a97bb41e1d0e526632a5a/example/android/build.gradle#L2)
50+
3. Using a descendant of `Theme.AppCompat` for your activity: [example](https://github.com/flutter-stripe/flutter_stripe/main/example/android/app/src/main/res/values/styles.xml#L15), [example night theme](https://github.com/flutter-stripe/flutter_stripe/blob/main/example/android/app/src/main/res/values-night/styles.xml#L16)
51+
4. Using an up-to-date Android gradle build tools version: [example](https://github.com/flutter-stripe/flutter_stripe/blob/main/example/android/build.gradle#L9) and an up-to-date gradle version accordingly: [example](https://github.com/flutter-stripe/flutter_stripe/blob/main/example/android/gradle/wrapper/gradle-wrapper.properties#L6)
52+
5. 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+
6. Rebuild the app, as the above changes don't update with hot reload
54+
55+
These changes are needed because the Android Stripe SDK requires the use of the AppCompat theme for their UI components and the Support Fragment Manager for the Payment Sheets
56+
57+
If you are having troubles to make this package to work on Android, join [this discussion](https://github.com/flutter-stripe/flutter_stripe/discussions/538) to get some support
5358

5459
#### iOS
5560

@@ -61,18 +66,19 @@ Now you can use Stripe with Flutter web! Notice right now it is highly experimen
6166

6267
Check the steps needed [here](https://github.com/flutter-stripe/flutter_stripe/tree/main/packages/stripe_web)
6368

64-
6569
## Usage
6670

67-
The library supports 2 ways of payment namely the `CardField` and the `Paymentsheet`. The `CardField` has the most configurable options but it has some issues on Android: https://github.com/flutter/flutter/issues/86480 .
71+
The library provides three UI componets for accepting card payments: the `CardField`, `CardForm`, and the `Paymentsheet`.
6872

69-
Furthermore the `PaymentSheet` has a more easy and out of the box integration:
73+
We recommend using the `PaymentSheet` for the most easy and smooth Stripe integration. It provides out of the box support for:
7074
- Localized labels and error messages to the users
7175
- Build-in animations
7276
- Build-in Google Pay and Apple Pay buttons
73-
- Handling 3D-secure
77+
- Handling 3D-secure
78+
79+
Notice that `PaymentSheet` is only available for Android and iOS.
7480

75-
We recommend using the `PaymentSheet` for the most easy and smooth Stripe integration.
81+
On the other side the `CardField` allows you to create a more customizable payment flow inside your app.
7682

7783
### Example
7884

packages/stripe_android/android/src/main/kotlin/com/flutter/stripe/StripeAndroidPlugin.kt

+2-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ class StripeAndroidPlugin : FlutterPlugin, MethodCallHandler, ActivityAware {
7272
"flutter_stripe initialization failed",
7373
"""The plugin failed to initialize:
7474
${initializationError}
75-
Please check the README: https://github.com/flutter-stripe/flutter_stripe#android""",
75+
Please make sure you follow all the steps detailed inside the README: https://github.com/flutter-stripe/flutter_stripe#android
76+
If you continue to have trouble, follow this discussion to get some support https://github.com/flutter-stripe/flutter_stripe/discussions/538""",
7677
null
7778
)
7879
return

tools/clone_readme.sh

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
cp 'README.md' "packages/stripe/README.md"

0 commit comments

Comments
 (0)