@vue-stripe/vue-stripe 4.5.0 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +174 -58
- package/dist/cjs/index.js +1 -0
- package/dist/es/index.js +896 -0
- package/dist/types/components/VueStripeAddressElement.vue.d.ts +105 -0
- package/dist/types/components/VueStripeAddressElement.vue.d.ts.map +1 -0
- package/dist/types/components/VueStripeCardCvcElement.vue.d.ts +24 -0
- package/dist/types/components/VueStripeCardCvcElement.vue.d.ts.map +1 -0
- package/dist/types/components/VueStripeCardElement.vue.d.ts +197 -0
- package/dist/types/components/VueStripeCardElement.vue.d.ts.map +1 -0
- package/dist/types/components/VueStripeCardExpiryElement.vue.d.ts +24 -0
- package/dist/types/components/VueStripeCardExpiryElement.vue.d.ts.map +1 -0
- package/dist/types/components/VueStripeCardNumberElement.vue.d.ts +24 -0
- package/dist/types/components/VueStripeCardNumberElement.vue.d.ts.map +1 -0
- package/dist/types/components/VueStripeCheckout.vue.d.ts +50 -0
- package/dist/types/components/VueStripeCheckout.vue.d.ts.map +1 -0
- package/dist/types/components/VueStripeElements.vue.d.ts +90 -0
- package/dist/types/components/VueStripeElements.vue.d.ts.map +1 -0
- package/dist/types/components/VueStripeExpressCheckoutElement.vue.d.ts +220 -0
- package/dist/types/components/VueStripeExpressCheckoutElement.vue.d.ts.map +1 -0
- package/dist/types/components/VueStripeLinkAuthenticationElement.vue.d.ts +167 -0
- package/dist/types/components/VueStripeLinkAuthenticationElement.vue.d.ts.map +1 -0
- package/dist/types/components/VueStripePaymentElement.vue.d.ts +206 -0
- package/dist/types/components/VueStripePaymentElement.vue.d.ts.map +1 -0
- package/dist/types/components/VueStripeProvider.vue.d.ts +42 -0
- package/dist/types/components/VueStripeProvider.vue.d.ts.map +1 -0
- package/dist/types/components/index.d.ts +12 -0
- package/dist/types/components/index.d.ts.map +1 -0
- package/dist/types/composables/index.d.ts +6 -0
- package/dist/types/composables/index.d.ts.map +1 -0
- package/dist/types/composables/usePaymentIntent.d.ts +45 -0
- package/dist/types/composables/usePaymentIntent.d.ts.map +1 -0
- package/dist/types/composables/useSetupIntent.d.ts +62 -0
- package/dist/types/composables/useSetupIntent.d.ts.map +1 -0
- package/dist/types/composables/useStripe.d.ts +27 -0
- package/dist/types/composables/useStripe.d.ts.map +1 -0
- package/dist/types/composables/useStripeCheckout.d.ts +9 -0
- package/dist/types/composables/useStripeCheckout.d.ts.map +1 -0
- package/dist/types/composables/useStripeElements.d.ts +26 -0
- package/dist/types/composables/useStripeElements.d.ts.map +1 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/plugin.d.ts +23 -0
- package/dist/types/plugin.d.ts.map +1 -0
- package/dist/types/tsconfig.build.tsbuildinfo +1 -0
- package/dist/types/types/index.d.ts +171 -0
- package/dist/types/types/index.d.ts.map +1 -0
- package/dist/types/utils/constants.d.ts +11 -0
- package/dist/types/utils/constants.d.ts.map +1 -0
- package/dist/types/utils/element-factory.d.ts +28 -0
- package/dist/types/utils/element-factory.d.ts.map +1 -0
- package/dist/types/utils/errors.d.ts +11 -0
- package/dist/types/utils/errors.d.ts.map +1 -0
- package/dist/types/utils/injection-keys.d.ts +15 -0
- package/dist/types/utils/injection-keys.d.ts.map +1 -0
- package/dist/umd/index.js +1 -0
- package/dist/vue-stripe.css +1 -0
- package/package.json +67 -66
- package/CONTRIBUTING.md +0 -77
- package/LICENSE +0 -21
- package/babel.config.js +0 -22
- package/dist/index.js +0 -7
- package/dist/vue-stripe.js +0 -7
- package/rollup.config.js +0 -37
- package/typings/index.d.ts +0 -73
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { Ref } from 'vue-demi';
|
|
2
|
+
import { Stripe, StripeElements, StripeElementsOptions, StripeElement, StripeElementChangeEvent, ConfirmPaymentData, StripeConstructorOptions } from '@stripe/stripe-js';
|
|
3
|
+
export type { Stripe, StripeElements, StripeElement, StripeElementType, StripeElementsOptions, StripeElementChangeEvent, PaymentIntent, SetupIntent, ConfirmPaymentData, ConfirmCardSetupData, StripeCardElement, StripeCardNumberElement, StripeCardExpiryElement, StripeCardCvcElement, StripePaymentElement, StripeAddressElement, StripeLinkAuthenticationElement, StripeExpressCheckoutElement, StripeCardElementChangeEvent, StripePaymentElementChangeEvent, StripeAddressElementChangeEvent, StripeLinkAuthenticationElementChangeEvent, StripeExpressCheckoutElementConfirmEvent, StripeExpressCheckoutElementClickEvent } from '@stripe/stripe-js';
|
|
4
|
+
export interface VueStripeOptions {
|
|
5
|
+
publishableKey: string;
|
|
6
|
+
stripeAccount?: string;
|
|
7
|
+
apiVersion?: string;
|
|
8
|
+
locale?: StripeConstructorOptions['locale'];
|
|
9
|
+
}
|
|
10
|
+
export interface VueStripeElement {
|
|
11
|
+
stripe: Stripe | null;
|
|
12
|
+
element: StripeElement | null;
|
|
13
|
+
loading: boolean;
|
|
14
|
+
error: string | null;
|
|
15
|
+
}
|
|
16
|
+
export interface VueStripeProviderProps {
|
|
17
|
+
publishableKey: string;
|
|
18
|
+
stripeAccount?: string;
|
|
19
|
+
apiVersion?: string;
|
|
20
|
+
locale?: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Mode for Payment Element - determines the type of intent
|
|
24
|
+
*/
|
|
25
|
+
export type ElementsMode = 'payment' | 'setup' | 'subscription';
|
|
26
|
+
/**
|
|
27
|
+
* Indicates intent to save payment method for future use
|
|
28
|
+
*/
|
|
29
|
+
export type SetupFutureUsage = 'off_session' | 'on_session';
|
|
30
|
+
/**
|
|
31
|
+
* Controls when to capture funds from customer's account
|
|
32
|
+
*/
|
|
33
|
+
export type CaptureMethod = 'automatic' | 'automatic_async' | 'manual';
|
|
34
|
+
export interface VueStripeElementsProps {
|
|
35
|
+
/**
|
|
36
|
+
* Client secret from PaymentIntent or SetupIntent.
|
|
37
|
+
* When provided, Elements will use the intent-based flow.
|
|
38
|
+
*/
|
|
39
|
+
clientSecret?: string | undefined;
|
|
40
|
+
/**
|
|
41
|
+
* Mode for deferred intent creation (without clientSecret).
|
|
42
|
+
* Required when clientSecret is not provided.
|
|
43
|
+
*/
|
|
44
|
+
mode?: ElementsMode | undefined;
|
|
45
|
+
/**
|
|
46
|
+
* Currency code (e.g., 'usd', 'eur') for deferred intent creation.
|
|
47
|
+
* Required when using mode without clientSecret.
|
|
48
|
+
*/
|
|
49
|
+
currency?: string | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* Amount in smallest currency unit (e.g., cents for USD).
|
|
52
|
+
* Required for 'payment' and 'subscription' modes.
|
|
53
|
+
*/
|
|
54
|
+
amount?: number | undefined;
|
|
55
|
+
/**
|
|
56
|
+
* Indicates intent to save payment method for future use.
|
|
57
|
+
* When set, displays additional input fields and mandates as needed.
|
|
58
|
+
*/
|
|
59
|
+
setupFutureUsage?: SetupFutureUsage | undefined;
|
|
60
|
+
/**
|
|
61
|
+
* Controls when to capture funds from customer's account.
|
|
62
|
+
*/
|
|
63
|
+
captureMethod?: CaptureMethod | undefined;
|
|
64
|
+
/**
|
|
65
|
+
* List of payment method types to display.
|
|
66
|
+
* Omit to use Dashboard payment method settings.
|
|
67
|
+
*/
|
|
68
|
+
paymentMethodTypes?: string[] | undefined;
|
|
69
|
+
/**
|
|
70
|
+
* Additional options passed to stripe.elements().
|
|
71
|
+
*/
|
|
72
|
+
options?: StripeElementsOptions | undefined;
|
|
73
|
+
}
|
|
74
|
+
export interface VueStripeElementEvents {
|
|
75
|
+
ready: (element: StripeElement) => void;
|
|
76
|
+
change: (event: StripeElementChangeEvent) => void;
|
|
77
|
+
}
|
|
78
|
+
export interface UseStripeReturn {
|
|
79
|
+
stripe: Readonly<Ref<Stripe | null>>;
|
|
80
|
+
loading: Readonly<Ref<boolean>>;
|
|
81
|
+
error: Readonly<Ref<string | null>>;
|
|
82
|
+
initialize: () => Promise<void>;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Result of elements.submit() call
|
|
86
|
+
* Matches the return type from Stripe's elements.submit()
|
|
87
|
+
*/
|
|
88
|
+
export type ElementsSubmitResult = {
|
|
89
|
+
error?: undefined;
|
|
90
|
+
selectedPaymentMethod?: string;
|
|
91
|
+
} | {
|
|
92
|
+
error: {
|
|
93
|
+
type?: string;
|
|
94
|
+
code?: string;
|
|
95
|
+
message?: string;
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
export interface UseStripeElementsReturn {
|
|
99
|
+
elements: Readonly<Ref<StripeElements | null>>;
|
|
100
|
+
/**
|
|
101
|
+
* Triggers form validation and collects data required for wallets (Apple Pay, Google Pay).
|
|
102
|
+
* This should be called before confirmPayment/confirmSetup.
|
|
103
|
+
* Note: usePaymentIntent and useSetupIntent call this automatically unless skipSubmit is true.
|
|
104
|
+
*/
|
|
105
|
+
submit: () => Promise<ElementsSubmitResult>;
|
|
106
|
+
loading: Readonly<Ref<boolean>>;
|
|
107
|
+
error: Readonly<Ref<string | null>>;
|
|
108
|
+
}
|
|
109
|
+
export interface ConfirmPaymentOptions {
|
|
110
|
+
clientSecret: string;
|
|
111
|
+
confirmParams?: ConfirmPaymentData;
|
|
112
|
+
redirect?: 'if_required' | 'always';
|
|
113
|
+
elements?: StripeElements;
|
|
114
|
+
/** Skip elements.submit() validation (not recommended, defaults to false) */
|
|
115
|
+
skipSubmit?: boolean;
|
|
116
|
+
}
|
|
117
|
+
export interface UsePaymentIntentReturn {
|
|
118
|
+
confirmPayment: (options: ConfirmPaymentOptions) => Promise<any>;
|
|
119
|
+
loading: Readonly<Ref<boolean>>;
|
|
120
|
+
error: Readonly<Ref<string | null>>;
|
|
121
|
+
}
|
|
122
|
+
export interface UseSetupIntentReturn {
|
|
123
|
+
confirmSetup: (options: ConfirmSetupOptions) => Promise<any>;
|
|
124
|
+
loading: Readonly<Ref<boolean>>;
|
|
125
|
+
error: Readonly<Ref<string | null>>;
|
|
126
|
+
}
|
|
127
|
+
export interface ConfirmSetupOptions {
|
|
128
|
+
clientSecret: string;
|
|
129
|
+
confirmParams?: {
|
|
130
|
+
return_url?: string;
|
|
131
|
+
payment_method_data?: {
|
|
132
|
+
billing_details?: {
|
|
133
|
+
name?: string;
|
|
134
|
+
email?: string;
|
|
135
|
+
phone?: string;
|
|
136
|
+
address?: {
|
|
137
|
+
line1?: string;
|
|
138
|
+
line2?: string;
|
|
139
|
+
city?: string;
|
|
140
|
+
state?: string;
|
|
141
|
+
postal_code?: string;
|
|
142
|
+
country?: string;
|
|
143
|
+
};
|
|
144
|
+
};
|
|
145
|
+
};
|
|
146
|
+
};
|
|
147
|
+
redirect?: 'if_required' | 'always';
|
|
148
|
+
elements?: StripeElements;
|
|
149
|
+
/** Skip elements.submit() validation (not recommended, defaults to false) */
|
|
150
|
+
skipSubmit?: boolean;
|
|
151
|
+
}
|
|
152
|
+
export type PaymentElementType = 'card' | 'ideal' | 'sepa_debit' | 'sofort' | 'bancontact' | 'giropay' | 'eps' | 'p24' | 'alipay' | 'wechat_pay' | 'afterpay_clearpay' | 'klarna' | 'affirm' | 'zip';
|
|
153
|
+
export type ExpressCheckoutType = 'apple_pay' | 'google_pay' | 'paypal' | 'amazon_pay' | 'link';
|
|
154
|
+
export interface VueStripeError {
|
|
155
|
+
type: string;
|
|
156
|
+
code?: string;
|
|
157
|
+
message: string;
|
|
158
|
+
decline_code?: string;
|
|
159
|
+
param?: string;
|
|
160
|
+
}
|
|
161
|
+
export interface VueStripeContext {
|
|
162
|
+
stripe: Ref<Stripe | null>;
|
|
163
|
+
loading: Ref<boolean>;
|
|
164
|
+
error: Ref<string | null>;
|
|
165
|
+
}
|
|
166
|
+
export interface VueStripeElementsContext {
|
|
167
|
+
elements: Ref<StripeElements | null>;
|
|
168
|
+
loading: Ref<boolean>;
|
|
169
|
+
error: Ref<string | null>;
|
|
170
|
+
}
|
|
171
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mapp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M,CAAA;CACf;AAGD,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,GAAG,CAAC,MAAM,GAAG,IAAI,CAAC,CAAA;IAC1B,OAAO,EAAE,GAAG,CAAC,OAAO,CAAC,CAAA;IACrB,KAAK,EAAE,GAAG,CAAC,MAAM,GAAG,IAAI,CAAC,CAAA;CAC1B;AAED,MAAM,WAAW,wBAAwB;IACvC,QAAQ,EAAE,GAAG,CAAC,cAAc,GAAG,IAAI,CAAC,CAAA;IACpC,OAAO,EAAE,GAAG,CAAC,OAAO,CAAC,CAAA;IACrB,KAAK,EAAE,GAAG,CAAC,MAAM,GAAG,IAAI,CAAC,CAAA;CAC1B"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stripe Partner Details (Internal)
|
|
3
|
+
* Registered with Stripe when the library initializes
|
|
4
|
+
*/
|
|
5
|
+
export declare const STRIPE_PARTNER_DETAILS: {
|
|
6
|
+
name: string;
|
|
7
|
+
version: string;
|
|
8
|
+
url: string;
|
|
9
|
+
partner_id: string;
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/utils/constants.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,eAAO,MAAM,sBAAsB;;;;;CAKlC,CAAA"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { DefineComponent, ExtractPropTypes, VNode, RendererNode, RendererElement, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue-demi';
|
|
2
|
+
export type StripeElementType = 'card' | 'cardNumber' | 'cardExpiry' | 'cardCvc' | 'payment' | 'address' | 'expressCheckout' | 'linkAuthentication';
|
|
3
|
+
export interface ElementFactoryOptions {
|
|
4
|
+
elementType: StripeElementType;
|
|
5
|
+
componentName: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function createStripeElement({ elementType, componentName }: ElementFactoryOptions): DefineComponent<ExtractPropTypes<{
|
|
8
|
+
options: {
|
|
9
|
+
type: ObjectConstructor;
|
|
10
|
+
default: () => {};
|
|
11
|
+
};
|
|
12
|
+
}>, () => VNode<RendererNode, RendererElement, {
|
|
13
|
+
[key: string]: any;
|
|
14
|
+
}>, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, ("blur" | "change" | "focus" | "ready" | "escape")[], "blur" | "change" | "focus" | "ready" | "escape", PublicProps, Readonly< ExtractPropTypes<{
|
|
15
|
+
options: {
|
|
16
|
+
type: ObjectConstructor;
|
|
17
|
+
default: () => {};
|
|
18
|
+
};
|
|
19
|
+
}>> & Readonly<{
|
|
20
|
+
onFocus?: (...args: any[]) => any;
|
|
21
|
+
onBlur?: (...args: any[]) => any;
|
|
22
|
+
onChange?: (...args: any[]) => any;
|
|
23
|
+
onReady?: (...args: any[]) => any;
|
|
24
|
+
onEscape?: (...args: any[]) => any;
|
|
25
|
+
}>, {
|
|
26
|
+
options: Record<string, any>;
|
|
27
|
+
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
28
|
+
//# sourceMappingURL=element-factory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"element-factory.d.ts","sourceRoot":"","sources":["../../../src/utils/element-factory.ts"],"names":[],"mappings":";AAMA,MAAM,MAAM,iBAAiB,GACzB,MAAM,GACN,YAAY,GACZ,YAAY,GACZ,SAAS,GACT,SAAS,GACT,SAAS,GACT,iBAAiB,GACjB,oBAAoB,CAAA;AAExB,MAAM,WAAW,qBAAqB;IACpC,WAAW,EAAE,iBAAiB,CAAA;IAC9B,aAAa,EAAE,MAAM,CAAA;CACtB;AAeD,wBAAgB,mBAAmB,CAAC,EAAE,WAAW,EAAE,aAAa,EAAE,EAAE,qBAAqB;;;;;;;;;;;;;;;;;;;;kFA4JxF"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare class VueStripeProviderError extends Error {
|
|
2
|
+
constructor(message: string);
|
|
3
|
+
}
|
|
4
|
+
export declare class VueStripeElementsError extends Error {
|
|
5
|
+
constructor(message: string);
|
|
6
|
+
}
|
|
7
|
+
export declare class VueStripeLoadError extends Error {
|
|
8
|
+
constructor(message: string);
|
|
9
|
+
}
|
|
10
|
+
export declare function createVueStripeError(type: 'provider' | 'elements' | 'load', message: string): Error;
|
|
11
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/utils/errors.ts"],"names":[],"mappings":"AAAA,qBAAa,sBAAuB,SAAQ,KAAK;gBACnC,OAAO,EAAE,MAAM;CAI5B;AAED,qBAAa,sBAAuB,SAAQ,KAAK;gBACnC,OAAO,EAAE,MAAM;CAI5B;AAED,qBAAa,kBAAmB,SAAQ,KAAK;gBAC/B,OAAO,EAAE,MAAM;CAI5B;AAED,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,UAAU,GAAG,UAAU,GAAG,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,KAAK,CAWnG"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { InjectionKey, Ref } from 'vue-demi';
|
|
2
|
+
import { Stripe, StripeElements } from '@stripe/stripe-js';
|
|
3
|
+
export interface StripeInstance {
|
|
4
|
+
stripe: Ref<Stripe | null>;
|
|
5
|
+
loading: Ref<boolean>;
|
|
6
|
+
error: Ref<string | null>;
|
|
7
|
+
}
|
|
8
|
+
export interface StripeElementsInstance {
|
|
9
|
+
elements: Ref<StripeElements | null>;
|
|
10
|
+
loading: Ref<boolean>;
|
|
11
|
+
error: Ref<string | null>;
|
|
12
|
+
}
|
|
13
|
+
export declare const stripeInjectionKey: InjectionKey<StripeInstance>;
|
|
14
|
+
export declare const stripeElementsInjectionKey: InjectionKey<StripeElementsInstance>;
|
|
15
|
+
//# sourceMappingURL=injection-keys.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"injection-keys.d.ts","sourceRoot":"","sources":["../../../src/utils/injection-keys.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAClD,OAAO,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEhE,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,GAAG,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAC3B,OAAO,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;IACtB,KAAK,EAAE,GAAG,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;CAC3B;AAED,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,GAAG,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IACrC,OAAO,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;IACtB,KAAK,EAAE,GAAG,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;CAC3B;AAED,eAAO,MAAM,kBAAkB,EAAE,YAAY,CAAC,cAAc,CAAoB,CAAC;AACjF,eAAO,MAAM,0BAA0B,EAAE,YAAY,CAAC,sBAAsB,CAA6B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(p,S){typeof exports=="object"&&typeof module<"u"?S(exports,require("@stripe/stripe-js"),require("vue-demi")):typeof define=="function"&&define.amd?define(["exports","@stripe/stripe-js","vue-demi"],S):(p=typeof globalThis<"u"?globalThis:p||self,S(p.VueStripe={},p.Stripe,p.VueDemi))})(this,(function(p,S,e){"use strict";const k=Symbol("stripe"),y=Symbol("stripe-elements");class h extends Error{constructor(l){super(l),this.name="VueStripeProviderError"}}class v extends Error{constructor(l){super(l),this.name="VueStripeElementsError"}}class w extends Error{constructor(l){super(l),this.name="VueStripeLoadError"}}function N(c,l){switch(c){case"provider":return new h(l);case"elements":return new v(l);case"load":return new w(l);default:return new Error(l)}}const C={name:"vue-stripe",version:"5.0.0",url:"https://vuestripe.com",partner_id:"pp_partner_IqtOXpBSuz0IE2"},A={key:0,class:"vue-stripe-error"},T={class:"vue-stripe-error-message"},j={key:1,class:"vue-stripe-loading"},R={key:2},z=e.defineComponent({__name:"VueStripeProvider",props:{publishableKey:{},stripeKey:{},stripeAccount:{},apiVersion:{},locale:{},options:{}},emits:["load","error"],setup(c,{emit:l}){const s=c,i=l,o=e.ref(null),a=e.ref(!0),r=e.ref(null),t=s.publishableKey||s.stripeKey;if(!t)throw new h("publishableKey or stripeKey is required");const u={publishableKey:t,stripeAccount:s.stripeAccount||s.options?.stripeAccount,apiVersion:s.apiVersion||s.options?.apiVersion,locale:s.locale||s.options?.locale},f=async()=>{try{a.value=!0,r.value=null;const d={},n=s.stripeAccount||s.options?.stripeAccount,m=s.apiVersion||s.options?.apiVersion,g=s.locale||s.options?.locale;if(n&&(d.stripeAccount=n),m&&(d.apiVersion=m),g&&(d.locale=g),o.value=await S.loadStripe(t,d),!o.value)throw new h("Failed to initialize Stripe");o.value.registerAppInfo(C),i("load",o.value)}catch(d){const n=d instanceof Error?d.message:"Failed to load Stripe";r.value=n,console.error("[Vue Stripe] Initialization error:",n),i("error",d instanceof Error?d:new Error(n))}finally{a.value=!1}};return e.onMounted(()=>{f()}),e.provide("vue-stripe-config",u),e.provide(k,{stripe:o,loading:a,error:r}),(d,n)=>e.unref(r)?(e.openBlock(),e.createElementBlock("div",A,[e.renderSlot(d.$slots,"error",{error:e.unref(r)},()=>[e.createElementVNode("div",T,e.toDisplayString(e.unref(r)),1)],!0)])):e.unref(a)?(e.openBlock(),e.createElementBlock("div",j,[e.renderSlot(d.$slots,"loading",{},()=>[n[0]||(n[0]=e.createElementVNode("div",{class:"vue-stripe-loading-message"}," Loading Stripe... ",-1))],!0)])):(e.openBlock(),e.createElementBlock("div",R,[e.renderSlot(d.$slots,"default",{},void 0,!0)]))}}),E=(c,l)=>{const s=c.__vccOpts||c;for(const[i,o]of l)s[i]=o;return s},U=E(z,[["__scopeId","data-v-ce126b08"]]),L={key:0,class:"vue-stripe-elements-error"},F={class:"vue-stripe-error-message"},K={key:1,class:"vue-stripe-elements-loading"},q={key:2},x=E(e.defineComponent({__name:"VueStripeElements",props:{clientSecret:{},mode:{},currency:{},amount:{},setupFutureUsage:{},captureMethod:{},paymentMethodTypes:{},options:{}},setup(c){const l=c,s=e.inject(k);if(!s)throw new h("VueStripeElements must be used within VueStripeProvider");const i=e.ref(null),o=e.ref(!0),a=e.ref(null),r=()=>{if(!s.stripe.value){a.value="Stripe instance not available",o.value=!1;return}try{a.value=null,o.value=!0;const t={...l.options};l.clientSecret&&(t.clientSecret=l.clientSecret),l.mode&&(t.mode=l.mode),l.currency&&(t.currency=l.currency),l.amount!==void 0&&(t.amount=l.amount),l.setupFutureUsage&&(t.setupFutureUsage=l.setupFutureUsage),l.captureMethod&&(t.captureMethod=l.captureMethod),l.paymentMethodTypes&&(t.paymentMethodTypes=l.paymentMethodTypes),i.value=s.stripe.value.elements(t),o.value=!1}catch(t){const u=t instanceof Error?t.message:"Failed to create elements";a.value=u,o.value=!1,console.error("[Vue Stripe] Elements creation error:",u)}};return e.watch(()=>s.stripe.value,t=>{t&&!i.value&&r()},{immediate:!0}),e.watch(()=>l.clientSecret,()=>{s.stripe.value&&r()}),e.watch(()=>[l.mode,l.currency,l.amount,l.setupFutureUsage],()=>{s.stripe.value&&r()}),e.onMounted(()=>{s.stripe.value&&!i.value&&r()}),e.provide(y,{elements:i,loading:o,error:a}),(t,u)=>e.unref(a)?(e.openBlock(),e.createElementBlock("div",L,[e.renderSlot(t.$slots,"error",{error:e.unref(a)},()=>[e.createElementVNode("div",F,e.toDisplayString(e.unref(a)),1)],!0)])):e.unref(o)?(e.openBlock(),e.createElementBlock("div",K,[e.renderSlot(t.$slots,"loading",{},()=>[u[0]||(u[0]=e.createElementVNode("div",{class:"vue-stripe-loading-message"}," Initializing Elements... ",-1))],!0)])):(e.openBlock(),e.createElementBlock("div",q,[e.renderSlot(t.$slots,"default",{},void 0,!0)]))}}),[["__scopeId","data-v-478abfa3"]]),O={class:"vue-stripe-payment-element"},W={key:0,class:"vue-stripe-payment-element-error"},X={class:"vue-stripe-error-message"},G={key:1,class:"vue-stripe-payment-element-loader"},H=E(e.defineComponent({__name:"VueStripePaymentElement",props:{options:{}},emits:["ready","change","focus","blur","escape","loaderstart","loaderstop"],setup(c,{expose:l,emit:s}){const i=c,o=s,a=e.ref(),r=e.ref(null),t=e.ref(!0),u=e.ref(null),f=e.inject(y);if(!f)throw new v("VueStripePaymentElement must be used within VueStripeElements");const d=()=>{if(!f.elements.value){u.value="Elements instance not available",t.value=!1;return}if(!a.value){u.value="Mount point not available",t.value=!1;return}try{u.value=null,t.value=!0,r.value=f.elements.value.create("payment",i.options),r.value.on("ready",()=>{t.value=!1,o("ready",r.value)}),r.value.on("change",m=>{o("change",m)}),r.value.on("focus",()=>{o("focus")}),r.value.on("blur",()=>{o("blur")}),r.value.on("escape",()=>{o("escape")});const n=r.value;n.on("loaderstart",()=>{o("loaderstart")}),n.on("loaderstop",()=>{o("loaderstop")}),r.value.mount(a.value)}catch(n){const m=n instanceof Error?n.message:"Failed to create payment element";u.value=m,t.value=!1,console.error("[Vue Stripe] Payment element creation error:",m)}};return e.watch(()=>i.options,n=>{r.value&&n&&r.value.update(n)},{deep:!0}),e.watch(()=>f.elements.value,n=>{n&&a.value&&!r.value&&d()},{immediate:!0}),e.onMounted(()=>{f.elements.value&&a.value&&!r.value&&d()}),e.onUnmounted(()=>{r.value&&r.value.destroy()}),l({element:r,loading:t,error:u}),(n,m)=>(e.openBlock(),e.createElementBlock("div",O,[e.unref(u)?(e.openBlock(),e.createElementBlock("div",W,[e.renderSlot(n.$slots,"error",{error:e.unref(u)},()=>[e.createElementVNode("div",X,e.toDisplayString(e.unref(u)),1)],!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"elementRef",ref:a,class:e.normalizeClass(["vue-stripe-payment-element-mount",{"vue-stripe-payment-element-loading":e.unref(t)}])},null,2),e.unref(t)?(e.openBlock(),e.createElementBlock("div",G,[e.renderSlot(n.$slots,"loading",{},()=>[m[0]||(m[0]=e.createElementVNode("div",{class:"vue-stripe-loading-message"}," Loading payment form... ",-1))],!0)])):e.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-2477e9df"]]),Q={class:"vue-stripe-express-checkout-element"},Y={key:0,class:"vue-stripe-express-checkout-element-error"},Z={class:"vue-stripe-error-message"},J={key:1,class:"vue-stripe-express-checkout-element-loader"},D=E(e.defineComponent({__name:"VueStripeExpressCheckoutElement",props:{options:{}},emits:["ready","click","confirm","cancel","shippingaddresschange","shippingratechange"],setup(c,{expose:l,emit:s}){const i=c,o=s,a=e.ref(),r=e.ref(null),t=e.ref(!0),u=e.ref(null),f=e.inject(y);if(!f)throw new v("VueStripeExpressCheckoutElement must be used within VueStripeElements");const d=()=>{if(!f.elements.value){u.value="Elements instance not available",t.value=!1;return}if(!a.value){u.value="Mount point not available",t.value=!1;return}try{u.value=null,t.value=!0,r.value=f.elements.value.create("expressCheckout",i.options),r.value.on("ready",n=>{t.value=!1,o("ready",n)}),r.value.on("click",n=>{o("click",n)}),r.value.on("confirm",n=>{o("confirm",n)}),r.value.on("cancel",()=>{o("cancel")}),r.value.on("shippingaddresschange",n=>{o("shippingaddresschange",n)}),r.value.on("shippingratechange",n=>{o("shippingratechange",n)}),r.value.mount(a.value)}catch(n){const m=n instanceof Error?n.message:"Failed to create express checkout element";u.value=m,t.value=!1,console.error("[Vue Stripe] Express checkout element creation error:",m)}};return e.watch(()=>i.options,n=>{r.value&&n&&r.value.update(n)},{deep:!0}),e.watch(()=>f.elements.value,n=>{n&&a.value&&!r.value&&d()},{immediate:!0}),e.onMounted(()=>{f.elements.value&&a.value&&!r.value&&d()}),e.onUnmounted(()=>{r.value&&r.value.destroy()}),l({element:r,loading:t,error:u}),(n,m)=>(e.openBlock(),e.createElementBlock("div",Q,[e.unref(u)?(e.openBlock(),e.createElementBlock("div",Y,[e.renderSlot(n.$slots,"error",{error:e.unref(u)},()=>[e.createElementVNode("div",Z,e.toDisplayString(e.unref(u)),1)],!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"elementRef",ref:a,class:e.normalizeClass(["vue-stripe-express-checkout-element-mount",{"vue-stripe-express-checkout-element-loading":e.unref(t)}])},null,2),e.unref(t)?(e.openBlock(),e.createElementBlock("div",J,[e.renderSlot(n.$slots,"loading",{},()=>[m[0]||(m[0]=e.createElementVNode("div",{class:"vue-stripe-loading-message"}," Loading express checkout... ",-1))],!0)])):e.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-20294cda"]]),ee={class:"vue-stripe-card-element"},te={key:0,class:"vue-stripe-card-element-error"},re={class:"vue-stripe-error-message"},ne={key:1,class:"vue-stripe-card-element-loader"},oe=E(e.defineComponent({__name:"VueStripeCardElement",props:{options:{}},emits:["ready","change","focus","blur","escape"],setup(c,{expose:l,emit:s}){const i=c,o=s,a=e.ref(),r=e.ref(null),t=e.ref(!0),u=e.ref(null),f=e.inject(y);if(!f)throw new v("VueStripeCardElement must be used within VueStripeElements");const d=()=>{if(!f.elements.value){u.value="Elements instance not available",t.value=!1;return}if(!a.value){u.value="Mount point not available",t.value=!1;return}try{u.value=null,t.value=!0,r.value=f.elements.value.create("card",i.options),r.value.on("ready",()=>{t.value=!1,o("ready",r.value)}),r.value.on("change",n=>{n.error?u.value=n.error.message:u.value=null,o("change",n)}),r.value.on("focus",()=>{o("focus")}),r.value.on("blur",()=>{o("blur")}),r.value.on("escape",()=>{o("escape")}),r.value.mount(a.value)}catch(n){const m=n instanceof Error?n.message:"Failed to create card element";u.value=m,t.value=!1,console.error("[Vue Stripe] Card element creation error:",m)}};return e.watch(()=>i.options,n=>{r.value&&n&&r.value.update(n)},{deep:!0}),e.watch(()=>f.elements.value,n=>{n&&a.value&&!r.value&&d()},{immediate:!0}),e.onMounted(()=>{f.elements.value&&a.value&&!r.value&&d()}),e.onUnmounted(()=>{r.value&&r.value.destroy()}),l({element:r,loading:t,error:u,focus:()=>r.value?.focus(),blur:()=>r.value?.blur(),clear:()=>r.value?.clear()}),(n,m)=>(e.openBlock(),e.createElementBlock("div",ee,[e.unref(u)?(e.openBlock(),e.createElementBlock("div",te,[e.renderSlot(n.$slots,"error",{error:e.unref(u)},()=>[e.createElementVNode("div",re,e.toDisplayString(e.unref(u)),1)],!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"elementRef",ref:a,class:e.normalizeClass(["vue-stripe-card-element-mount",{"vue-stripe-card-element-loading":e.unref(t)}])},null,2),e.unref(t)?(e.openBlock(),e.createElementBlock("div",ne,[e.renderSlot(n.$slots,"loading",{},()=>[m[0]||(m[0]=e.createElementVNode("div",{class:"vue-stripe-loading-message"}," Loading card form... ",-1))],!0)])):e.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-a41a7ee5"]]);function V({elementType:c,componentName:l}){return e.defineComponent({name:l,props:{options:{type:Object,default:()=>({})}},emits:["ready","change","focus","blur","escape"],setup(s,{emit:i,expose:o}){const a=e.ref(),r=e.ref(null),t=e.ref(!0),u=e.ref(null),f=e.inject(y);if(!f)throw new v(`${l} must be used within VueStripeElements`);const d=()=>{if(!f.elements.value){u.value="Elements instance not available",t.value=!1;return}if(!a.value){u.value="Mount point not available",t.value=!1;return}try{u.value=null,t.value=!0;const n=f.elements.value.create(c,s.options);r.value=n,n.on("ready",()=>{t.value=!1,i("ready",r.value)}),n.on("change",m=>{const g=m;g.error?u.value=g.error.message:u.value=null,i("change",g)}),n.on("focus",()=>{i("focus")}),n.on("blur",()=>{i("blur")}),n.on("escape",()=>{i("escape")}),n.mount(a.value)}catch(n){const m=n instanceof Error?n.message:`Failed to create ${c} element`;u.value=m,t.value=!1,console.error(`[Vue Stripe] ${l} creation error:`,m)}};return e.watch(()=>s.options,n=>{r.value?.update&&n&&r.value.update(n)},{deep:!0}),e.watch(()=>f.elements.value,n=>{n&&a.value&&!r.value&&d()},{immediate:!0}),e.onMounted(()=>{f.elements.value&&a.value&&!r.value&&d()}),e.onUnmounted(()=>{r.value&&r.value.destroy()}),o({element:r,loading:t,error:u,focus:()=>{r.value?.focus?.()},blur:()=>{r.value?.blur?.()},clear:()=>{r.value?.clear?.()}}),()=>{const n=`vue-stripe-${c}-element`;return e.h("div",{class:n},[u.value&&e.h("div",{class:`${n}-error`},[e.h("div",{class:"vue-stripe-error-message"},u.value)]),e.h("div",{ref:a,class:{[`${n}-mount`]:!0,[`${n}-loading`]:t.value}}),t.value&&e.h("div",{class:`${n}-loader`},[e.h("div",{class:"vue-stripe-loading-message"},`Loading ${c}...`)])])}}})}const ae=V({elementType:"cardNumber",componentName:"VueStripeCardNumberElement"}),le=V({elementType:"cardExpiry",componentName:"VueStripeCardExpiryElement"}),se=V({elementType:"cardCvc",componentName:"VueStripeCardCvcElement"}),ce=E(e.defineComponent({__name:"VueStripeLinkAuthenticationElement",props:{options:{}},emits:["ready","change"],setup(c,{expose:l,emit:s}){const i=c,o=s,a=e.inject(y);if(!a)throw new v("VueStripeLinkAuthenticationElement must be used within VueStripeElements");const r=e.ref(),t=e.ref(null),u=()=>{if(!(!a.elements?.value||!r.value))try{t.value=a.elements?.value.create("linkAuthentication",i.options),t.value.mount(r.value),t.value.on("ready",()=>{t.value&&o("ready",t.value)}),t.value.on("change",d=>{o("change",d)})}catch(d){console.error("[Vue Stripe] Link authentication element creation error:",d)}},f=()=>{t.value&&(t.value.unmount(),t.value.destroy(),t.value=null)};return e.watch(()=>a.elements?.value,d=>{d&&r.value&&!t.value&&u()},{immediate:!0}),e.watch(()=>i.options,d=>{t.value&&d&&typeof t.value.update=="function"&&t.value.update(d)},{deep:!0}),e.onMounted(()=>{a.elements?.value&&r.value&&u()}),e.onUnmounted(()=>{f()}),l({element:t,focus:()=>t.value?.focus(),blur:()=>t.value?.blur(),clear:()=>t.value?.clear()}),(d,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"elementRef",ref:r,class:"vue-stripe-link-auth-element"},null,512))}}),[["__scopeId","data-v-b79076eb"]]),ue=e.defineComponent({name:"VueStripeAddressElement",props:{options:{type:Object,default:()=>({mode:"shipping"})}},emits:["ready","change","blur","focus","escape","loadError"],setup(c,{emit:l,expose:s}){const i=e.ref(),o=e.ref(null),a=e.inject(y);if(!a)throw new v("VueStripeAddressElement must be used within VueStripeElements");const r=()=>{l("ready")},t=b=>{l("change",b)},u=()=>{l("blur")},f=()=>{l("focus")},d=()=>{l("escape")},n=b=>{l("loadError",b)},m=()=>{!a.elements.value||!i.value||(o.value=a.elements.value.create("address",c.options),o.value.mount(i.value),o.value.on("ready",r),o.value.on("change",t),o.value.on("blur",u),o.value.on("focus",f),o.value.on("escape",d),o.value.on("loaderror",n))},g=()=>{o.value&&o.value.update(c.options)},Ee=()=>{o.value&&(o.value.off("ready",r),o.value.off("change",t),o.value.off("blur",u),o.value.off("focus",f),o.value.off("escape",d),o.value.off("loaderror",n),o.value.destroy(),o.value=null)},B=async()=>{if(!o.value)throw new v("Address element not mounted");return o.value.getValue()},M=()=>{o.value?.focus()},P=()=>{o.value?.clear()};return e.onMounted(()=>{m()}),e.onBeforeUnmount(()=>{Ee()}),e.watch(()=>c.options,()=>{g()},{deep:!0}),s({element:o,getValue:B,focus:M,clear:P}),{addressRef:i,element:o,getValue:B,focus:M,clear:P}}}),ie={ref:"addressRef"};function de(c,l,s,i,o,a){return e.openBlock(),e.createElementBlock("div",ie,null,512)}const pe=E(ue,[["render",de]]);function _(){const c=e.inject(k);if(!c)throw new h("useStripe must be called within a VueStripeProvider component");return{stripe:e.readonly(c.stripe),loading:e.readonly(c.loading),error:e.readonly(c.error),initialize:async()=>{}}}const fe=["disabled"],me=E(e.defineComponent({__name:"VueStripeCheckout",props:{sessionId:{},priceId:{},mode:{default:"payment"},successUrl:{},cancelUrl:{},customerEmail:{},clientReferenceId:{},submitType:{},options:{},buttonText:{default:"Checkout"},loadingText:{default:"Redirecting..."},disabled:{type:Boolean,default:!1},buttonClass:{default:"vue-stripe-checkout-button"}},emits:["click","success","error"],setup(c,{emit:l}){const s=c,i=l,{stripe:o}=_(),a=e.ref(!1),r=async()=>{if(!o.value){const t=new h("Stripe not initialized");i("error",t);return}if(!s.sessionId&&!s.priceId){const t=new h("Either sessionId or priceId is required");i("error",t);return}try{a.value=!0,i("click");let t;if(s.sessionId?t=await o.value.redirectToCheckout({sessionId:s.sessionId,...s.options}):t=await o.value.redirectToCheckout({lineItems:[{price:s.priceId,quantity:1}],mode:s.mode,successUrl:s.successUrl||window.location.origin+"/success",cancelUrl:s.cancelUrl||window.location.origin+"/cancel",customerEmail:s.customerEmail,clientReferenceId:s.clientReferenceId,submitType:s.submitType}),t.error)throw new h(t.error.message||"Redirect to checkout failed");i("success")}catch(t){const u=t instanceof Error?t:new Error("Checkout failed");i("error",u),console.error("[Vue Stripe] Checkout error:",u)}finally{a.value=!1}};return(t,u)=>(e.openBlock(),e.createElementBlock("button",{disabled:e.unref(a)||c.disabled,class:e.normalizeClass(c.buttonClass),onClick:r},[e.unref(a)?e.renderSlot(t.$slots,"loading",{key:1},()=>[u[0]||(u[0]=e.createElementVNode("span",{class:"vue-stripe-loading-spinner"},null,-1)),e.createTextVNode(" "+e.toDisplayString(c.loadingText),1)],!0):e.renderSlot(t.$slots,"default",{key:0},()=>[e.createTextVNode(e.toDisplayString(c.buttonText),1)],!0)],10,fe))}}),[["__scopeId","data-v-b439ab37"]]);function he(){const c=e.inject(k),l=e.inject(y);if(!c)throw new h("usePaymentIntent must be called within a VueStripeProvider component");const s=e.ref(!1),i=e.ref(null);return{confirmPayment:async a=>{if(!c.stripe.value)return i.value="Stripe not initialized",{error:{message:"Stripe not initialized"}};s.value=!0,i.value=null;try{const r=a.elements??l?.elements.value;if(r&&!a.skipSubmit){const{error:u}=await r.submit();if(u)return i.value=u.message||"Form validation failed",{error:u}}const t=await c.stripe.value.confirmPayment({elements:r??void 0,clientSecret:a.clientSecret,confirmParams:a.confirmParams??{},redirect:a.redirect??"if_required"});return t.error&&(i.value=t.error.message||"Payment confirmation failed"),t}catch(r){const t=r instanceof Error?r.message:"Payment confirmation failed";return i.value=t,{error:{message:t}}}finally{s.value=!1}},loading:e.readonly(s),error:e.readonly(i)}}function ye(){const c=e.inject(k),l=e.inject(y);if(!c)throw new h("useSetupIntent must be called within a VueStripeProvider component");const s=e.ref(!1),i=e.ref(null);return{confirmSetup:async a=>{if(!c.stripe.value)return i.value="Stripe not initialized",{error:{message:"Stripe not initialized"}};s.value=!0,i.value=null;try{const r=a.elements??l?.elements.value;if(r&&!a.skipSubmit){const{error:u}=await r.submit();if(u)return i.value=u.message||"Form validation failed",{error:u}}const t=await c.stripe.value.confirmSetup({elements:r??void 0,clientSecret:a.clientSecret,confirmParams:a.confirmParams??{},redirect:a.redirect??"if_required"});return t.error&&(i.value=t.error.message||"Setup confirmation failed"),t}catch(r){const t=r instanceof Error?r.message:"Setup confirmation failed";return i.value=t,{error:{message:t}}}finally{s.value=!1}},loading:e.readonly(s),error:e.readonly(i)}}function $(){const{stripe:c}=_(),l=e.ref(!1),s=e.ref(null);return{redirectToCheckout:async o=>{if(!c.value)throw new h("Stripe not initialized");try{l.value=!0,s.value=null;const a=await c.value.redirectToCheckout(o);if(a.error){const r=a.error.message||"Checkout redirect failed";throw s.value=r,new h(r)}}catch(a){const r=a instanceof Error?a.message:"Checkout redirect failed";throw s.value=r,a}finally{l.value=!1}},loading:e.readonly(l),error:e.readonly(s)}}function I(){const c=e.inject(y);if(!c)throw new v("Elements context not found. Make sure to wrap your component with VueStripeElements.");const l=async()=>c.elements.value?c.elements.value.submit():{error:{message:"Elements not initialized"}};return{elements:e.readonly(c.elements),submit:l,loading:e.readonly(c.loading),error:e.readonly(c.error)}}function ve(c){return{install(l){l.provide("vue-stripe-config",c);let s=null;l.provide("vue-stripe-global",{get stripe(){if(!s){const i={};c.stripeAccount&&(i.stripeAccount=c.stripeAccount),c.apiVersion&&(i.apiVersion=c.apiVersion),c.locale&&(i.locale=c.locale),s=S.loadStripe(c.publishableKey,i).then(o=>(o&&o.registerAppInfo(C),o))}return s}})}}}Object.defineProperty(p,"loadStripe",{enumerable:!0,get:()=>S.loadStripe}),p.VueStripeAddressElement=pe,p.VueStripeCardCvcElement=se,p.VueStripeCardElement=oe,p.VueStripeCardExpiryElement=le,p.VueStripeCardNumberElement=ae,p.VueStripeCheckout=me,p.VueStripeElements=x,p.VueStripeElementsError=v,p.VueStripeExpressCheckoutElement=D,p.VueStripeLinkAuthenticationElement=ce,p.VueStripeLoadError=w,p.VueStripePaymentElement=H,p.VueStripeProvider=U,p.VueStripeProviderError=h,p.createVueStripe=ve,p.createVueStripeError=N,p.useCheckout=$,p.useElements=I,p.usePaymentIntent=he,p.useSetupIntent=ye,p.useStripe=_,p.useStripeCheckout=$,p.useStripeElements=I,Object.defineProperty(p,Symbol.toStringTag,{value:"Module"})}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.vue-stripe-error[data-v-ce126b08]{color:#dc3545;padding:1rem;border:1px solid #dc3545;border-radius:4px;background-color:#f8d7da}.vue-stripe-loading[data-v-ce126b08]{color:#6c757d;padding:1rem;text-align:center}.vue-stripe-error-message[data-v-ce126b08],.vue-stripe-loading-message[data-v-ce126b08]{margin:0;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif}.vue-stripe-elements-error[data-v-478abfa3]{color:#dc3545;padding:1rem;border:1px solid #dc3545;border-radius:4px;background-color:#f8d7da}.vue-stripe-elements-loading[data-v-478abfa3]{color:#6c757d;padding:1rem;text-align:center}.vue-stripe-error-message[data-v-478abfa3],.vue-stripe-loading-message[data-v-478abfa3]{margin:0;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif}.vue-stripe-payment-element[data-v-2477e9df]{position:relative}.vue-stripe-payment-element-mount[data-v-2477e9df]{min-height:300px;transition:opacity .3s ease}.vue-stripe-payment-element-loading[data-v-2477e9df]{opacity:.5}.vue-stripe-payment-element-error[data-v-2477e9df]{color:#dc3545;padding:.75rem;margin-bottom:1rem;border:1px solid #dc3545;border-radius:4px;background-color:#f8d7da;font-size:.875rem}.vue-stripe-payment-element-loader[data-v-2477e9df]{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);color:#6c757d;text-align:center}.vue-stripe-error-message[data-v-2477e9df],.vue-stripe-loading-message[data-v-2477e9df]{margin:0;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif}.vue-stripe-express-checkout-element[data-v-20294cda]{position:relative}.vue-stripe-express-checkout-element-mount[data-v-20294cda]{min-height:60px;transition:opacity .3s ease}.vue-stripe-express-checkout-element-loading[data-v-20294cda]{opacity:.5}.vue-stripe-express-checkout-element-error[data-v-20294cda]{color:#dc3545;padding:.75rem;margin-bottom:1rem;border:1px solid #dc3545;border-radius:4px;background-color:#f8d7da;font-size:.875rem}.vue-stripe-express-checkout-element-loader[data-v-20294cda]{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);color:#6c757d;text-align:center}.vue-stripe-error-message[data-v-20294cda],.vue-stripe-loading-message[data-v-20294cda]{margin:0;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif}.vue-stripe-card-element[data-v-a41a7ee5]{position:relative}.vue-stripe-card-element-mount[data-v-a41a7ee5]{padding:12px;border:1px solid #e0e0e0;border-radius:4px;background-color:#fff;transition:all .3s ease;min-height:44px}.vue-stripe-card-element-mount[data-v-a41a7ee5]:focus-within{border-color:#3b82f6;box-shadow:0 0 0 3px #3b82f61a}.vue-stripe-card-element-loading[data-v-a41a7ee5]{opacity:.5}.vue-stripe-card-element-error[data-v-a41a7ee5]{color:#dc3545;padding:.5rem 0;font-size:.875rem}.vue-stripe-card-element-loader[data-v-a41a7ee5]{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);color:#6c757d;text-align:center}.vue-stripe-error-message[data-v-a41a7ee5],.vue-stripe-loading-message[data-v-a41a7ee5]{margin:0;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif}.vue-stripe-cardNumber-element{position:relative}.vue-stripe-cardNumber-element-mount{padding:12px;border:1px solid #e0e0e0;border-radius:4px;background-color:#fff;transition:all .3s ease;min-height:44px}.vue-stripe-cardNumber-element-mount:focus-within{border-color:#3b82f6;box-shadow:0 0 0 3px #3b82f61a}.vue-stripe-cardNumber-element-loading{opacity:.5}.vue-stripe-cardNumber-element-error{color:#dc3545;padding:.5rem 0;font-size:.875rem}.vue-stripe-cardNumber-element-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);color:#6c757d;text-align:center}.vue-stripe-error-message,.vue-stripe-loading-message{margin:0;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif}.vue-stripe-cardExpiry-element{position:relative}.vue-stripe-cardExpiry-element-mount{padding:12px;border:1px solid #e0e0e0;border-radius:4px;background-color:#fff;transition:all .3s ease;min-height:44px}.vue-stripe-cardExpiry-element-mount:focus-within{border-color:#3b82f6;box-shadow:0 0 0 3px #3b82f61a}.vue-stripe-cardExpiry-element-loading{opacity:.5}.vue-stripe-cardExpiry-element-error{color:#dc3545;padding:.5rem 0;font-size:.875rem}.vue-stripe-cardExpiry-element-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);color:#6c757d;text-align:center}.vue-stripe-cardCvc-element{position:relative}.vue-stripe-cardCvc-element-mount{padding:12px;border:1px solid #e0e0e0;border-radius:4px;background-color:#fff;transition:all .3s ease;min-height:44px}.vue-stripe-cardCvc-element-mount:focus-within{border-color:#3b82f6;box-shadow:0 0 0 3px #3b82f61a}.vue-stripe-cardCvc-element-loading{opacity:.5}.vue-stripe-cardCvc-element-error{color:#dc3545;padding:.5rem 0;font-size:.875rem}.vue-stripe-cardCvc-element-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);color:#6c757d;text-align:center}.vue-stripe-link-auth-element[data-v-b79076eb]{padding:12px;border:1px solid #ccc;border-radius:4px;background-color:#fff}.vue-stripe-link-auth-element[data-v-b79076eb]:focus-within{border-color:#635bff;box-shadow:0 0 0 1px #635bff}.vue-stripe-checkout-button[data-v-b439ab37]{background-color:#635bff;color:#fff;border:none;border-radius:4px;padding:12px 24px;font-size:16px;font-weight:500;cursor:pointer;transition:background-color .2s ease;display:inline-flex;align-items:center;gap:8px}.vue-stripe-checkout-button[data-v-b439ab37]:hover:not(:disabled){background-color:#5a52e8}.vue-stripe-checkout-button[data-v-b439ab37]:disabled{background-color:#ccc;cursor:not-allowed}.vue-stripe-loading-spinner[data-v-b439ab37]{width:16px;height:16px;border:2px solid #ffffff;border-top:2px solid transparent;border-radius:50%;animation:vue-stripe-spin-b439ab37 1s linear infinite}@keyframes vue-stripe-spin-b439ab37{0%{transform:rotate(0)}to{transform:rotate(360deg)}}
|
package/package.json
CHANGED
|
@@ -1,78 +1,79 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue-stripe/vue-stripe",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "Stripe
|
|
5
|
-
"author": "jofftiquez@gmail.com",
|
|
6
|
-
"
|
|
7
|
-
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"test": "jest"
|
|
11
|
-
},
|
|
12
|
-
"main": "dist/index.js",
|
|
13
|
-
"module": "dist",
|
|
14
|
-
"dependencies": {
|
|
15
|
-
"@stripe/stripe-js": "^1.13.2",
|
|
16
|
-
"vue-coerce-props": "^1.0.0"
|
|
17
|
-
},
|
|
18
|
-
"devDependencies": {
|
|
19
|
-
"@babel/cli": "^7.7.5",
|
|
20
|
-
"@babel/core": "^7.7.5",
|
|
21
|
-
"@babel/plugin-proposal-export-default-from": "^7.7.4",
|
|
22
|
-
"@babel/plugin-proposal-optional-chaining": "^7.10.4",
|
|
23
|
-
"@babel/plugin-transform-runtime": "^7.7.5",
|
|
24
|
-
"@babel/preset-env": "^7.7.5",
|
|
25
|
-
"@babel/preset-es2015": "^7.0.0-beta.53",
|
|
26
|
-
"@babel/runtime": "^7.7.5",
|
|
27
|
-
"@rollup/plugin-node-resolve": "^6.0.0",
|
|
28
|
-
"@vue/cli-plugin-eslint": "~4.5.0",
|
|
29
|
-
"@vue/cli-service": "^4.5.10",
|
|
30
|
-
"@vue/eslint-config-standard": "^5.1.2",
|
|
31
|
-
"babel-eslint": "^10.1.0",
|
|
32
|
-
"babel-minify": "^0.5.1",
|
|
33
|
-
"cross-env": "^6.0.3",
|
|
34
|
-
"eslint": "^6.8.0",
|
|
35
|
-
"eslint-plugin-import": "^2.20.2",
|
|
36
|
-
"eslint-plugin-node": "^11.1.0",
|
|
37
|
-
"eslint-plugin-promise": "^4.2.1",
|
|
38
|
-
"eslint-plugin-standard": "^4.0.0",
|
|
39
|
-
"eslint-plugin-vue": "^6.2.2",
|
|
40
|
-
"jest": "^24.9.0",
|
|
41
|
-
"lint-staged": "^9.5.0",
|
|
42
|
-
"rimraf": "^3.0.0",
|
|
43
|
-
"rollup": "^1.27.9",
|
|
44
|
-
"rollup-plugin-babel": "^4.3.3",
|
|
45
|
-
"rollup-plugin-commonjs": "^10.1.0",
|
|
46
|
-
"rollup-plugin-postcss": "^2.0.3",
|
|
47
|
-
"rollup-plugin-terser": "^5.1.3",
|
|
48
|
-
"rollup-plugin-uglify": "^6.0.3",
|
|
49
|
-
"rollup-plugin-vue": "^5.1.4",
|
|
50
|
-
"vue-template-compiler": "^2.6.11"
|
|
3
|
+
"version": "5.0.0",
|
|
4
|
+
"description": "Vue Stripe elements and composables for Stripe.js",
|
|
5
|
+
"author": "Joff Tiquez <jofftiquez@gmail.com>",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/vue-stripe/vue-stripe.git"
|
|
51
10
|
},
|
|
52
|
-
"
|
|
53
|
-
|
|
11
|
+
"homepage": "https://vuestripe.com",
|
|
12
|
+
"bugs": "https://github.com/vue-stripe/vue-stripe/issues",
|
|
13
|
+
"type": "module",
|
|
14
|
+
"main": "./dist/cjs/index.js",
|
|
15
|
+
"module": "./dist/es/index.js",
|
|
16
|
+
"types": "./dist/types/index.d.ts",
|
|
17
|
+
"unpkg": "./dist/umd/index.js",
|
|
18
|
+
"jsdelivr": "./dist/umd/index.js",
|
|
19
|
+
"sideEffects": false,
|
|
20
|
+
"exports": {
|
|
21
|
+
".": {
|
|
22
|
+
"types": "./dist/types/index.d.ts",
|
|
23
|
+
"import": "./dist/es/index.js",
|
|
24
|
+
"require": "./dist/cjs/index.js"
|
|
25
|
+
}
|
|
54
26
|
},
|
|
55
|
-
"
|
|
56
|
-
"
|
|
27
|
+
"files": [
|
|
28
|
+
"dist",
|
|
29
|
+
"README.md",
|
|
30
|
+
"CHANGELOG.md"
|
|
31
|
+
],
|
|
32
|
+
"scripts": {
|
|
33
|
+
"build": "vite build && tsc -p tsconfig.build.json",
|
|
34
|
+
"build:watch": "vite build --watch",
|
|
35
|
+
"dev": "vite build --watch",
|
|
36
|
+
"test": "vitest run",
|
|
37
|
+
"test:watch": "vitest",
|
|
38
|
+
"lint": "eslint src --ext .ts,.vue",
|
|
39
|
+
"lint:fix": "eslint src --ext .ts,.vue --fix",
|
|
40
|
+
"type-check": "vue-tsc --noEmit",
|
|
41
|
+
"typecheck": "vue-tsc --noEmit",
|
|
42
|
+
"clean": "rm -rf dist"
|
|
57
43
|
},
|
|
58
|
-
"homepage": "https://github.com/vue-stripe/vue-stripe#readme",
|
|
59
44
|
"keywords": [
|
|
60
45
|
"vue",
|
|
61
|
-
"
|
|
46
|
+
"vue2",
|
|
47
|
+
"vue3",
|
|
62
48
|
"stripe",
|
|
49
|
+
"payment",
|
|
63
50
|
"checkout",
|
|
64
|
-
"
|
|
51
|
+
"elements",
|
|
52
|
+
"composition-api",
|
|
53
|
+
"typescript"
|
|
65
54
|
],
|
|
66
|
-
"
|
|
67
|
-
|
|
68
|
-
"
|
|
69
|
-
"vue-cli-service lint",
|
|
70
|
-
"git add"
|
|
71
|
-
]
|
|
55
|
+
"peerDependencies": {
|
|
56
|
+
"@stripe/stripe-js": "^7.5.0",
|
|
57
|
+
"vue": "^2.6.0 || ^3.0.0"
|
|
72
58
|
},
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"url": "git@github.com:vue-stripe/vue-stripe.git"
|
|
59
|
+
"dependencies": {
|
|
60
|
+
"vue-demi": "^0.14.10"
|
|
76
61
|
},
|
|
77
|
-
"
|
|
78
|
-
|
|
62
|
+
"devDependencies": {
|
|
63
|
+
"@eslint/js": "^9.31.0",
|
|
64
|
+
"@stripe/stripe-js": "^7.5.0",
|
|
65
|
+
"@vitejs/plugin-vue": "^6.0.1",
|
|
66
|
+
"@vue-stripe/eslint-config": "workspace:*",
|
|
67
|
+
"@vue-stripe/typescript-config": "workspace:*",
|
|
68
|
+
"@vue/test-utils": "^2.4.6",
|
|
69
|
+
"eslint-plugin-vue": "^10.3.0",
|
|
70
|
+
"jsdom": "^26.1.0",
|
|
71
|
+
"typescript": "^5.9.3",
|
|
72
|
+
"typescript-eslint": "^8.46.2",
|
|
73
|
+
"vite": "^7.1.11",
|
|
74
|
+
"vite-plugin-dts": "^4.5.4",
|
|
75
|
+
"vitest": "^3.2.4",
|
|
76
|
+
"vue": "^3.5.22",
|
|
77
|
+
"vue-tsc": "^3.0.3"
|
|
78
|
+
}
|
|
79
|
+
}
|
package/CONTRIBUTING.md
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
# Request for contributions
|
|
2
|
-
|
|
3
|
-
Please contribute to this repository if any of the following is true:
|
|
4
|
-
- You have expertise in community development, communication, or education
|
|
5
|
-
- You want open source communities to be more collaborative and inclusive
|
|
6
|
-
- You want to help lower the burden to first time contributors
|
|
7
|
-
|
|
8
|
-
# How to contribute
|
|
9
|
-
|
|
10
|
-
Prerequisites:
|
|
11
|
-
|
|
12
|
-
- Familiarity with [pull requests](https://help.github.com/articles/using-pull-requests) and [issues](https://guides.github.com/features/issues/).
|
|
13
|
-
- Knowledge of [Markdown](https://help.github.com/articles/markdown-basics/) for editing `.md` documents.
|
|
14
|
-
|
|
15
|
-
In particular, this community seeks the following types of contributions:
|
|
16
|
-
|
|
17
|
-
- **Ideas**: participate in an issue thread or start your own to have your voice
|
|
18
|
-
heard.
|
|
19
|
-
- **Resources**: submit a pull request to add to RESOURCES.md with links to related content.
|
|
20
|
-
- **Outline sections**: help us ensure that this repository is comprehensive. if
|
|
21
|
-
there is a topic that is overlooked, please add it, even if it is just a stub
|
|
22
|
-
in the form of a header and single sentence. Initially, most things fall into
|
|
23
|
-
this category.
|
|
24
|
-
- **Writing**: contribute your expertise in an area by helping us expand the included
|
|
25
|
-
content.
|
|
26
|
-
- **Copy editing**: fix typos, clarify language, and generally improve the quality
|
|
27
|
-
of the content.
|
|
28
|
-
- **Formatting**: help keep content easy to read with consistent formatting.
|
|
29
|
-
|
|
30
|
-
# Conduct
|
|
31
|
-
|
|
32
|
-
We are committed to providing a friendly, safe and welcoming environment for
|
|
33
|
-
all, regardless of gender, sexual orientation, disability, ethnicity, religion,
|
|
34
|
-
or similar personal characteristic.
|
|
35
|
-
|
|
36
|
-
On IRC, please avoid using overtly sexual nicknames or other nicknames that
|
|
37
|
-
might detract from a friendly, safe and welcoming environment for all.
|
|
38
|
-
|
|
39
|
-
Please be kind and courteous. There's no need to be mean or rude.
|
|
40
|
-
Respect that people have differences of opinion and that every design or
|
|
41
|
-
implementation choice carries a trade-off and numerous costs. There is seldom
|
|
42
|
-
a right answer, merely an optimal answer given a set of values and
|
|
43
|
-
circumstances.
|
|
44
|
-
|
|
45
|
-
Please keep unstructured critique to a minimum. If you have solid ideas you
|
|
46
|
-
want to experiment with, make a fork and see how it works.
|
|
47
|
-
|
|
48
|
-
We will exclude you from interaction if you insult, demean or harass anyone.
|
|
49
|
-
That is not welcome behaviour. We interpret the term "harassment" as
|
|
50
|
-
including the definition in the
|
|
51
|
-
[Citizen Code of Conduct](http://citizencodeofconduct.org/);
|
|
52
|
-
if you have any lack of clarity about what might be included in that concept,
|
|
53
|
-
please read their definition. In particular, we don't tolerate behavior that
|
|
54
|
-
excludes people in socially marginalized groups.
|
|
55
|
-
|
|
56
|
-
Private harassment is also unacceptable. No matter who you are, if you feel
|
|
57
|
-
you have been or are being harassed or made uncomfortable by a community
|
|
58
|
-
member, please contact one of the channel ops or any of the
|
|
59
|
-
[CONTRIBUTING.md](https://github.com/jden/CONTRIBUTING.md) core team
|
|
60
|
-
immediately. Whether you're a regular contributor or a newcomer, we care about
|
|
61
|
-
making this community a safe place for you and we've got your back.
|
|
62
|
-
|
|
63
|
-
Likewise any spamming, trolling, flaming, baiting or other attention-stealing
|
|
64
|
-
behaviour is not welcome.
|
|
65
|
-
|
|
66
|
-
# Communication
|
|
67
|
-
|
|
68
|
-
There is an IRC channel on irc.freenode.net, channel `#CONTRIBUTING.md`. You're
|
|
69
|
-
welcome to drop in and ask questions, discuss bugs and such. The channel is
|
|
70
|
-
not currently logged.
|
|
71
|
-
|
|
72
|
-
GitHub issues are the primary way for communicating about specific proposed
|
|
73
|
-
changes to this project.
|
|
74
|
-
|
|
75
|
-
In both contexts, please follow the conduct guidelines above. Language issues
|
|
76
|
-
are often contentious and we'd like to keep discussion brief, civil and focused
|
|
77
|
-
on what we're actually doing, not wandering off into too much imaginary stuff.
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2021 Jofferson Ramirez Tiquez
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
package/babel.config.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
module.exports = function (api) {
|
|
2
|
-
api.cache(true);
|
|
3
|
-
|
|
4
|
-
const presets = [
|
|
5
|
-
'@babel/preset-env',
|
|
6
|
-
// 'minify'
|
|
7
|
-
];
|
|
8
|
-
const plugins = [
|
|
9
|
-
'@babel/transform-runtime',
|
|
10
|
-
'@babel/plugin-proposal-export-default-from',
|
|
11
|
-
'@babel/plugin-proposal-optional-chaining',
|
|
12
|
-
];
|
|
13
|
-
// const ignore = [
|
|
14
|
-
// '**/*.test.js',
|
|
15
|
-
// ];
|
|
16
|
-
|
|
17
|
-
return {
|
|
18
|
-
presets,
|
|
19
|
-
plugins,
|
|
20
|
-
// ignore
|
|
21
|
-
};
|
|
22
|
-
};
|