Skip to content
This repository has been archived by the owner on Jan 6, 2023. It is now read-only.

Commit

Permalink
fix class name
Browse files Browse the repository at this point in the history
  • Loading branch information
siarheidudko committed Nov 4, 2021
1 parent 461c77c commit 9802fe5
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
StripeConstructorOptions,
Stripe as StripeDefault,
} from "@stripe/stripe-js";
import { additionalMethods } from "./methods";
import { AdditionalMethods } from "./methods";
import { setApiKey } from "./utils/store";

/**
Expand All @@ -19,7 +19,12 @@ interface StripeDefaultWithInternal extends StripeDefault {
/**
* Stripe patched interface
*/
export interface Stripe extends StripeDefaultWithInternal, additionalMethods {}
export interface Stripe extends StripeDefaultWithInternal, AdditionalMethods {}

/**
* Stripe liblary
*/
let stripe: Stripe;

/**
* Initialize stripe
Expand All @@ -32,6 +37,8 @@ export const loadStripe = async (
publishableKey: string,
options: StripeConstructorOptions | undefined
) => {
if (stripe) throw new Error("Already initialized.");

const stripeDefault: StripeDefault | null = await loadStripeDefault(
publishableKey,
options
Expand All @@ -43,9 +50,9 @@ export const loadStripe = async (
throw new Error("Initialization error.");
const apiKey = (stripeDefault as StripeDefaultWithInternal)._apiKey;
setApiKey(apiKey);
const methods = new additionalMethods();
const methods = new AdditionalMethods();

const stripe: Stripe = {
stripe = {
_apiKey: apiKey,
...stripeDefault,
...methods,
Expand Down

0 comments on commit 9802fe5

Please sign in to comment.