Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOC: add confirmPaymentSheetPayment to the docs for handling custom flow #1369

Merged
merged 1 commit into from
Aug 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions docs/sheet.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ Future<void> initPaymentSheet() async {
// 2. initialize the payment sheet
await Stripe.instance.initPaymentSheet(
paymentSheetParameters: SetupPaymentSheetParameters(
// Enable custom flow
customFlow: true,
// Set to true for custom flow
customFlow: false,
// Main params
merchantDisplayName: 'Flutter Stripe Store Demo',
paymentIntentClientSecret: data['paymentIntent'],
Expand Down Expand Up @@ -124,6 +124,12 @@ When the customer taps a **Checkout** button, call present to present the paymen
await Stripe.instance.presentPaymentSheet();
```

When you set `customFlow` to `true`, you need to handle the payment intent confirmation manually. You can do this by calling `confirmPaymentSheetPayment`.

```dart
await Stripe.instance.confirmPaymentSheetPayment();
```

Unless your business model requires immediate payment (e.g., an on-demand service), don’t assume you have received payment at this point. Instead, inform the customer that you confirmed their order and notify them by email when you fulfill their order in the next step.

>> ADD MORE PAYMENT METHODS
Expand Down
2 changes: 1 addition & 1 deletion packages/stripe/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ Method | Ease of use | description
------------- | ------------- |----------------------------------------------------------------------------------------------------------------- | ------------------- |
Payment sheet | Easy | Our recommended way of handling payments. It offers localization, animations and error handling out of the box. | [docs](https://docs.page/flutter-stripe/flutter_stripe/sheet) |
Cardfield | Medium | Single line cardfield. Offers more flexibility but has less built-in functionality. | [docs](https://docs.page/flutter-stripe/flutter_stripe/card_field) |
Card form | Medium | Simular as the cardfield but the entry fields are spread across multi lines | [docs](https://docs.page/flutter-stripe/flutter_stripe/card_field) |
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) |


### Financial connections
Expand Down
Loading