Skip to content

Commit

Permalink
Merge pull request #184 from Scille/ms-really-disable-stripe
Browse files Browse the repository at this point in the history
Only import Stripe if necessary
  • Loading branch information
Max-7 authored Feb 3, 2025
2 parents d7655e4 + 1cbc5c7 commit 3fee7e1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/services/stripe.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Parsec Cloud (https://parsec.cloud) Copyright (c) BUSL-1.1 2016-present Scille SAS

import { EnvironmentType } from '@lib/common/environment';
import {
import type {
PaymentMethodCreateParams,
PaymentMethodResult,
Stripe,
Expand All @@ -13,7 +13,6 @@ import {
StripeCardNumberElementChangeEvent,
StripeElementLocale,
StripeElements,
loadStripe,
} from '@stripe/stripe-js';
import { App } from 'vue';

Expand Down Expand Up @@ -64,6 +63,8 @@ export class StripeService implements IStripeService {
try {
this._verifyPublishableKey(this.config);

const { loadStripe } = await import('@stripe/stripe-js');

// stripe-js initialization
if (!this.instance) {
this.instance = await loadStripe(this.config.publishableKey);
Expand Down

0 comments on commit 3fee7e1

Please sign in to comment.