Skip to content

Commit

Permalink
Merge branch 'main' into sync
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasbark authored Jun 21, 2024
2 parents 9f79879 + 528dac4 commit 14ad6b3
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions packages/stripe_web/lib/src/web_stripe.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,21 @@ class WebStripe extends StripePlatform {
bool? setReturnUrlSchemeOnAndroid,
}) async {
this._urlScheme = urlScheme;

if (__stripe != null) {
__stripe!.stripeAccount = stripeAccountId;
// Check if the new stripeAccountId is different
if (__stripe!.stripeAccount != stripeAccountId) {
// Re-initialize with new stripeAccountId
await stripe_js.loadStripe();
var stripeOption = stripe_js.StripeOptions();
stripeOption.stripeAccount = stripeAccountId;
__stripe = stripe_js.Stripe(publishableKey, stripeOption);
}
return;
}

await stripe_js.loadStripe();
final stripeOption = stripe_js.StripeOptions();
var stripeOption = stripe_js.StripeOptions();
if (stripeAccountId != null) {
stripeOption.stripeAccount = stripeAccountId;
}
Expand Down

0 comments on commit 14ad6b3

Please sign in to comment.