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
* fix broken index file
* doc: clarify status of cardfield
* fix add documentation for apple pay
* fix links in the readme
* doc: updated payment element screens
* doc: update the docs for paymentsheet
---------
Co-authored-by: jonasbark <jonas.bark@gmx.de>
Copy file name to clipboardExpand all lines: README.md
+7-5Lines changed: 7 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -50,7 +50,7 @@ This plugin requires several changes to be able to work on Android devices. Plea
50
50
2. Use Kotlin version 1.8.0 and above: [example](https://github.com/flutter-stripe/flutter_stripe/blob/main/example/android/settings.gradle#L22)
51
51
3. Requires Android Gradle plugin 8 and higher
52
52
4. 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)
53
-
5. 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 an up-to-date Android gradle build tools version: [example](https://github.com/flutter-stripe/flutter_stripe/blob/main/example/android/settings.gradle#L21) 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#L4)
54
54
6. 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)
55
55
7. Add the following rules to your `proguard-rules.pro` file: [example](https://github.com/flutter-stripe/flutter_stripe/blob/master/example/android/app/proguard-rules.pro)
56
56
```proguard
@@ -108,7 +108,7 @@ To use Stripe on web, it is required to add `flutter_stripe_web` in your pubspec
108
108
109
109
## Usage
110
110
111
-
### Card payments
111
+
### Card payments
112
112
113
113
There are 3 ways of handling card payments
114
114
@@ -118,11 +118,13 @@ Payment sheet | Easy | Our recommended way of handling payments. It off
118
118
Cardfield | Medium | Single line cardfield. Offers more flexibility but has less built-in functionality. | [docs](https://docs.page/flutter-stripe/flutter_stripe/card_field) |
119
119
Card form | Medium | Similar as the cardfield but the entry fields are spread across multi lines | [docs](https://docs.page/flutter-stripe/flutter_stripe/card_field) |
120
120
121
+
> **Note:** Stripe is sunsetting CardField and CardForm in favor of PaymentSheet. We recommend using PaymentSheet for all new integrations. See [Stripe's documentation](https://stripe.com/docs/payments/payment-sheet) for more details.
122
+
121
123
### Wallets
122
-
This library fully supports native Apple Pay and [Google pay](https://docs.page/flutter-stripe/flutter_stripe/google_pay) integration.
124
+
This library fully supports native [Apple Pay](https://docs.page/flutter-stripe/flutter_stripe/apple_pay) and [Google pay](https://docs.page/flutter-stripe/flutter_stripe/google_pay) integration.
123
125
124
-
### Mobile elements[BETA]
125
-
We also support the customer sheet mobile element. Check out the [docs](https://docs.page/flutter-stripe/flutter_stripe/customer_sheet)to learn more on how to set it up.
126
+
### Mobile elements
127
+
We also support the [Customer Sheet](https://docs.page/flutter-stripe/flutter_stripe/customer_sheet) and the [Address sheet](https://docs.page/flutter-stripe/flutter_stripe/address_sheet) mobile elements to collect and manage customer payment methods and addresses.
126
128
127
129
### Financial connections
128
130
We also support Financial connections in our latest sdk. Check out the [docs](https://docs.page/flutter-stripe/flutter_stripe/financial_connections) to learn more on how to set it up.
Copy file name to clipboardExpand all lines: docs/address_sheet.mdx
+25-37Lines changed: 25 additions & 37 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,37 +1,27 @@
1
-
# Address Sheet Implementation Guide
1
+
---
2
+
title: Address Sheet
3
+
description: Collect shipping or billing addresses using Stripe's pre-built UI component.
4
+
---
2
5
3
-
The Address Sheet is a pre-built UI component that allows you to collect shipping or billing addresses from your users in a Flutter application using Stripe's native UI components.
4
-
5
-
## Installation
6
-
7
-
Make sure you have the `flutter_stripe` package installed in your `pubspec.yaml`:
6
+
# Address Sheet
8
7
9
-
```yaml
10
-
dependencies:
11
-
flutter_stripe: ^latest_version
12
-
```
8
+
The Address Sheet is a pre-built UI component that allows you to collect shipping or billing addresses from your users in a Flutter application using Stripe's native UI components.
13
9
14
-
### Set up Stripe [Server Side] [Client Side]
10
+
##1. Set up Stripe [Client Side]
15
11
16
12
First, you need a Stripe account. [Register now](https://dashboard.stripe.com/register).
17
13
18
-
#### Server-side
19
-
20
-
This integration requires endpoints on your server that talk to the Stripe API. Use one official libraries for access to the Stripe API from your server. [Follow the steps here](https://stripe.com/docs/payments/accept-a-payment?platform=ios&ui=payment-sheet#setup-server-side)
21
-
22
14
#### Client-side
23
15
24
-
The Flutter SDK is open source, fully documented.
16
+
The Flutter SDK is open source and fully documented.
25
17
26
18
To install the SDK, follow these steps:
27
-
- Run the commmand`flutter pub add flutter_stripe`
19
+
- Run the command`flutter pub add flutter_stripe`
28
20
- This will add a line like this to your project's pubspec.yaml with the latest package version
29
21
30
-
31
22
For details on the latest SDK release and past versions, see the [Releases](https://github.com/flutter-stripe/flutter_stripe/releases) page on GitHub. To receive notifications when a new release is published, [watch releases for the repository](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/managing-subscriptions-for-activity-on-github/viewing-your-subscriptions#watching-releases-for-a-repository).
32
23
33
-
34
-
When your app starts, configure the SDK with your Stripe [publishable key](https://dashboard.stripe.com/) so that it can make requests to the Stripe API.
24
+
When your app starts, configure the SDK with your Stripe [publishable key](https://dashboard.stripe.com/) so that it can make requests to the Stripe API.
35
25
36
26
```dart
37
27
void main() async {
@@ -42,8 +32,9 @@ void main() async {
42
32
43
33
Use your [test mode](https://stripe.com/docs/keys#obtain-api-keys) keys while you test and develop, and your [live mode](https://stripe.com/docs/keys#test-live-modes) keys when you publish your app.
44
34
35
+
## 2. Basic Implementation [Client Side]
45
36
46
-
### Basic Implementation
37
+
The Address Sheet is a widget that you embed directly in your UI. When the user interacts with it, it presents a native address collection form.
47
38
48
39
Here's a basic example of how to implement the Address Sheet:
49
40
@@ -64,34 +55,31 @@ AddressSheet(
64
55
)
65
56
```
66
57
67
-
## Parameters
58
+
## 3. Parameters
68
59
69
60
### Required Parameters
70
61
71
-
- `onSubmit`: Callback function that is called when the user successfully submits their address information. Receives a `CollectAddressResult` object containing:
72
-
- `address`: The collected address details
73
-
- `name`: The customer's name
74
-
- `phoneNumber`: The customer's phone number (optional)
75
-
76
-
- `onError`: Callback function that is called when an error occurs or when the user closes the sheet before submitting. Receives a `StripeException` object.
77
-
78
-
- `params`: An `AddressSheetParams` object that configures the address sheet behavior and appearance.
62
+
| Parameter | Type | Description |
63
+
|-----------|------|-------------|
64
+
|`onSubmit`|`OnAddressSheetSubmit`| Callback when the user successfully submits their address. Receives a `CollectAddressResult` object. |
65
+
|`onError`|`OnAddressSheetError`| Callback when an error occurs or the user closes the sheet before submitting. Receives a `StripeException` object. |
66
+
|`params`|`AddressSheetParams`| Configuration object for the address sheet behavior and appearance. |
79
67
80
-
### Address Result Structure
68
+
### CollectAddressResult Structure
81
69
82
70
The `CollectAddressResult` object contains the following information:
83
71
84
72
```dart
85
73
class CollectAddressResult {
86
-
final Address address;
87
-
final String name;
88
-
final String? phoneNumber;
74
+
final Address address; // The collected address details
75
+
final String name; // The customer's name
76
+
final String? phoneNumber; // The customer's phone number (optional)
89
77
}
90
78
```
91
79
92
80
The `Address` object contains standard address fields like street, city, state, postal code, and country.
93
81
94
-
## Example Implementation
82
+
## 4. Complete Example [Client Side]
95
83
96
84
Here's a complete example showing how to implement the Address Sheet in a Flutter screen:
97
85
@@ -142,10 +130,10 @@ class _AddressSheetExampleState extends State<AddressSheetExample> {
142
130
}
143
131
```
144
132
145
-
### Customization
133
+
##5. Customization
146
134
147
135
You can customize the Address Sheet behavior by configuring the `AddressSheetParams`. This allows you to:
0 commit comments