-
-
Notifications
You must be signed in to change notification settings - Fork 585
Add deferred payment methods for web #1881
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
base: main
Are you sure you want to change the base?
Add deferred payment methods for web #1881
Conversation
… into main # Conflicts: # packages/stripe/CHANGELOG.md # packages/stripe/pubspec.yaml # packages/stripe_android/CHANGELOG.md # packages/stripe_android/pubspec.yaml # packages/stripe_platform_interface/pubspec.yaml # packages/stripe_web/pubspec.yaml
# Conflicts: # packages/stripe_android/CHANGELOG.md
… into web_deffered_payment # Conflicts: # packages/stripe/pubspec.yaml # packages/stripe_android/CHANGELOG.md # packages/stripe_android/pubspec.yaml # packages/stripe_js/CHANGELOG.md # packages/stripe_js/lib/src/js/elements/element_creation_options.dart # packages/stripe_js/lib/src/js/payment_requests/payment_request.dart # packages/stripe_js/pubspec.yaml # packages/stripe_platform_interface/CHANGELOG.md # packages/stripe_platform_interface/lib/src/models/payment_sheet.dart # packages/stripe_platform_interface/lib/src/models/payment_sheet.freezed.dart # packages/stripe_platform_interface/lib/src/models/payment_sheet.g.dart # packages/stripe_platform_interface/pubspec.yaml # packages/stripe_web/CHANGELOG.md # packages/stripe_web/lib/src/widgets/payment_element.dart # packages/stripe_web/pubspec.yaml
… into web_deffered_payment # Conflicts: # packages/stripe/CHANGELOG.md # packages/stripe/lib/src/stripe.dart # packages/stripe/pubspec.yaml # packages/stripe_js/CHANGELOG.md # packages/stripe_js/lib/src/js/elements/element_creation_options.dart # packages/stripe_js/pubspec.yaml # packages/stripe_platform_interface/CHANGELOG.md # packages/stripe_platform_interface/pubspec.yaml # packages/stripe_web/CHANGELOG.md # packages/stripe_web/lib/src/widgets/payment_element.dart # packages/stripe_web/pubspec.yaml
… into web_deffered_payment # Conflicts: # packages/stripe_platform_interface/CHANGELOG.md # packages/stripe_web/pubspec.yaml
… into web_deffered_payment # Conflicts: # packages/stripe/CHANGELOG.md # packages/stripe/pubspec.yaml # packages/stripe_js/CHANGELOG.md # packages/stripe_js/lib/src/api/payment_intents/confirm_payment_options.freezed.dart # packages/stripe_js/lib/src/js/elements/elements.dart # packages/stripe_js/pubspec.yaml # packages/stripe_platform_interface/CHANGELOG.md # packages/stripe_web/CHANGELOG.md # packages/stripe_web/lib/src/widgets/payment_element.dart # packages/stripe_web/pubspec.yaml
Hi @EduardDumitrescu I am trying to implement Flutter web for Stripe CC payments. Sounlds like you are way ahead of me in implementing this. Could you send me your code that handles the Stripe CC payments for Flutter web? My email is [email protected], much appreciated. |
… into web_deffered_payment # Conflicts: # packages/stripe/CHANGELOG.md # packages/stripe/pubspec.yaml # packages/stripe_js/CHANGELOG.md # packages/stripe_js/pubspec.yaml # packages/stripe_platform_interface/CHANGELOG.md # packages/stripe_platform_interface/pubspec.yaml # packages/stripe_web/CHANGELOG.md # packages/stripe_web/lib/src/web_stripe.dart # packages/stripe_web/lib/src/widgets/payment_element.dart # packages/stripe_web/pubspec.yaml
Hi @remonh87 , Just checking in on this PR. This is a crucial fix for the Stripe deferred payments support on web. We wanted to let you know that we have successfully deployed and validated this exact code in our production application, so we're confident in its stability. The branch is updated and ready for review. Please let us know if there's anything we can do to help get this merged. Thank you! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the PR I think overall it looks good just left some remarks
@@ -1,6 +1,6 @@ | |||
name: flutter_stripe | |||
description: Flutter library for Stripe. Supports PaymentSheets, Apple & Google Pay, SCA, PSD2 and much more. | |||
version: 11.5.1 | |||
version: 11.6.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let’s not bump the version we will do this when we release
@@ -11,6 +10,7 @@ class ConfirmPaymentOptions with _$ConfirmPaymentOptions { | |||
const factory ConfirmPaymentOptions({ | |||
/// The Elements instance that was used to create the Payment Element. | |||
@ElementsConverter() required Elements elements, | |||
String? clientSecret, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch!
Nit: let's add a doc here
The PaymentIntent's client secret.
@@ -1,3 +1,8 @@ | |||
## 11.6.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will define the version (I think we want to add some more) to this can be removed
@@ -1,6 +1,6 @@ | |||
name: stripe_js | |||
description: Stripe.js bindings for dart. This package is used by Stripe web so that the Stripe js sdk can be invoked directly. | |||
version: 6.4.0 | |||
version: 6.4.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here not needed to add a version
@@ -101,6 +102,19 @@ class MethodChannelStripe extends StripePlatform { | |||
.parse(result: result!, successResultKey: 'paymentMethod'); | |||
} | |||
|
|||
@override | |||
Future<PaymentMethod> createPaymentMethodWithElements() => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not prefer to add this method as we really want to stay close to the stripe react native implementation here.
@@ -427,6 +441,28 @@ class MethodChannelStripe extends StripePlatform { | |||
return isSupported ?? false; | |||
} | |||
|
|||
@override | |||
Future<AvailableMobilePayOptions> availableMobilePayOptions({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is the use of this method? we have a function called: isPlatformPaySupported
|
||
const PaymentElement({ | ||
super.key, | ||
required this.clientSecret, | ||
this.clientSecret, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am thinking maybe we should split the widget into two constructors to make it clear for consumer what to add. In case for:
without intent => mode, anount and currency are required
with intent => client secret is required.
Hello,
I've created a branch which exposes methods that would let a developer do a deferred payment on web using the new interop way.