Skip to content

Commit 92627a5

Browse files
Revert "Feat: web language (flutter-stripe#2267)"
This reverts commit 903f367.
1 parent 8da233e commit 92627a5

File tree

4 files changed

+4
-35
lines changed

4 files changed

+4
-35
lines changed

packages/stripe/lib/src/stripe.dart

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -98,20 +98,6 @@ class Stripe {
9898
instance.markNeedsSettings();
9999
}
100100

101-
/// Retrieves the locale.
102-
/// For now works on web only.
103-
static String? get locale => instance._locale;
104-
105-
/// Sets the locale.
106-
/// For now works on web only.
107-
static set locale(String? value) {
108-
if (value == instance._locale) {
109-
return;
110-
}
111-
instance._locale = value;
112-
instance.markNeedsSettings();
113-
}
114-
115101
/// Reconfigures the Stripe platform by applying the current values for
116102
/// [publishableKey], [merchantIdentifier], [stripeAccountId],
117103
/// [threeDSecureParams], [urlScheme], [setReturnUrlSchemeOnAndroid]
@@ -122,7 +108,6 @@ class Stripe {
122108
threeDSecureParams: threeDSecureParams,
123109
urlScheme: urlScheme,
124110
setReturnUrlSchemeOnAndroid: setReturnUrlSchemeOnAndroid,
125-
locale: locale,
126111
);
127112

128113
/// Exposes a [ValueListenable] whether or not GooglePay (on Android) or Apple Pay (on iOS)
@@ -722,7 +707,6 @@ class Stripe {
722707
String? _merchantIdentifier;
723708
String? _urlScheme;
724709
bool? _setReturnUrlSchemeOnAndroid;
725-
String? _locale;
726710

727711
static StripePlatform? __platform;
728712

@@ -749,7 +733,6 @@ class Stripe {
749733
String? merchantIdentifier,
750734
String? urlScheme,
751735
bool? setReturnUrlSchemeOnAndroid,
752-
String? locale,
753736
}) async {
754737
_needsSettings = false;
755738
await _platform.initialise(
@@ -759,7 +742,6 @@ class Stripe {
759742
merchantIdentifier: merchantIdentifier,
760743
urlScheme: urlScheme,
761744
setReturnUrlSchemeOnAndroid: setReturnUrlSchemeOnAndroid,
762-
locale: locale,
763745
);
764746
}
765747

packages/stripe_platform_interface/lib/src/method_channel_stripe.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ class MethodChannelStripe extends StripePlatform {
5353
String? merchantIdentifier,
5454
String? urlScheme,
5555
bool? setReturnUrlSchemeOnAndroid,
56-
String? locale,
5756
}) async {
5857
await _methodChannel.invokeMethod('initialise', {
5958
'publishableKey': publishableKey,
@@ -63,7 +62,6 @@ class MethodChannelStripe extends StripePlatform {
6362
'threeDSecureParams': threeDSecureParams,
6463
'urlScheme': urlScheme,
6564
'setReturnUrlSchemeOnAndroid': setReturnUrlSchemeOnAndroid,
66-
'locale': locale,
6765
});
6866

6967
_methodChannel.setMethodCallHandler((call) async {

packages/stripe_platform_interface/lib/src/stripe_platform_interface.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ abstract class StripePlatform extends PlatformInterface {
3232
String? merchantIdentifier,
3333
String? urlScheme,
3434
bool? setReturnUrlSchemeOnAndroid,
35-
String? locale,
3635
});
3736

3837
Future<PaymentMethod> createPaymentMethod(

packages/stripe_web/lib/src/web_stripe.dart

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -52,23 +52,16 @@ class WebStripe extends StripePlatform {
5252
String? merchantIdentifier,
5353
String? urlScheme,
5454
bool? setReturnUrlSchemeOnAndroid,
55-
String? locale,
5655
}) async {
5756
_urlScheme = urlScheme;
5857

5958
if (__stripe != null) {
60-
// Check if the new stripeAccountId or locale is different
61-
if (__stripe!.stripeAccount != stripeAccountId || __stripe!.locale != locale) {
62-
// Re-initialize with new stripeAccountId or locale
59+
// Check if the new stripeAccountId is different
60+
if (__stripe!.stripeAccount != stripeAccountId) {
61+
// Re-initialize with new stripeAccountId
6362
await stripe_js.loadStripe();
6463
var stripeOption = stripe_js.StripeOptions();
65-
if (__stripe!.stripeAccount != stripeAccountId) {
66-
stripeOption.stripeAccount = stripeAccountId;
67-
}
68-
if (locale != null && __stripe!.locale != locale) {
69-
stripeOption.locale = locale;
70-
}
71-
64+
stripeOption.stripeAccount = stripeAccountId;
7265
__stripe = stripe_js.Stripe(publishableKey, stripeOption);
7366
}
7467
return;
@@ -79,9 +72,6 @@ class WebStripe extends StripePlatform {
7972
if (stripeAccountId != null) {
8073
stripeOption.stripeAccount = stripeAccountId;
8174
}
82-
if (locale != null) {
83-
stripeOption.locale = locale;
84-
}
8575
__stripe = stripe_js.Stripe(publishableKey, stripeOption);
8676
}
8777

0 commit comments

Comments
 (0)