@vue-stripe/vue-stripe 4.5.0 → 5.1.1
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 +190 -47
- package/dist/cjs/index.js +1 -0
- package/dist/es/index.js +943 -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 +74 -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 +72 -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 +66 -65
- 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,12 @@
|
|
|
1
|
+
export { default as VueStripeProvider } from './VueStripeProvider.vue';
|
|
2
|
+
export { default as VueStripeElements } from './VueStripeElements.vue';
|
|
3
|
+
export { default as VueStripePaymentElement } from './VueStripePaymentElement.vue';
|
|
4
|
+
export { default as VueStripeExpressCheckoutElement } from './VueStripeExpressCheckoutElement.vue';
|
|
5
|
+
export { default as VueStripeCardElement } from './VueStripeCardElement.vue';
|
|
6
|
+
export { default as VueStripeCardNumberElement } from './VueStripeCardNumberElement.vue';
|
|
7
|
+
export { default as VueStripeCardExpiryElement } from './VueStripeCardExpiryElement.vue';
|
|
8
|
+
export { default as VueStripeCardCvcElement } from './VueStripeCardCvcElement.vue';
|
|
9
|
+
export { default as VueStripeLinkAuthenticationElement } from './VueStripeLinkAuthenticationElement.vue';
|
|
10
|
+
export { default as VueStripeAddressElement } from './VueStripeAddressElement.vue';
|
|
11
|
+
export { default as VueStripeCheckout } from './VueStripeCheckout.vue';
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AACtE,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AAGtE,OAAO,EAAE,OAAO,IAAI,uBAAuB,EAAE,MAAM,+BAA+B,CAAA;AAClF,OAAO,EAAE,OAAO,IAAI,+BAA+B,EAAE,MAAM,uCAAuC,CAAA;AAGlG,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,4BAA4B,CAAA;AAC5E,OAAO,EAAE,OAAO,IAAI,0BAA0B,EAAE,MAAM,kCAAkC,CAAA;AACxF,OAAO,EAAE,OAAO,IAAI,0BAA0B,EAAE,MAAM,kCAAkC,CAAA;AACxF,OAAO,EAAE,OAAO,IAAI,uBAAuB,EAAE,MAAM,+BAA+B,CAAA;AAGlF,OAAO,EAAE,OAAO,IAAI,kCAAkC,EAAE,MAAM,0CAA0C,CAAA;AACxG,OAAO,EAAE,OAAO,IAAI,uBAAuB,EAAE,MAAM,+BAA+B,CAAA;AAGlF,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,yBAAyB,CAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { useStripe } from './useStripe';
|
|
2
|
+
export { usePaymentIntent } from './usePaymentIntent';
|
|
3
|
+
export { useSetupIntent } from './useSetupIntent';
|
|
4
|
+
export { useStripeCheckout, useStripeCheckout as useCheckout } from './useStripeCheckout';
|
|
5
|
+
export { useStripeElements, useStripeElements as useElements } from './useStripeElements';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/composables/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,IAAI,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACzF,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,IAAI,WAAW,EAAE,MAAM,qBAAqB,CAAA"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { ConfirmPaymentData, StripeElements } from '@stripe/stripe-js';
|
|
2
|
+
import { UsePaymentIntentReturn } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Options for confirming a payment
|
|
5
|
+
*/
|
|
6
|
+
export interface ConfirmPaymentOptions {
|
|
7
|
+
/** Client secret from the PaymentIntent */
|
|
8
|
+
clientSecret: string;
|
|
9
|
+
/** Additional confirmation parameters */
|
|
10
|
+
confirmParams?: ConfirmPaymentData;
|
|
11
|
+
/** Whether to redirect (defaults to 'if_required') */
|
|
12
|
+
redirect?: 'if_required' | 'always';
|
|
13
|
+
/** Optional elements override (uses injected elements if not provided) */
|
|
14
|
+
elements?: StripeElements;
|
|
15
|
+
/** Skip elements.submit() validation (not recommended, defaults to false) */
|
|
16
|
+
skipSubmit?: boolean;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Composable for handling payment intents
|
|
20
|
+
* Provides a convenient way to confirm payments
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```vue
|
|
24
|
+
* <script setup>
|
|
25
|
+
* import { usePaymentIntent } from '@vue-stripe/vue-stripe'
|
|
26
|
+
*
|
|
27
|
+
* const { confirmPayment, loading, error } = usePaymentIntent()
|
|
28
|
+
*
|
|
29
|
+
* const handleSubmit = async () => {
|
|
30
|
+
* const result = await confirmPayment({
|
|
31
|
+
* clientSecret: 'pi_xxx_secret_xxx',
|
|
32
|
+
* confirmParams: {
|
|
33
|
+
* return_url: 'https://example.com/checkout/complete',
|
|
34
|
+
* },
|
|
35
|
+
* })
|
|
36
|
+
*
|
|
37
|
+
* if (result.error) {
|
|
38
|
+
* // Handle error
|
|
39
|
+
* }
|
|
40
|
+
* }
|
|
41
|
+
* </script>
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
export declare function usePaymentIntent(): UsePaymentIntentReturn;
|
|
45
|
+
//# sourceMappingURL=usePaymentIntent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePaymentIntent.d.ts","sourceRoot":"","sources":["../../../src/composables/usePaymentIntent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAC3E,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAA;AAItD;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,2CAA2C;IAC3C,YAAY,EAAE,MAAM,CAAA;IACpB,yCAAyC;IACzC,aAAa,CAAC,EAAE,kBAAkB,CAAA;IAClC,sDAAsD;IACtD,QAAQ,CAAC,EAAE,aAAa,GAAG,QAAQ,CAAA;IACnC,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,cAAc,CAAA;IACzB,6EAA6E;IAC7E,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,gBAAgB,IAAI,sBAAsB,CAgEzD"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { StripeElements } from '@stripe/stripe-js';
|
|
2
|
+
import { UseSetupIntentReturn } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Options for confirming a setup
|
|
5
|
+
*/
|
|
6
|
+
export interface ConfirmSetupOptions {
|
|
7
|
+
/** Client secret from the SetupIntent */
|
|
8
|
+
clientSecret: string;
|
|
9
|
+
/** Additional confirmation parameters */
|
|
10
|
+
confirmParams?: {
|
|
11
|
+
return_url?: string;
|
|
12
|
+
payment_method_data?: {
|
|
13
|
+
billing_details?: {
|
|
14
|
+
name?: string;
|
|
15
|
+
email?: string;
|
|
16
|
+
phone?: string;
|
|
17
|
+
address?: {
|
|
18
|
+
line1?: string;
|
|
19
|
+
line2?: string;
|
|
20
|
+
city?: string;
|
|
21
|
+
state?: string;
|
|
22
|
+
postal_code?: string;
|
|
23
|
+
country?: string;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
/** Whether to redirect (defaults to 'if_required') */
|
|
29
|
+
redirect?: 'if_required' | 'always';
|
|
30
|
+
/** Optional elements override (uses injected elements if not provided) */
|
|
31
|
+
elements?: StripeElements;
|
|
32
|
+
/** Skip elements.submit() validation (not recommended, defaults to false) */
|
|
33
|
+
skipSubmit?: boolean;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Composable for handling setup intents
|
|
37
|
+
* Provides a convenient way to save payment methods for future use
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```vue
|
|
41
|
+
* <script setup>
|
|
42
|
+
* import { useSetupIntent } from '@vue-stripe/vue-stripe'
|
|
43
|
+
*
|
|
44
|
+
* const { confirmSetup, loading, error } = useSetupIntent()
|
|
45
|
+
*
|
|
46
|
+
* const handleSaveCard = async () => {
|
|
47
|
+
* const result = await confirmSetup({
|
|
48
|
+
* clientSecret: setupIntent.clientSecret,
|
|
49
|
+
* confirmParams: {
|
|
50
|
+
* return_url: 'https://example.com/account/cards',
|
|
51
|
+
* },
|
|
52
|
+
* })
|
|
53
|
+
*
|
|
54
|
+
* if (result.error) {
|
|
55
|
+
* // Handle error
|
|
56
|
+
* }
|
|
57
|
+
* }
|
|
58
|
+
* </script>
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
export declare function useSetupIntent(): UseSetupIntentReturn;
|
|
62
|
+
//# sourceMappingURL=useSetupIntent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSetupIntent.d.ts","sourceRoot":"","sources":["../../../src/composables/useSetupIntent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AACvD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AAIpD;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,yCAAyC;IACzC,YAAY,EAAE,MAAM,CAAA;IACpB,yCAAyC;IACzC,aAAa,CAAC,EAAE;QACd,UAAU,CAAC,EAAE,MAAM,CAAA;QACnB,mBAAmB,CAAC,EAAE;YACpB,eAAe,CAAC,EAAE;gBAChB,IAAI,CAAC,EAAE,MAAM,CAAA;gBACb,KAAK,CAAC,EAAE,MAAM,CAAA;gBACd,KAAK,CAAC,EAAE,MAAM,CAAA;gBACd,OAAO,CAAC,EAAE;oBACR,KAAK,CAAC,EAAE,MAAM,CAAA;oBACd,KAAK,CAAC,EAAE,MAAM,CAAA;oBACd,IAAI,CAAC,EAAE,MAAM,CAAA;oBACb,KAAK,CAAC,EAAE,MAAM,CAAA;oBACd,WAAW,CAAC,EAAE,MAAM,CAAA;oBACpB,OAAO,CAAC,EAAE,MAAM,CAAA;iBACjB,CAAA;aACF,CAAA;SACF,CAAA;KACF,CAAA;IACD,sDAAsD;IACtD,QAAQ,CAAC,EAAE,aAAa,GAAG,QAAQ,CAAA;IACnC,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,cAAc,CAAA;IACzB,6EAA6E;IAC7E,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,cAAc,IAAI,oBAAoB,CAgErD"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { UseStripeReturn } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Composable to access the Stripe instance
|
|
4
|
+
* Must be used within a VueStripeProvider component
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```vue
|
|
8
|
+
* <script setup>
|
|
9
|
+
* import { useStripe } from '@vue-stripe/vue-stripe'
|
|
10
|
+
*
|
|
11
|
+
* const { stripe, loading, error } = useStripe()
|
|
12
|
+
*
|
|
13
|
+
* const handlePayment = async () => {
|
|
14
|
+
* if (!stripe.value) return
|
|
15
|
+
*
|
|
16
|
+
* const result = await stripe.value.confirmPayment({
|
|
17
|
+
* elements,
|
|
18
|
+
* confirmParams: {
|
|
19
|
+
* return_url: 'https://example.com/checkout/complete',
|
|
20
|
+
* },
|
|
21
|
+
* })
|
|
22
|
+
* }
|
|
23
|
+
* </script>
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export declare function useStripe(): UseStripeReturn;
|
|
27
|
+
//# sourceMappingURL=useStripe.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useStripe.d.ts","sourceRoot":"","sources":["../../../src/composables/useStripe.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAI/C;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,SAAS,IAAI,eAAe,CAkB3C"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { Ref } from 'vue-demi';
|
|
2
|
+
/**
|
|
3
|
+
* Options for URL-based checkout redirect (v8.x compatible)
|
|
4
|
+
*/
|
|
5
|
+
export interface CheckoutRedirectOptions {
|
|
6
|
+
/** The checkout session URL from your server */
|
|
7
|
+
url: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Options for legacy redirectToCheckout (v7.x only)
|
|
11
|
+
* @deprecated Use CheckoutRedirectOptions with URL redirect instead
|
|
12
|
+
*/
|
|
13
|
+
export interface LegacyCheckoutOptions {
|
|
14
|
+
/** Checkout Session ID */
|
|
15
|
+
sessionId?: string;
|
|
16
|
+
/** Line items for client-side session creation */
|
|
17
|
+
lineItems?: Array<{
|
|
18
|
+
price: string;
|
|
19
|
+
quantity: number;
|
|
20
|
+
}>;
|
|
21
|
+
/** Checkout mode */
|
|
22
|
+
mode?: 'payment' | 'subscription' | 'setup';
|
|
23
|
+
/** Success redirect URL */
|
|
24
|
+
successUrl?: string;
|
|
25
|
+
/** Cancel redirect URL */
|
|
26
|
+
cancelUrl?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface UseStripeCheckoutReturn {
|
|
29
|
+
/**
|
|
30
|
+
* Redirect to Stripe Checkout using session URL (v8.x compatible, recommended)
|
|
31
|
+
*/
|
|
32
|
+
redirectToCheckout: (options: CheckoutRedirectOptions | LegacyCheckoutOptions) => Promise<void>;
|
|
33
|
+
/**
|
|
34
|
+
* Redirect to checkout using session URL (v8.x compatible)
|
|
35
|
+
*/
|
|
36
|
+
redirectToUrl: (url: string) => void;
|
|
37
|
+
loading: Readonly<Ref<boolean>>;
|
|
38
|
+
error: Readonly<Ref<string | null>>;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Composable for handling Stripe Checkout redirects.
|
|
42
|
+
*
|
|
43
|
+
* Supports both @stripe/stripe-js v7.x (redirectToCheckout) and v8.x (URL redirect).
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```vue
|
|
47
|
+
* <script setup>
|
|
48
|
+
* import { useStripeCheckout } from '@vue-stripe/vue-stripe'
|
|
49
|
+
*
|
|
50
|
+
* const { redirectToCheckout, redirectToUrl, loading, error } = useStripeCheckout()
|
|
51
|
+
*
|
|
52
|
+
* // v8.x compatible (recommended)
|
|
53
|
+
* const handleCheckout = async () => {
|
|
54
|
+
* const response = await fetch('/api/create-checkout-session', {
|
|
55
|
+
* method: 'POST',
|
|
56
|
+
* body: JSON.stringify({ priceId: 'price_xxx' })
|
|
57
|
+
* })
|
|
58
|
+
* const { url } = await response.json()
|
|
59
|
+
* redirectToUrl(url)
|
|
60
|
+
* }
|
|
61
|
+
*
|
|
62
|
+
* // Or using redirectToCheckout with URL
|
|
63
|
+
* const handleCheckoutAlt = async () => {
|
|
64
|
+
* const response = await fetch('/api/create-checkout-session')
|
|
65
|
+
* const { url } = await response.json()
|
|
66
|
+
* await redirectToCheckout({ url })
|
|
67
|
+
* }
|
|
68
|
+
* </script>
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
export declare function useStripeCheckout(): UseStripeCheckoutReturn;
|
|
72
|
+
//# sourceMappingURL=useStripeCheckout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useStripeCheckout.d.ts","sourceRoot":"","sources":["../../../src/composables/useStripeCheckout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,GAAG,EAAE,MAAM,UAAU,CAAA;AAIlD;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,gDAAgD;IAChD,GAAG,EAAE,MAAM,CAAA;CACZ;AAED;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,0BAA0B;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,kDAAkD;IAClD,SAAS,CAAC,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IACtD,oBAAoB;IACpB,IAAI,CAAC,EAAE,SAAS,GAAG,cAAc,GAAG,OAAO,CAAA;IAC3C,2BAA2B;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,0BAA0B;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,WAAW,uBAAuB;IACtC;;OAEG;IACH,kBAAkB,EAAE,CAAC,OAAO,EAAE,uBAAuB,GAAG,qBAAqB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IAC/F;;OAEG;IACH,aAAa,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAA;IACpC,OAAO,EAAE,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAA;IAC/B,KAAK,EAAE,QAAQ,CAAC,GAAG,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC,CAAA;CACpC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,iBAAiB,IAAI,uBAAuB,CAiF3D"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { UseStripeElementsReturn } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Composable for accessing Stripe Elements instance
|
|
4
|
+
* Must be used within VueStripeElements component
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```vue
|
|
8
|
+
* <script setup>
|
|
9
|
+
* import { useStripeElements } from '@vue-stripe/vue-stripe'
|
|
10
|
+
*
|
|
11
|
+
* const { elements, submit, loading, error } = useStripeElements()
|
|
12
|
+
*
|
|
13
|
+
* const handleSubmit = async () => {
|
|
14
|
+
* // Trigger form validation and wallet collection
|
|
15
|
+
* const { error: submitError } = await submit()
|
|
16
|
+
* if (submitError) {
|
|
17
|
+
* console.error(submitError)
|
|
18
|
+
* return
|
|
19
|
+
* }
|
|
20
|
+
* // Proceed with payment confirmation...
|
|
21
|
+
* }
|
|
22
|
+
* </script>
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export declare function useStripeElements(): UseStripeElementsReturn;
|
|
26
|
+
//# sourceMappingURL=useStripeElements.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useStripeElements.d.ts","sourceRoot":"","sources":["../../../src/composables/useStripeElements.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAA;AAIvD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,iBAAiB,IAAI,uBAAuB,CA6B3D"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type { VueStripeOptions, VueStripeElement, VueStripeProviderProps, VueStripeElementsProps, VueStripeElementEvents, UseStripeReturn, UseStripeElementsReturn, UsePaymentIntentReturn, UseSetupIntentReturn, PaymentElementType, ExpressCheckoutType, VueStripeError, VueStripeContext, VueStripeElementsContext, 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 './types';
|
|
2
|
+
export * from './components';
|
|
3
|
+
export * from './composables';
|
|
4
|
+
export { VueStripeProviderError, VueStripeElementsError, VueStripeLoadError, createVueStripeError } from './utils/errors';
|
|
5
|
+
export { createVueStripe } from './plugin';
|
|
6
|
+
export { loadStripe } from '@stripe/stripe-js';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAEA,YAAY,EAEV,gBAAgB,EAChB,gBAAgB,EAChB,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,eAAe,EACf,uBAAuB,EACvB,sBAAsB,EACtB,oBAAoB,EACpB,kBAAkB,EAClB,mBAAmB,EACnB,cAAc,EACd,gBAAgB,EAChB,wBAAwB,EAExB,MAAM,EACN,cAAc,EACd,aAAa,EACb,iBAAiB,EACjB,qBAAqB,EACrB,wBAAwB,EACxB,aAAa,EACb,WAAW,EACX,kBAAkB,EAClB,oBAAoB,EAEpB,iBAAiB,EACjB,uBAAuB,EACvB,uBAAuB,EACvB,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,EACpB,+BAA+B,EAC/B,4BAA4B,EAE5B,4BAA4B,EAC5B,+BAA+B,EAC/B,+BAA+B,EAC/B,0CAA0C,EAC1C,wCAAwC,EACxC,sCAAsC,EACvC,MAAM,SAAS,CAAA;AAGhB,cAAc,cAAc,CAAA;AAG5B,cAAc,eAAe,CAAA;AAG7B,OAAO,EACL,sBAAsB,EACtB,sBAAsB,EACtB,kBAAkB,EAClB,oBAAoB,EACrB,MAAM,gBAAgB,CAAA;AAGvB,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAG1C,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Plugin } from 'vue-demi';
|
|
2
|
+
import { VueStripeOptions } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Vue Stripe Plugin
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```ts
|
|
8
|
+
* import { createApp } from 'vue'
|
|
9
|
+
* import { createVueStripe } from '@vue-stripe/vue-stripe'
|
|
10
|
+
*
|
|
11
|
+
* const app = createApp(App)
|
|
12
|
+
* const vueStripe = createVueStripe({
|
|
13
|
+
* publishableKey: 'pk_test_...',
|
|
14
|
+
* stripeAccount: 'acct_...', // optional
|
|
15
|
+
* apiVersion: '2023-10-16', // optional
|
|
16
|
+
* locale: 'en' // optional
|
|
17
|
+
* })
|
|
18
|
+
*
|
|
19
|
+
* app.use(vueStripe)
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export declare function createVueStripe(options: VueStripeOptions): Plugin;
|
|
23
|
+
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAO,MAAM,EAAE,MAAM,UAAU,CAAA;AAC3C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAI/C;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,gBAAgB,GAAG,MAAM,CA6BjE"}
|