@vue-stripe/vue-stripe 5.0.0 → 5.2.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 +52 -12
- package/dist/cjs/index.js +1 -1
- package/dist/es/index.js +957 -561
- package/dist/types/components/VueStripeCheckout.vue.d.ts +35 -11
- package/dist/types/components/VueStripeCheckout.vue.d.ts.map +1 -1
- package/dist/types/components/VueStripeEpsBankElement.vue.d.ts +155 -0
- package/dist/types/components/VueStripeEpsBankElement.vue.d.ts.map +1 -0
- package/dist/types/components/VueStripeIbanElement.vue.d.ts +155 -0
- package/dist/types/components/VueStripeIbanElement.vue.d.ts.map +1 -0
- package/dist/types/components/VueStripeIdealBankElement.vue.d.ts +155 -0
- package/dist/types/components/VueStripeIdealBankElement.vue.d.ts.map +1 -0
- package/dist/types/components/VueStripeP24BankElement.vue.d.ts +155 -0
- package/dist/types/components/VueStripeP24BankElement.vue.d.ts.map +1 -0
- package/dist/types/components/index.d.ts +4 -0
- package/dist/types/components/index.d.ts.map +1 -1
- package/dist/types/composables/useStripeCheckout.d.ts +65 -2
- package/dist/types/composables/useStripeCheckout.d.ts.map +1 -1
- package/dist/types/tsconfig.build.tsbuildinfo +1 -1
- package/dist/umd/index.js +1 -1
- package/dist/vue-stripe.css +1 -1
- package/package.json +3 -3
package/dist/es/index.js
CHANGED
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
import { loadStripe as
|
|
2
|
-
import { loadStripe as
|
|
3
|
-
import { defineComponent as
|
|
4
|
-
const
|
|
5
|
-
class
|
|
6
|
-
constructor(
|
|
7
|
-
super(
|
|
1
|
+
import { loadStripe as q } from "@stripe/stripe-js";
|
|
2
|
+
import { loadStripe as bt } from "@stripe/stripe-js";
|
|
3
|
+
import { defineComponent as V, ref as p, onMounted as I, provide as B, createElementBlock as f, unref as m, openBlock as h, renderSlot as b, createElementVNode as g, toDisplayString as P, inject as _, watch as y, onUnmounted as x, createCommentVNode as k, normalizeClass as T, h as M, onBeforeUnmount as G, readonly as $, useSlots as H, computed as J, Fragment as j, createTextVNode as K } from "vue-demi";
|
|
4
|
+
const A = Symbol("stripe"), S = Symbol("stripe-elements");
|
|
5
|
+
class E extends Error {
|
|
6
|
+
constructor(l) {
|
|
7
|
+
super(l), this.name = "VueStripeProviderError";
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
|
-
class
|
|
11
|
-
constructor(
|
|
12
|
-
super(
|
|
10
|
+
class w extends Error {
|
|
11
|
+
constructor(l) {
|
|
12
|
+
super(l), this.name = "VueStripeElementsError";
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
|
-
class
|
|
16
|
-
constructor(
|
|
17
|
-
super(
|
|
15
|
+
class Q extends Error {
|
|
16
|
+
constructor(l) {
|
|
17
|
+
super(l), this.name = "VueStripeLoadError";
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
-
function
|
|
21
|
-
switch (
|
|
20
|
+
function Qe(u, l) {
|
|
21
|
+
switch (u) {
|
|
22
22
|
case "provider":
|
|
23
|
-
return new
|
|
23
|
+
return new E(l);
|
|
24
24
|
case "elements":
|
|
25
|
-
return new
|
|
25
|
+
return new w(l);
|
|
26
26
|
case "load":
|
|
27
|
-
return new
|
|
27
|
+
return new Q(l);
|
|
28
28
|
default:
|
|
29
|
-
return new Error(
|
|
29
|
+
return new Error(l);
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
|
-
const
|
|
32
|
+
const D = {
|
|
33
33
|
name: "vue-stripe",
|
|
34
|
-
version: "5.
|
|
34
|
+
version: "5.2.0",
|
|
35
35
|
url: "https://vuestripe.com",
|
|
36
36
|
partner_id: "pp_partner_IqtOXpBSuz0IE2"
|
|
37
|
-
},
|
|
37
|
+
}, Y = {
|
|
38
38
|
key: 0,
|
|
39
39
|
class: "vue-stripe-error"
|
|
40
|
-
},
|
|
40
|
+
}, Z = { class: "vue-stripe-error-message" }, O = {
|
|
41
41
|
key: 1,
|
|
42
42
|
class: "vue-stripe-loading"
|
|
43
|
-
},
|
|
43
|
+
}, ee = { key: 2 }, te = /* @__PURE__ */ V({
|
|
44
44
|
__name: "VueStripeProvider",
|
|
45
45
|
props: {
|
|
46
46
|
publishableKey: {},
|
|
@@ -51,59 +51,59 @@ const j = {
|
|
|
51
51
|
options: {}
|
|
52
52
|
},
|
|
53
53
|
emits: ["load", "error"],
|
|
54
|
-
setup(
|
|
55
|
-
const
|
|
56
|
-
if (!
|
|
57
|
-
throw new
|
|
58
|
-
const
|
|
59
|
-
publishableKey:
|
|
60
|
-
stripeAccount:
|
|
61
|
-
apiVersion:
|
|
62
|
-
locale:
|
|
63
|
-
},
|
|
54
|
+
setup(u, { emit: l }) {
|
|
55
|
+
const i = u, o = l, n = p(null), a = p(!0), e = p(null), r = i.publishableKey || i.stripeKey;
|
|
56
|
+
if (!r)
|
|
57
|
+
throw new E("publishableKey or stripeKey is required");
|
|
58
|
+
const s = {
|
|
59
|
+
publishableKey: r,
|
|
60
|
+
stripeAccount: i.stripeAccount || i.options?.stripeAccount,
|
|
61
|
+
apiVersion: i.apiVersion || i.options?.apiVersion,
|
|
62
|
+
locale: i.locale || i.options?.locale
|
|
63
|
+
}, v = async () => {
|
|
64
64
|
try {
|
|
65
|
-
|
|
66
|
-
const
|
|
67
|
-
if (
|
|
68
|
-
throw new
|
|
69
|
-
n.value.registerAppInfo(
|
|
70
|
-
} catch (
|
|
71
|
-
const
|
|
72
|
-
|
|
65
|
+
a.value = !0, e.value = null;
|
|
66
|
+
const d = {}, t = i.stripeAccount || i.options?.stripeAccount, c = i.apiVersion || i.options?.apiVersion, R = i.locale || i.options?.locale;
|
|
67
|
+
if (t && (d.stripeAccount = t), c && (d.apiVersion = c), R && (d.locale = R), n.value = await q(r, d), !n.value)
|
|
68
|
+
throw new E("Failed to initialize Stripe");
|
|
69
|
+
n.value.registerAppInfo(D), o("load", n.value);
|
|
70
|
+
} catch (d) {
|
|
71
|
+
const t = d instanceof Error ? d.message : "Failed to load Stripe";
|
|
72
|
+
e.value = t, console.error("[Vue Stripe] Initialization error:", t), o("error", d instanceof Error ? d : new Error(t));
|
|
73
73
|
} finally {
|
|
74
|
-
|
|
74
|
+
a.value = !1;
|
|
75
75
|
}
|
|
76
76
|
};
|
|
77
77
|
return I(() => {
|
|
78
|
-
|
|
79
|
-
}),
|
|
78
|
+
v();
|
|
79
|
+
}), B("vue-stripe-config", s), B(A, {
|
|
80
80
|
stripe: n,
|
|
81
|
-
loading:
|
|
82
|
-
error:
|
|
83
|
-
}), (
|
|
84
|
-
|
|
85
|
-
|
|
81
|
+
loading: a,
|
|
82
|
+
error: e
|
|
83
|
+
}), (d, t) => m(e) ? (h(), f("div", Y, [
|
|
84
|
+
b(d.$slots, "error", { error: m(e) }, () => [
|
|
85
|
+
g("div", Z, P(m(e)), 1)
|
|
86
86
|
], !0)
|
|
87
|
-
])) :
|
|
88
|
-
|
|
89
|
-
|
|
87
|
+
])) : m(a) ? (h(), f("div", O, [
|
|
88
|
+
b(d.$slots, "loading", {}, () => [
|
|
89
|
+
t[0] || (t[0] = g("div", { class: "vue-stripe-loading-message" }, " Loading Stripe... ", -1))
|
|
90
90
|
], !0)
|
|
91
|
-
])) : (h(), f("div",
|
|
92
|
-
|
|
91
|
+
])) : (h(), f("div", ee, [
|
|
92
|
+
b(d.$slots, "default", {}, void 0, !0)
|
|
93
93
|
]));
|
|
94
94
|
}
|
|
95
|
-
}), C = (
|
|
96
|
-
const
|
|
97
|
-
for (const [
|
|
98
|
-
o
|
|
99
|
-
return
|
|
100
|
-
},
|
|
95
|
+
}), C = (u, l) => {
|
|
96
|
+
const i = u.__vccOpts || u;
|
|
97
|
+
for (const [o, n] of l)
|
|
98
|
+
i[o] = n;
|
|
99
|
+
return i;
|
|
100
|
+
}, Ye = /* @__PURE__ */ C(te, [["__scopeId", "data-v-ce126b08"]]), re = {
|
|
101
101
|
key: 0,
|
|
102
102
|
class: "vue-stripe-elements-error"
|
|
103
|
-
},
|
|
103
|
+
}, se = { class: "vue-stripe-error-message" }, ne = {
|
|
104
104
|
key: 1,
|
|
105
105
|
class: "vue-stripe-elements-loading"
|
|
106
|
-
},
|
|
106
|
+
}, ae = { key: 2 }, le = /* @__PURE__ */ V({
|
|
107
107
|
__name: "VueStripeElements",
|
|
108
108
|
props: {
|
|
109
109
|
clientSecret: {},
|
|
@@ -115,323 +115,323 @@ const j = {
|
|
|
115
115
|
paymentMethodTypes: {},
|
|
116
116
|
options: {}
|
|
117
117
|
},
|
|
118
|
-
setup(
|
|
119
|
-
const
|
|
120
|
-
if (!
|
|
121
|
-
throw new
|
|
118
|
+
setup(u) {
|
|
119
|
+
const l = u, i = _(A);
|
|
120
|
+
if (!i)
|
|
121
|
+
throw new E(
|
|
122
122
|
"VueStripeElements must be used within VueStripeProvider"
|
|
123
123
|
);
|
|
124
|
-
const
|
|
125
|
-
if (!
|
|
126
|
-
|
|
124
|
+
const o = p(null), n = p(!0), a = p(null), e = () => {
|
|
125
|
+
if (!i.stripe.value) {
|
|
126
|
+
a.value = "Stripe instance not available", n.value = !1;
|
|
127
127
|
return;
|
|
128
128
|
}
|
|
129
129
|
try {
|
|
130
|
-
|
|
131
|
-
const
|
|
132
|
-
...
|
|
130
|
+
a.value = null, n.value = !0;
|
|
131
|
+
const r = {
|
|
132
|
+
...l.options
|
|
133
133
|
};
|
|
134
|
-
|
|
135
|
-
} catch (
|
|
136
|
-
const
|
|
137
|
-
|
|
134
|
+
l.clientSecret && (r.clientSecret = l.clientSecret), l.mode && (r.mode = l.mode), l.currency && (r.currency = l.currency), l.amount !== void 0 && (r.amount = l.amount), l.setupFutureUsage && (r.setupFutureUsage = l.setupFutureUsage), l.captureMethod && (r.captureMethod = l.captureMethod), l.paymentMethodTypes && (r.paymentMethodTypes = l.paymentMethodTypes), o.value = i.stripe.value.elements(r), n.value = !1;
|
|
135
|
+
} catch (r) {
|
|
136
|
+
const s = r instanceof Error ? r.message : "Failed to create elements";
|
|
137
|
+
a.value = s, n.value = !1, console.error("[Vue Stripe] Elements creation error:", s);
|
|
138
138
|
}
|
|
139
139
|
};
|
|
140
|
-
return
|
|
141
|
-
() =>
|
|
142
|
-
(
|
|
143
|
-
|
|
140
|
+
return y(
|
|
141
|
+
() => i.stripe.value,
|
|
142
|
+
(r) => {
|
|
143
|
+
r && !o.value && e();
|
|
144
144
|
},
|
|
145
145
|
{ immediate: !0 }
|
|
146
|
-
),
|
|
147
|
-
() =>
|
|
146
|
+
), y(
|
|
147
|
+
() => l.clientSecret,
|
|
148
148
|
() => {
|
|
149
|
-
|
|
149
|
+
i.stripe.value && e();
|
|
150
150
|
}
|
|
151
|
-
),
|
|
152
|
-
() => [
|
|
151
|
+
), y(
|
|
152
|
+
() => [l.mode, l.currency, l.amount, l.setupFutureUsage],
|
|
153
153
|
() => {
|
|
154
|
-
|
|
154
|
+
i.stripe.value && e();
|
|
155
155
|
}
|
|
156
156
|
), I(() => {
|
|
157
|
-
|
|
158
|
-
}),
|
|
159
|
-
elements:
|
|
157
|
+
i.stripe.value && !o.value && e();
|
|
158
|
+
}), B(S, {
|
|
159
|
+
elements: o,
|
|
160
160
|
loading: n,
|
|
161
|
-
error:
|
|
162
|
-
}), (
|
|
163
|
-
|
|
164
|
-
|
|
161
|
+
error: a
|
|
162
|
+
}), (r, s) => m(a) ? (h(), f("div", re, [
|
|
163
|
+
b(r.$slots, "error", { error: m(a) }, () => [
|
|
164
|
+
g("div", se, P(m(a)), 1)
|
|
165
165
|
], !0)
|
|
166
|
-
])) :
|
|
167
|
-
|
|
168
|
-
|
|
166
|
+
])) : m(n) ? (h(), f("div", ne, [
|
|
167
|
+
b(r.$slots, "loading", {}, () => [
|
|
168
|
+
s[0] || (s[0] = g("div", { class: "vue-stripe-loading-message" }, " Initializing Elements... ", -1))
|
|
169
169
|
], !0)
|
|
170
|
-
])) : (h(), f("div",
|
|
171
|
-
|
|
170
|
+
])) : (h(), f("div", ae, [
|
|
171
|
+
b(r.$slots, "default", {}, void 0, !0)
|
|
172
172
|
]));
|
|
173
173
|
}
|
|
174
|
-
}),
|
|
174
|
+
}), Ze = /* @__PURE__ */ C(le, [["__scopeId", "data-v-478abfa3"]]), oe = { class: "vue-stripe-payment-element" }, ue = {
|
|
175
175
|
key: 0,
|
|
176
176
|
class: "vue-stripe-payment-element-error"
|
|
177
|
-
},
|
|
177
|
+
}, ie = { class: "vue-stripe-error-message" }, ce = {
|
|
178
178
|
key: 1,
|
|
179
179
|
class: "vue-stripe-payment-element-loader"
|
|
180
|
-
},
|
|
180
|
+
}, ve = /* @__PURE__ */ V({
|
|
181
181
|
__name: "VueStripePaymentElement",
|
|
182
182
|
props: {
|
|
183
183
|
options: {}
|
|
184
184
|
},
|
|
185
185
|
emits: ["ready", "change", "focus", "blur", "escape", "loaderstart", "loaderstop"],
|
|
186
|
-
setup(
|
|
187
|
-
const
|
|
188
|
-
if (!
|
|
189
|
-
throw new
|
|
186
|
+
setup(u, { expose: l, emit: i }) {
|
|
187
|
+
const o = u, n = i, a = p(), e = p(null), r = p(!0), s = p(null), v = _(S);
|
|
188
|
+
if (!v)
|
|
189
|
+
throw new w(
|
|
190
190
|
"VueStripePaymentElement must be used within VueStripeElements"
|
|
191
191
|
);
|
|
192
|
-
const
|
|
193
|
-
if (!
|
|
194
|
-
|
|
192
|
+
const d = () => {
|
|
193
|
+
if (!v.elements.value) {
|
|
194
|
+
s.value = "Elements instance not available", r.value = !1;
|
|
195
195
|
return;
|
|
196
196
|
}
|
|
197
|
-
if (!
|
|
198
|
-
|
|
197
|
+
if (!a.value) {
|
|
198
|
+
s.value = "Mount point not available", r.value = !1;
|
|
199
199
|
return;
|
|
200
200
|
}
|
|
201
201
|
try {
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
}),
|
|
205
|
-
n("change",
|
|
206
|
-
}),
|
|
202
|
+
s.value = null, r.value = !0, e.value = v.elements.value.create("payment", o.options), e.value.on("ready", () => {
|
|
203
|
+
r.value = !1, n("ready", e.value);
|
|
204
|
+
}), e.value.on("change", (c) => {
|
|
205
|
+
n("change", c);
|
|
206
|
+
}), e.value.on("focus", () => {
|
|
207
207
|
n("focus");
|
|
208
|
-
}),
|
|
208
|
+
}), e.value.on("blur", () => {
|
|
209
209
|
n("blur");
|
|
210
|
-
}),
|
|
210
|
+
}), e.value.on("escape", () => {
|
|
211
211
|
n("escape");
|
|
212
212
|
});
|
|
213
|
-
const
|
|
214
|
-
|
|
213
|
+
const t = e.value;
|
|
214
|
+
t.on("loaderstart", () => {
|
|
215
215
|
n("loaderstart");
|
|
216
|
-
}),
|
|
216
|
+
}), t.on("loaderstop", () => {
|
|
217
217
|
n("loaderstop");
|
|
218
|
-
}),
|
|
219
|
-
} catch (
|
|
220
|
-
const
|
|
221
|
-
|
|
218
|
+
}), e.value.mount(a.value);
|
|
219
|
+
} catch (t) {
|
|
220
|
+
const c = t instanceof Error ? t.message : "Failed to create payment element";
|
|
221
|
+
s.value = c, r.value = !1, console.error("[Vue Stripe] Payment element creation error:", c);
|
|
222
222
|
}
|
|
223
223
|
};
|
|
224
|
-
return
|
|
225
|
-
() =>
|
|
226
|
-
(
|
|
227
|
-
|
|
224
|
+
return y(
|
|
225
|
+
() => o.options,
|
|
226
|
+
(t) => {
|
|
227
|
+
e.value && t && e.value.update(t);
|
|
228
228
|
},
|
|
229
229
|
{ deep: !0 }
|
|
230
|
-
),
|
|
231
|
-
() =>
|
|
232
|
-
(
|
|
233
|
-
|
|
230
|
+
), y(
|
|
231
|
+
() => v.elements.value,
|
|
232
|
+
(t) => {
|
|
233
|
+
t && a.value && !e.value && d();
|
|
234
234
|
},
|
|
235
235
|
{ immediate: !0 }
|
|
236
236
|
), I(() => {
|
|
237
|
-
|
|
238
|
-
}),
|
|
239
|
-
|
|
240
|
-
}),
|
|
241
|
-
element:
|
|
242
|
-
loading:
|
|
243
|
-
error:
|
|
244
|
-
}), (
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
237
|
+
v.elements.value && a.value && !e.value && d();
|
|
238
|
+
}), x(() => {
|
|
239
|
+
e.value && e.value.destroy();
|
|
240
|
+
}), l({
|
|
241
|
+
element: e,
|
|
242
|
+
loading: r,
|
|
243
|
+
error: s
|
|
244
|
+
}), (t, c) => (h(), f("div", oe, [
|
|
245
|
+
m(s) ? (h(), f("div", ue, [
|
|
246
|
+
b(t.$slots, "error", { error: m(s) }, () => [
|
|
247
|
+
g("div", ie, P(m(s)), 1)
|
|
248
248
|
], !0)
|
|
249
|
-
])) :
|
|
250
|
-
|
|
249
|
+
])) : k("", !0),
|
|
250
|
+
g("div", {
|
|
251
251
|
ref_key: "elementRef",
|
|
252
|
-
ref:
|
|
253
|
-
class: T(["vue-stripe-payment-element-mount", { "vue-stripe-payment-element-loading":
|
|
252
|
+
ref: a,
|
|
253
|
+
class: T(["vue-stripe-payment-element-mount", { "vue-stripe-payment-element-loading": m(r) }])
|
|
254
254
|
}, null, 2),
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
255
|
+
m(r) ? (h(), f("div", ce, [
|
|
256
|
+
b(t.$slots, "loading", {}, () => [
|
|
257
|
+
c[0] || (c[0] = g("div", { class: "vue-stripe-loading-message" }, " Loading payment form... ", -1))
|
|
258
258
|
], !0)
|
|
259
|
-
])) :
|
|
259
|
+
])) : k("", !0)
|
|
260
260
|
]));
|
|
261
261
|
}
|
|
262
|
-
}),
|
|
262
|
+
}), Oe = /* @__PURE__ */ C(ve, [["__scopeId", "data-v-2477e9df"]]), de = { class: "vue-stripe-express-checkout-element" }, pe = {
|
|
263
263
|
key: 0,
|
|
264
264
|
class: "vue-stripe-express-checkout-element-error"
|
|
265
|
-
},
|
|
265
|
+
}, me = { class: "vue-stripe-error-message" }, fe = {
|
|
266
266
|
key: 1,
|
|
267
267
|
class: "vue-stripe-express-checkout-element-loader"
|
|
268
|
-
},
|
|
268
|
+
}, he = /* @__PURE__ */ V({
|
|
269
269
|
__name: "VueStripeExpressCheckoutElement",
|
|
270
270
|
props: {
|
|
271
271
|
options: {}
|
|
272
272
|
},
|
|
273
273
|
emits: ["ready", "click", "confirm", "cancel", "shippingaddresschange", "shippingratechange"],
|
|
274
|
-
setup(
|
|
275
|
-
const
|
|
276
|
-
if (!
|
|
277
|
-
throw new
|
|
274
|
+
setup(u, { expose: l, emit: i }) {
|
|
275
|
+
const o = u, n = i, a = p(), e = p(null), r = p(!0), s = p(null), v = _(S);
|
|
276
|
+
if (!v)
|
|
277
|
+
throw new w(
|
|
278
278
|
"VueStripeExpressCheckoutElement must be used within VueStripeElements"
|
|
279
279
|
);
|
|
280
|
-
const
|
|
281
|
-
if (!
|
|
282
|
-
|
|
280
|
+
const d = () => {
|
|
281
|
+
if (!v.elements.value) {
|
|
282
|
+
s.value = "Elements instance not available", r.value = !1;
|
|
283
283
|
return;
|
|
284
284
|
}
|
|
285
|
-
if (!
|
|
286
|
-
|
|
285
|
+
if (!a.value) {
|
|
286
|
+
s.value = "Mount point not available", r.value = !1;
|
|
287
287
|
return;
|
|
288
288
|
}
|
|
289
289
|
try {
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
}),
|
|
293
|
-
n("click",
|
|
294
|
-
}),
|
|
295
|
-
n("confirm",
|
|
296
|
-
}),
|
|
290
|
+
s.value = null, r.value = !0, e.value = v.elements.value.create("expressCheckout", o.options), e.value.on("ready", (t) => {
|
|
291
|
+
r.value = !1, n("ready", t);
|
|
292
|
+
}), e.value.on("click", (t) => {
|
|
293
|
+
n("click", t);
|
|
294
|
+
}), e.value.on("confirm", (t) => {
|
|
295
|
+
n("confirm", t);
|
|
296
|
+
}), e.value.on("cancel", () => {
|
|
297
297
|
n("cancel");
|
|
298
|
-
}),
|
|
299
|
-
n("shippingaddresschange",
|
|
300
|
-
}),
|
|
301
|
-
n("shippingratechange",
|
|
302
|
-
}),
|
|
303
|
-
} catch (
|
|
304
|
-
const
|
|
305
|
-
|
|
298
|
+
}), e.value.on("shippingaddresschange", (t) => {
|
|
299
|
+
n("shippingaddresschange", t);
|
|
300
|
+
}), e.value.on("shippingratechange", (t) => {
|
|
301
|
+
n("shippingratechange", t);
|
|
302
|
+
}), e.value.mount(a.value);
|
|
303
|
+
} catch (t) {
|
|
304
|
+
const c = t instanceof Error ? t.message : "Failed to create express checkout element";
|
|
305
|
+
s.value = c, r.value = !1, console.error("[Vue Stripe] Express checkout element creation error:", c);
|
|
306
306
|
}
|
|
307
307
|
};
|
|
308
|
-
return
|
|
309
|
-
() =>
|
|
310
|
-
(
|
|
311
|
-
|
|
308
|
+
return y(
|
|
309
|
+
() => o.options,
|
|
310
|
+
(t) => {
|
|
311
|
+
e.value && t && e.value.update(t);
|
|
312
312
|
},
|
|
313
313
|
{ deep: !0 }
|
|
314
|
-
),
|
|
315
|
-
() =>
|
|
316
|
-
(
|
|
317
|
-
|
|
314
|
+
), y(
|
|
315
|
+
() => v.elements.value,
|
|
316
|
+
(t) => {
|
|
317
|
+
t && a.value && !e.value && d();
|
|
318
318
|
},
|
|
319
319
|
{ immediate: !0 }
|
|
320
320
|
), I(() => {
|
|
321
|
-
|
|
322
|
-
}),
|
|
323
|
-
|
|
324
|
-
}),
|
|
325
|
-
element:
|
|
326
|
-
loading:
|
|
327
|
-
error:
|
|
328
|
-
}), (
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
321
|
+
v.elements.value && a.value && !e.value && d();
|
|
322
|
+
}), x(() => {
|
|
323
|
+
e.value && e.value.destroy();
|
|
324
|
+
}), l({
|
|
325
|
+
element: e,
|
|
326
|
+
loading: r,
|
|
327
|
+
error: s
|
|
328
|
+
}), (t, c) => (h(), f("div", de, [
|
|
329
|
+
m(s) ? (h(), f("div", pe, [
|
|
330
|
+
b(t.$slots, "error", { error: m(s) }, () => [
|
|
331
|
+
g("div", me, P(m(s)), 1)
|
|
332
332
|
], !0)
|
|
333
|
-
])) :
|
|
334
|
-
|
|
333
|
+
])) : k("", !0),
|
|
334
|
+
g("div", {
|
|
335
335
|
ref_key: "elementRef",
|
|
336
|
-
ref:
|
|
337
|
-
class: T(["vue-stripe-express-checkout-element-mount", { "vue-stripe-express-checkout-element-loading":
|
|
336
|
+
ref: a,
|
|
337
|
+
class: T(["vue-stripe-express-checkout-element-mount", { "vue-stripe-express-checkout-element-loading": m(r) }])
|
|
338
338
|
}, null, 2),
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
339
|
+
m(r) ? (h(), f("div", fe, [
|
|
340
|
+
b(t.$slots, "loading", {}, () => [
|
|
341
|
+
c[0] || (c[0] = g("div", { class: "vue-stripe-loading-message" }, " Loading express checkout... ", -1))
|
|
342
342
|
], !0)
|
|
343
|
-
])) :
|
|
343
|
+
])) : k("", !0)
|
|
344
344
|
]));
|
|
345
345
|
}
|
|
346
|
-
}),
|
|
346
|
+
}), et = /* @__PURE__ */ C(he, [["__scopeId", "data-v-20294cda"]]), ge = { class: "vue-stripe-card-element" }, ye = {
|
|
347
347
|
key: 0,
|
|
348
348
|
class: "vue-stripe-card-element-error"
|
|
349
|
-
},
|
|
349
|
+
}, be = { class: "vue-stripe-error-message" }, Ee = {
|
|
350
350
|
key: 1,
|
|
351
351
|
class: "vue-stripe-card-element-loader"
|
|
352
|
-
},
|
|
352
|
+
}, _e = /* @__PURE__ */ V({
|
|
353
353
|
__name: "VueStripeCardElement",
|
|
354
354
|
props: {
|
|
355
355
|
options: {}
|
|
356
356
|
},
|
|
357
357
|
emits: ["ready", "change", "focus", "blur", "escape"],
|
|
358
|
-
setup(
|
|
359
|
-
const
|
|
360
|
-
if (!
|
|
361
|
-
throw new
|
|
358
|
+
setup(u, { expose: l, emit: i }) {
|
|
359
|
+
const o = u, n = i, a = p(), e = p(null), r = p(!0), s = p(null), v = _(S);
|
|
360
|
+
if (!v)
|
|
361
|
+
throw new w(
|
|
362
362
|
"VueStripeCardElement must be used within VueStripeElements"
|
|
363
363
|
);
|
|
364
|
-
const
|
|
365
|
-
if (!
|
|
366
|
-
|
|
364
|
+
const d = () => {
|
|
365
|
+
if (!v.elements.value) {
|
|
366
|
+
s.value = "Elements instance not available", r.value = !1;
|
|
367
367
|
return;
|
|
368
368
|
}
|
|
369
|
-
if (!
|
|
370
|
-
|
|
369
|
+
if (!a.value) {
|
|
370
|
+
s.value = "Mount point not available", r.value = !1;
|
|
371
371
|
return;
|
|
372
372
|
}
|
|
373
373
|
try {
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
}),
|
|
377
|
-
|
|
378
|
-
}),
|
|
374
|
+
s.value = null, r.value = !0, e.value = v.elements.value.create("card", o.options), e.value.on("ready", () => {
|
|
375
|
+
r.value = !1, n("ready", e.value);
|
|
376
|
+
}), e.value.on("change", (t) => {
|
|
377
|
+
t.error ? s.value = t.error.message : s.value = null, n("change", t);
|
|
378
|
+
}), e.value.on("focus", () => {
|
|
379
379
|
n("focus");
|
|
380
|
-
}),
|
|
380
|
+
}), e.value.on("blur", () => {
|
|
381
381
|
n("blur");
|
|
382
|
-
}),
|
|
382
|
+
}), e.value.on("escape", () => {
|
|
383
383
|
n("escape");
|
|
384
|
-
}),
|
|
385
|
-
} catch (
|
|
386
|
-
const
|
|
387
|
-
|
|
384
|
+
}), e.value.mount(a.value);
|
|
385
|
+
} catch (t) {
|
|
386
|
+
const c = t instanceof Error ? t.message : "Failed to create card element";
|
|
387
|
+
s.value = c, r.value = !1, console.error("[Vue Stripe] Card element creation error:", c);
|
|
388
388
|
}
|
|
389
389
|
};
|
|
390
|
-
return
|
|
391
|
-
() =>
|
|
392
|
-
(
|
|
393
|
-
|
|
390
|
+
return y(
|
|
391
|
+
() => o.options,
|
|
392
|
+
(t) => {
|
|
393
|
+
e.value && t && e.value.update(t);
|
|
394
394
|
},
|
|
395
395
|
{ deep: !0 }
|
|
396
|
-
),
|
|
397
|
-
() =>
|
|
398
|
-
(
|
|
399
|
-
|
|
396
|
+
), y(
|
|
397
|
+
() => v.elements.value,
|
|
398
|
+
(t) => {
|
|
399
|
+
t && a.value && !e.value && d();
|
|
400
400
|
},
|
|
401
401
|
{ immediate: !0 }
|
|
402
402
|
), I(() => {
|
|
403
|
-
|
|
404
|
-
}),
|
|
405
|
-
|
|
406
|
-
}),
|
|
407
|
-
element:
|
|
408
|
-
loading:
|
|
409
|
-
error:
|
|
410
|
-
focus: () =>
|
|
411
|
-
blur: () =>
|
|
412
|
-
clear: () =>
|
|
413
|
-
}), (
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
403
|
+
v.elements.value && a.value && !e.value && d();
|
|
404
|
+
}), x(() => {
|
|
405
|
+
e.value && e.value.destroy();
|
|
406
|
+
}), l({
|
|
407
|
+
element: e,
|
|
408
|
+
loading: r,
|
|
409
|
+
error: s,
|
|
410
|
+
focus: () => e.value?.focus(),
|
|
411
|
+
blur: () => e.value?.blur(),
|
|
412
|
+
clear: () => e.value?.clear()
|
|
413
|
+
}), (t, c) => (h(), f("div", ge, [
|
|
414
|
+
m(s) ? (h(), f("div", ye, [
|
|
415
|
+
b(t.$slots, "error", { error: m(s) }, () => [
|
|
416
|
+
g("div", be, P(m(s)), 1)
|
|
417
417
|
], !0)
|
|
418
|
-
])) :
|
|
419
|
-
|
|
418
|
+
])) : k("", !0),
|
|
419
|
+
g("div", {
|
|
420
420
|
ref_key: "elementRef",
|
|
421
|
-
ref:
|
|
422
|
-
class: T(["vue-stripe-card-element-mount", { "vue-stripe-card-element-loading":
|
|
421
|
+
ref: a,
|
|
422
|
+
class: T(["vue-stripe-card-element-mount", { "vue-stripe-card-element-loading": m(r) }])
|
|
423
423
|
}, null, 2),
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
424
|
+
m(r) ? (h(), f("div", Ee, [
|
|
425
|
+
b(t.$slots, "loading", {}, () => [
|
|
426
|
+
c[0] || (c[0] = g("div", { class: "vue-stripe-loading-message" }, " Loading card form... ", -1))
|
|
427
427
|
], !0)
|
|
428
|
-
])) :
|
|
428
|
+
])) : k("", !0)
|
|
429
429
|
]));
|
|
430
430
|
}
|
|
431
|
-
}),
|
|
432
|
-
function L({ elementType:
|
|
433
|
-
return
|
|
434
|
-
name:
|
|
431
|
+
}), tt = /* @__PURE__ */ C(_e, [["__scopeId", "data-v-a41a7ee5"]]);
|
|
432
|
+
function L({ elementType: u, componentName: l }) {
|
|
433
|
+
return V({
|
|
434
|
+
name: l,
|
|
435
435
|
props: {
|
|
436
436
|
options: {
|
|
437
437
|
type: Object,
|
|
@@ -439,154 +439,154 @@ function L({ elementType: l, componentName: a }) {
|
|
|
439
439
|
}
|
|
440
440
|
},
|
|
441
441
|
emits: ["ready", "change", "focus", "blur", "escape"],
|
|
442
|
-
setup(
|
|
443
|
-
const
|
|
444
|
-
if (!
|
|
445
|
-
throw new
|
|
446
|
-
`${
|
|
442
|
+
setup(i, { emit: o, expose: n }) {
|
|
443
|
+
const a = p(), e = p(null), r = p(!0), s = p(null), v = _(S);
|
|
444
|
+
if (!v)
|
|
445
|
+
throw new w(
|
|
446
|
+
`${l} must be used within VueStripeElements`
|
|
447
447
|
);
|
|
448
|
-
const
|
|
449
|
-
if (!
|
|
450
|
-
|
|
448
|
+
const d = () => {
|
|
449
|
+
if (!v.elements.value) {
|
|
450
|
+
s.value = "Elements instance not available", r.value = !1;
|
|
451
451
|
return;
|
|
452
452
|
}
|
|
453
|
-
if (!
|
|
454
|
-
|
|
453
|
+
if (!a.value) {
|
|
454
|
+
s.value = "Mount point not available", r.value = !1;
|
|
455
455
|
return;
|
|
456
456
|
}
|
|
457
457
|
try {
|
|
458
|
-
|
|
459
|
-
const
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
}),
|
|
463
|
-
const
|
|
464
|
-
|
|
465
|
-
}),
|
|
466
|
-
|
|
467
|
-
}),
|
|
468
|
-
|
|
469
|
-
}),
|
|
470
|
-
|
|
471
|
-
}),
|
|
472
|
-
} catch (
|
|
473
|
-
const
|
|
474
|
-
|
|
458
|
+
s.value = null, r.value = !0;
|
|
459
|
+
const t = v.elements.value.create(u, i.options);
|
|
460
|
+
e.value = t, t.on("ready", () => {
|
|
461
|
+
r.value = !1, o("ready", e.value);
|
|
462
|
+
}), t.on("change", (c) => {
|
|
463
|
+
const R = c;
|
|
464
|
+
R.error ? s.value = R.error.message : s.value = null, o("change", R);
|
|
465
|
+
}), t.on("focus", () => {
|
|
466
|
+
o("focus");
|
|
467
|
+
}), t.on("blur", () => {
|
|
468
|
+
o("blur");
|
|
469
|
+
}), t.on("escape", () => {
|
|
470
|
+
o("escape");
|
|
471
|
+
}), t.mount(a.value);
|
|
472
|
+
} catch (t) {
|
|
473
|
+
const c = t instanceof Error ? t.message : `Failed to create ${u} element`;
|
|
474
|
+
s.value = c, r.value = !1, console.error(`[Vue Stripe] ${l} creation error:`, c);
|
|
475
475
|
}
|
|
476
476
|
};
|
|
477
|
-
return
|
|
478
|
-
() =>
|
|
479
|
-
(
|
|
480
|
-
|
|
477
|
+
return y(
|
|
478
|
+
() => i.options,
|
|
479
|
+
(t) => {
|
|
480
|
+
e.value?.update && t && e.value.update(t);
|
|
481
481
|
},
|
|
482
482
|
{ deep: !0 }
|
|
483
|
-
),
|
|
484
|
-
() =>
|
|
485
|
-
(
|
|
486
|
-
|
|
483
|
+
), y(
|
|
484
|
+
() => v.elements.value,
|
|
485
|
+
(t) => {
|
|
486
|
+
t && a.value && !e.value && d();
|
|
487
487
|
},
|
|
488
488
|
{ immediate: !0 }
|
|
489
489
|
), I(() => {
|
|
490
|
-
|
|
491
|
-
}),
|
|
492
|
-
|
|
490
|
+
v.elements.value && a.value && !e.value && d();
|
|
491
|
+
}), x(() => {
|
|
492
|
+
e.value && e.value.destroy();
|
|
493
493
|
}), n({
|
|
494
|
-
element:
|
|
495
|
-
loading:
|
|
496
|
-
error:
|
|
494
|
+
element: e,
|
|
495
|
+
loading: r,
|
|
496
|
+
error: s,
|
|
497
497
|
focus: () => {
|
|
498
|
-
|
|
498
|
+
e.value?.focus?.();
|
|
499
499
|
},
|
|
500
500
|
blur: () => {
|
|
501
|
-
|
|
501
|
+
e.value?.blur?.();
|
|
502
502
|
},
|
|
503
503
|
clear: () => {
|
|
504
|
-
|
|
504
|
+
e.value?.clear?.();
|
|
505
505
|
}
|
|
506
506
|
}), () => {
|
|
507
|
-
const
|
|
508
|
-
return
|
|
509
|
-
|
|
510
|
-
|
|
507
|
+
const t = `vue-stripe-${u}-element`;
|
|
508
|
+
return M("div", { class: t }, [
|
|
509
|
+
s.value && M("div", { class: `${t}-error` }, [
|
|
510
|
+
M("div", { class: "vue-stripe-error-message" }, s.value)
|
|
511
511
|
]),
|
|
512
|
-
|
|
513
|
-
ref:
|
|
512
|
+
M("div", {
|
|
513
|
+
ref: a,
|
|
514
514
|
class: {
|
|
515
|
-
[`${
|
|
516
|
-
[`${
|
|
515
|
+
[`${t}-mount`]: !0,
|
|
516
|
+
[`${t}-loading`]: r.value
|
|
517
517
|
}
|
|
518
518
|
}),
|
|
519
|
-
|
|
520
|
-
|
|
519
|
+
r.value && M("div", { class: `${t}-loader` }, [
|
|
520
|
+
M("div", { class: "vue-stripe-loading-message" }, `Loading ${u}...`)
|
|
521
521
|
])
|
|
522
522
|
]);
|
|
523
523
|
};
|
|
524
524
|
}
|
|
525
525
|
});
|
|
526
526
|
}
|
|
527
|
-
const
|
|
527
|
+
const rt = L({
|
|
528
528
|
elementType: "cardNumber",
|
|
529
529
|
componentName: "VueStripeCardNumberElement"
|
|
530
|
-
}),
|
|
530
|
+
}), st = L({
|
|
531
531
|
elementType: "cardExpiry",
|
|
532
532
|
componentName: "VueStripeCardExpiryElement"
|
|
533
|
-
}),
|
|
533
|
+
}), nt = L({
|
|
534
534
|
elementType: "cardCvc",
|
|
535
535
|
componentName: "VueStripeCardCvcElement"
|
|
536
|
-
}),
|
|
536
|
+
}), ke = /* @__PURE__ */ V({
|
|
537
537
|
__name: "VueStripeLinkAuthenticationElement",
|
|
538
538
|
props: {
|
|
539
539
|
options: {}
|
|
540
540
|
},
|
|
541
541
|
emits: ["ready", "change"],
|
|
542
|
-
setup(
|
|
543
|
-
const
|
|
544
|
-
if (!
|
|
545
|
-
throw new
|
|
542
|
+
setup(u, { expose: l, emit: i }) {
|
|
543
|
+
const o = u, n = i, a = _(S);
|
|
544
|
+
if (!a)
|
|
545
|
+
throw new w(
|
|
546
546
|
"VueStripeLinkAuthenticationElement must be used within VueStripeElements"
|
|
547
547
|
);
|
|
548
|
-
const
|
|
549
|
-
if (!(!
|
|
548
|
+
const e = p(), r = p(null), s = () => {
|
|
549
|
+
if (!(!a.elements?.value || !e.value))
|
|
550
550
|
try {
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
}),
|
|
554
|
-
n("change",
|
|
551
|
+
r.value = a.elements?.value.create("linkAuthentication", o.options), r.value.mount(e.value), r.value.on("ready", () => {
|
|
552
|
+
r.value && n("ready", r.value);
|
|
553
|
+
}), r.value.on("change", (d) => {
|
|
554
|
+
n("change", d);
|
|
555
555
|
});
|
|
556
|
-
} catch (
|
|
557
|
-
console.error("[Vue Stripe] Link authentication element creation error:",
|
|
556
|
+
} catch (d) {
|
|
557
|
+
console.error("[Vue Stripe] Link authentication element creation error:", d);
|
|
558
558
|
}
|
|
559
|
-
},
|
|
560
|
-
|
|
559
|
+
}, v = () => {
|
|
560
|
+
r.value && (r.value.unmount(), r.value.destroy(), r.value = null);
|
|
561
561
|
};
|
|
562
|
-
return
|
|
563
|
-
() =>
|
|
564
|
-
(
|
|
565
|
-
|
|
562
|
+
return y(
|
|
563
|
+
() => a.elements?.value,
|
|
564
|
+
(d) => {
|
|
565
|
+
d && e.value && !r.value && s();
|
|
566
566
|
},
|
|
567
567
|
{ immediate: !0 }
|
|
568
|
-
),
|
|
569
|
-
() =>
|
|
570
|
-
(
|
|
571
|
-
|
|
568
|
+
), y(
|
|
569
|
+
() => o.options,
|
|
570
|
+
(d) => {
|
|
571
|
+
r.value && d && typeof r.value.update == "function" && r.value.update(d);
|
|
572
572
|
},
|
|
573
573
|
{ deep: !0 }
|
|
574
574
|
), I(() => {
|
|
575
|
-
|
|
576
|
-
}),
|
|
577
|
-
|
|
578
|
-
}),
|
|
579
|
-
element:
|
|
580
|
-
focus: () =>
|
|
581
|
-
blur: () =>
|
|
582
|
-
clear: () =>
|
|
583
|
-
}), (
|
|
575
|
+
a.elements?.value && e.value && s();
|
|
576
|
+
}), x(() => {
|
|
577
|
+
v();
|
|
578
|
+
}), l({
|
|
579
|
+
element: r,
|
|
580
|
+
focus: () => r.value?.focus(),
|
|
581
|
+
blur: () => r.value?.blur(),
|
|
582
|
+
clear: () => r.value?.clear()
|
|
583
|
+
}), (d, t) => (h(), f("div", {
|
|
584
584
|
ref_key: "elementRef",
|
|
585
|
-
ref:
|
|
585
|
+
ref: e,
|
|
586
586
|
class: "vue-stripe-link-auth-element"
|
|
587
587
|
}, null, 512));
|
|
588
588
|
}
|
|
589
|
-
}),
|
|
589
|
+
}), at = /* @__PURE__ */ C(ke, [["__scopeId", "data-v-b79076eb"]]), Se = V({
|
|
590
590
|
name: "VueStripeAddressElement",
|
|
591
591
|
props: {
|
|
592
592
|
options: {
|
|
@@ -597,79 +597,425 @@ const Re = L({
|
|
|
597
597
|
}
|
|
598
598
|
},
|
|
599
599
|
emits: ["ready", "change", "blur", "focus", "escape", "loadError"],
|
|
600
|
-
setup(
|
|
601
|
-
const
|
|
602
|
-
if (!
|
|
603
|
-
throw new
|
|
604
|
-
const
|
|
605
|
-
|
|
606
|
-
},
|
|
607
|
-
|
|
608
|
-
},
|
|
609
|
-
|
|
610
|
-
},
|
|
611
|
-
|
|
600
|
+
setup(u, { emit: l, expose: i }) {
|
|
601
|
+
const o = p(), n = p(null), a = _(S);
|
|
602
|
+
if (!a)
|
|
603
|
+
throw new w("VueStripeAddressElement must be used within VueStripeElements");
|
|
604
|
+
const e = () => {
|
|
605
|
+
l("ready");
|
|
606
|
+
}, r = (U) => {
|
|
607
|
+
l("change", U);
|
|
608
|
+
}, s = () => {
|
|
609
|
+
l("blur");
|
|
610
|
+
}, v = () => {
|
|
611
|
+
l("focus");
|
|
612
|
+
}, d = () => {
|
|
613
|
+
l("escape");
|
|
614
|
+
}, t = (U) => {
|
|
615
|
+
l("loadError", U);
|
|
612
616
|
}, c = () => {
|
|
613
|
-
a("escape");
|
|
614
|
-
},
|
|
615
|
-
|
|
616
|
-
},
|
|
617
|
-
|
|
618
|
-
},
|
|
619
|
-
n.value && n.value.update(l.options);
|
|
620
|
-
}, O = () => {
|
|
621
|
-
n.value && (n.value.off("ready", t), n.value.off("change", e), n.value.off("blur", u), n.value.off("focus", p), n.value.off("escape", c), n.value.off("loaderror", r), n.value.destroy(), n.value = null);
|
|
622
|
-
}, U = async () => {
|
|
617
|
+
!a.elements.value || !o.value || (n.value = a.elements.value.create("address", u.options), n.value.mount(o.value), n.value.on("ready", e), n.value.on("change", r), n.value.on("blur", s), n.value.on("focus", v), n.value.on("escape", d), n.value.on("loaderror", t));
|
|
618
|
+
}, R = () => {
|
|
619
|
+
n.value && n.value.update(u.options);
|
|
620
|
+
}, X = () => {
|
|
621
|
+
n.value && (n.value.off("ready", e), n.value.off("change", r), n.value.off("blur", s), n.value.off("focus", v), n.value.off("escape", d), n.value.off("loaderror", t), n.value.destroy(), n.value = null);
|
|
622
|
+
}, F = async () => {
|
|
623
623
|
if (!n.value)
|
|
624
|
-
throw new
|
|
624
|
+
throw new w("Address element not mounted");
|
|
625
625
|
return n.value.getValue();
|
|
626
|
-
},
|
|
626
|
+
}, z = () => {
|
|
627
627
|
n.value?.focus();
|
|
628
628
|
}, N = () => {
|
|
629
629
|
n.value?.clear();
|
|
630
630
|
};
|
|
631
631
|
return I(() => {
|
|
632
|
-
|
|
633
|
-
}),
|
|
634
|
-
|
|
635
|
-
}),
|
|
636
|
-
|
|
637
|
-
}, { deep: !0 }),
|
|
632
|
+
c();
|
|
633
|
+
}), G(() => {
|
|
634
|
+
X();
|
|
635
|
+
}), y(() => u.options, () => {
|
|
636
|
+
R();
|
|
637
|
+
}, { deep: !0 }), i({
|
|
638
638
|
element: n,
|
|
639
|
-
getValue:
|
|
640
|
-
focus:
|
|
639
|
+
getValue: F,
|
|
640
|
+
focus: z,
|
|
641
641
|
clear: N
|
|
642
642
|
}), {
|
|
643
|
-
addressRef:
|
|
643
|
+
addressRef: o,
|
|
644
644
|
element: n,
|
|
645
|
-
getValue:
|
|
646
|
-
focus:
|
|
645
|
+
getValue: F,
|
|
646
|
+
focus: z,
|
|
647
647
|
clear: N
|
|
648
648
|
};
|
|
649
649
|
}
|
|
650
|
-
}),
|
|
651
|
-
function
|
|
652
|
-
return h(), f("div",
|
|
650
|
+
}), we = { ref: "addressRef" };
|
|
651
|
+
function Ve(u, l, i, o, n, a) {
|
|
652
|
+
return h(), f("div", we, null, 512);
|
|
653
653
|
}
|
|
654
|
-
const
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
654
|
+
const lt = /* @__PURE__ */ C(Se, [["render", Ve]]), $e = { class: "vue-stripe-iban-element" }, Ie = {
|
|
655
|
+
key: 0,
|
|
656
|
+
class: "vue-stripe-iban-element-error"
|
|
657
|
+
}, Ce = { class: "vue-stripe-error-message" }, Pe = {
|
|
658
|
+
key: 1,
|
|
659
|
+
class: "vue-stripe-iban-element-loader"
|
|
660
|
+
}, xe = /* @__PURE__ */ V({
|
|
661
|
+
__name: "VueStripeIbanElement",
|
|
662
|
+
props: {
|
|
663
|
+
options: {}
|
|
664
|
+
},
|
|
665
|
+
emits: ["ready", "change", "focus", "blur", "escape"],
|
|
666
|
+
setup(u, { expose: l, emit: i }) {
|
|
667
|
+
const o = u, n = i, a = p(), e = p(null), r = p(!0), s = p(null), v = _(S);
|
|
668
|
+
if (!v)
|
|
669
|
+
throw new w(
|
|
670
|
+
"VueStripeIbanElement must be used within VueStripeElements"
|
|
671
|
+
);
|
|
672
|
+
const d = () => {
|
|
673
|
+
if (!v.elements.value) {
|
|
674
|
+
s.value = "Elements instance not available", r.value = !1;
|
|
675
|
+
return;
|
|
676
|
+
}
|
|
677
|
+
if (!a.value) {
|
|
678
|
+
s.value = "Mount point not available", r.value = !1;
|
|
679
|
+
return;
|
|
680
|
+
}
|
|
681
|
+
try {
|
|
682
|
+
s.value = null, r.value = !0;
|
|
683
|
+
const t = {
|
|
684
|
+
supportedCountries: ["SEPA"],
|
|
685
|
+
...o.options
|
|
686
|
+
};
|
|
687
|
+
e.value = v.elements.value.create("iban", t), e.value.on("ready", () => {
|
|
688
|
+
r.value = !1, n("ready", e.value);
|
|
689
|
+
}), e.value.on("change", (c) => {
|
|
690
|
+
c.error ? s.value = c.error.message : s.value = null, n("change", c);
|
|
691
|
+
}), e.value.on("focus", () => {
|
|
692
|
+
n("focus");
|
|
693
|
+
}), e.value.on("blur", () => {
|
|
694
|
+
n("blur");
|
|
695
|
+
}), e.value.on("escape", () => {
|
|
696
|
+
n("escape");
|
|
697
|
+
}), e.value.mount(a.value);
|
|
698
|
+
} catch (t) {
|
|
699
|
+
const c = t instanceof Error ? t.message : "Failed to create IBAN element";
|
|
700
|
+
s.value = c, r.value = !1, console.error("[Vue Stripe] IBAN element creation error:", c);
|
|
701
|
+
}
|
|
702
|
+
};
|
|
703
|
+
return y(
|
|
704
|
+
() => o.options,
|
|
705
|
+
(t) => {
|
|
706
|
+
e.value && t && e.value.update(t);
|
|
707
|
+
},
|
|
708
|
+
{ deep: !0 }
|
|
709
|
+
), y(
|
|
710
|
+
() => v.elements.value,
|
|
711
|
+
(t) => {
|
|
712
|
+
t && a.value && !e.value && d();
|
|
713
|
+
},
|
|
714
|
+
{ immediate: !0 }
|
|
715
|
+
), I(() => {
|
|
716
|
+
v.elements.value && a.value && !e.value && d();
|
|
717
|
+
}), x(() => {
|
|
718
|
+
e.value && e.value.destroy();
|
|
719
|
+
}), l({
|
|
720
|
+
element: e,
|
|
721
|
+
loading: r,
|
|
722
|
+
error: s,
|
|
723
|
+
focus: () => e.value?.focus(),
|
|
724
|
+
blur: () => e.value?.blur(),
|
|
725
|
+
clear: () => e.value?.clear()
|
|
726
|
+
}), (t, c) => (h(), f("div", $e, [
|
|
727
|
+
m(s) ? (h(), f("div", Ie, [
|
|
728
|
+
b(t.$slots, "error", { error: m(s) }, () => [
|
|
729
|
+
g("div", Ce, P(m(s)), 1)
|
|
730
|
+
], !0)
|
|
731
|
+
])) : k("", !0),
|
|
732
|
+
g("div", {
|
|
733
|
+
ref_key: "elementRef",
|
|
734
|
+
ref: a,
|
|
735
|
+
class: T(["vue-stripe-iban-element-mount", { "vue-stripe-iban-element-loading": m(r) }])
|
|
736
|
+
}, null, 2),
|
|
737
|
+
m(r) ? (h(), f("div", Pe, [
|
|
738
|
+
b(t.$slots, "loading", {}, () => [
|
|
739
|
+
c[0] || (c[0] = g("div", { class: "vue-stripe-loading-message" }, " Loading IBAN form... ", -1))
|
|
740
|
+
], !0)
|
|
741
|
+
])) : k("", !0)
|
|
742
|
+
]));
|
|
743
|
+
}
|
|
744
|
+
}), ot = /* @__PURE__ */ C(xe, [["__scopeId", "data-v-f8ffb457"]]), Re = { class: "vue-stripe-ideal-bank-element" }, Te = {
|
|
745
|
+
key: 0,
|
|
746
|
+
class: "vue-stripe-ideal-bank-element-error"
|
|
747
|
+
}, Me = { class: "vue-stripe-error-message" }, Ae = {
|
|
748
|
+
key: 1,
|
|
749
|
+
class: "vue-stripe-ideal-bank-element-loader"
|
|
750
|
+
}, Ue = /* @__PURE__ */ V({
|
|
751
|
+
__name: "VueStripeIdealBankElement",
|
|
752
|
+
props: {
|
|
753
|
+
options: {}
|
|
754
|
+
},
|
|
755
|
+
emits: ["ready", "change", "focus", "blur", "escape"],
|
|
756
|
+
setup(u, { expose: l, emit: i }) {
|
|
757
|
+
const o = u, n = i, a = p(), e = p(null), r = p(!0), s = p(null), v = _(S);
|
|
758
|
+
if (!v)
|
|
759
|
+
throw new w(
|
|
760
|
+
"VueStripeIdealBankElement must be used within VueStripeElements"
|
|
761
|
+
);
|
|
762
|
+
const d = () => {
|
|
763
|
+
if (!v.elements.value) {
|
|
764
|
+
s.value = "Elements instance not available", r.value = !1;
|
|
765
|
+
return;
|
|
766
|
+
}
|
|
767
|
+
if (!a.value) {
|
|
768
|
+
s.value = "Mount point not available", r.value = !1;
|
|
769
|
+
return;
|
|
770
|
+
}
|
|
771
|
+
try {
|
|
772
|
+
s.value = null, r.value = !0, e.value = v.elements.value.create("idealBank", o.options), e.value.on("ready", () => {
|
|
773
|
+
r.value = !1, n("ready", e.value);
|
|
774
|
+
}), e.value.on("change", (t) => {
|
|
775
|
+
t.error ? s.value = t.error.message : s.value = null, n("change", t);
|
|
776
|
+
}), e.value.on("focus", () => {
|
|
777
|
+
n("focus");
|
|
778
|
+
}), e.value.on("blur", () => {
|
|
779
|
+
n("blur");
|
|
780
|
+
}), e.value.on("escape", () => {
|
|
781
|
+
n("escape");
|
|
782
|
+
}), e.value.mount(a.value);
|
|
783
|
+
} catch (t) {
|
|
784
|
+
const c = t instanceof Error ? t.message : "Failed to create iDEAL bank element";
|
|
785
|
+
s.value = c, r.value = !1, console.error("[Vue Stripe] iDEAL bank element creation error:", c);
|
|
786
|
+
}
|
|
787
|
+
};
|
|
788
|
+
return y(
|
|
789
|
+
() => o.options,
|
|
790
|
+
(t) => {
|
|
791
|
+
e.value && t && e.value.update(t);
|
|
792
|
+
},
|
|
793
|
+
{ deep: !0 }
|
|
794
|
+
), y(
|
|
795
|
+
() => v.elements.value,
|
|
796
|
+
(t) => {
|
|
797
|
+
t && a.value && !e.value && d();
|
|
798
|
+
},
|
|
799
|
+
{ immediate: !0 }
|
|
800
|
+
), I(() => {
|
|
801
|
+
v.elements.value && a.value && !e.value && d();
|
|
802
|
+
}), x(() => {
|
|
803
|
+
e.value && e.value.destroy();
|
|
804
|
+
}), l({
|
|
805
|
+
element: e,
|
|
806
|
+
loading: r,
|
|
807
|
+
error: s,
|
|
808
|
+
focus: () => e.value?.focus(),
|
|
809
|
+
blur: () => e.value?.blur(),
|
|
810
|
+
clear: () => e.value?.clear()
|
|
811
|
+
}), (t, c) => (h(), f("div", Re, [
|
|
812
|
+
m(s) ? (h(), f("div", Te, [
|
|
813
|
+
b(t.$slots, "error", { error: m(s) }, () => [
|
|
814
|
+
g("div", Me, P(m(s)), 1)
|
|
815
|
+
], !0)
|
|
816
|
+
])) : k("", !0),
|
|
817
|
+
g("div", {
|
|
818
|
+
ref_key: "elementRef",
|
|
819
|
+
ref: a,
|
|
820
|
+
class: T(["vue-stripe-ideal-bank-element-mount", { "vue-stripe-ideal-bank-element-loading": m(r) }])
|
|
821
|
+
}, null, 2),
|
|
822
|
+
m(r) ? (h(), f("div", Ae, [
|
|
823
|
+
b(t.$slots, "loading", {}, () => [
|
|
824
|
+
c[0] || (c[0] = g("div", { class: "vue-stripe-loading-message" }, " Loading iDEAL bank selector... ", -1))
|
|
825
|
+
], !0)
|
|
826
|
+
])) : k("", !0)
|
|
827
|
+
]));
|
|
828
|
+
}
|
|
829
|
+
}), ut = /* @__PURE__ */ C(Ue, [["__scopeId", "data-v-3d7f7e08"]]), Be = { class: "vue-stripe-p24-bank-element" }, Le = {
|
|
830
|
+
key: 0,
|
|
831
|
+
class: "vue-stripe-p24-bank-element-error"
|
|
832
|
+
}, Fe = { class: "vue-stripe-error-message" }, ze = {
|
|
833
|
+
key: 1,
|
|
834
|
+
class: "vue-stripe-p24-bank-element-loader"
|
|
835
|
+
}, Ne = /* @__PURE__ */ V({
|
|
836
|
+
__name: "VueStripeP24BankElement",
|
|
837
|
+
props: {
|
|
838
|
+
options: {}
|
|
839
|
+
},
|
|
840
|
+
emits: ["ready", "change", "focus", "blur", "escape"],
|
|
841
|
+
setup(u, { expose: l, emit: i }) {
|
|
842
|
+
const o = u, n = i, a = p(), e = p(null), r = p(!0), s = p(null), v = _(S);
|
|
843
|
+
if (!v)
|
|
844
|
+
throw new w(
|
|
845
|
+
"VueStripeP24BankElement must be used within VueStripeElements"
|
|
846
|
+
);
|
|
847
|
+
const d = () => {
|
|
848
|
+
if (!v.elements.value) {
|
|
849
|
+
s.value = "Elements instance not available", r.value = !1;
|
|
850
|
+
return;
|
|
851
|
+
}
|
|
852
|
+
if (!a.value) {
|
|
853
|
+
s.value = "Mount point not available", r.value = !1;
|
|
854
|
+
return;
|
|
855
|
+
}
|
|
856
|
+
try {
|
|
857
|
+
s.value = null, r.value = !0, e.value = v.elements.value.create("p24Bank", o.options || {}), e.value.on("ready", () => {
|
|
858
|
+
r.value = !1, n("ready", e.value);
|
|
859
|
+
}), e.value.on("change", (t) => {
|
|
860
|
+
t.error ? s.value = t.error.message : s.value = null, n("change", t);
|
|
861
|
+
}), e.value.on("focus", () => {
|
|
862
|
+
n("focus");
|
|
863
|
+
}), e.value.on("blur", () => {
|
|
864
|
+
n("blur");
|
|
865
|
+
}), e.value.on("escape", () => {
|
|
866
|
+
n("escape");
|
|
867
|
+
}), e.value.mount(a.value);
|
|
868
|
+
} catch (t) {
|
|
869
|
+
const c = t instanceof Error ? t.message : "Failed to create P24 bank element";
|
|
870
|
+
s.value = c, r.value = !1, console.error("[Vue Stripe] P24 bank element creation error:", c);
|
|
871
|
+
}
|
|
872
|
+
};
|
|
873
|
+
return y(
|
|
874
|
+
() => o.options,
|
|
875
|
+
(t) => {
|
|
876
|
+
e.value && t && e.value.update(t);
|
|
877
|
+
},
|
|
878
|
+
{ deep: !0 }
|
|
879
|
+
), y(
|
|
880
|
+
() => v.elements.value,
|
|
881
|
+
(t) => {
|
|
882
|
+
t && a.value && !e.value && d();
|
|
883
|
+
},
|
|
884
|
+
{ immediate: !0 }
|
|
885
|
+
), I(() => {
|
|
886
|
+
v.elements.value && a.value && !e.value && d();
|
|
887
|
+
}), x(() => {
|
|
888
|
+
e.value && e.value.destroy();
|
|
889
|
+
}), l({
|
|
890
|
+
element: e,
|
|
891
|
+
loading: r,
|
|
892
|
+
error: s,
|
|
893
|
+
focus: () => e.value?.focus(),
|
|
894
|
+
blur: () => e.value?.blur(),
|
|
895
|
+
clear: () => e.value?.clear()
|
|
896
|
+
}), (t, c) => (h(), f("div", Be, [
|
|
897
|
+
m(s) ? (h(), f("div", Le, [
|
|
898
|
+
b(t.$slots, "error", { error: m(s) }, () => [
|
|
899
|
+
g("div", Fe, P(m(s)), 1)
|
|
900
|
+
], !0)
|
|
901
|
+
])) : k("", !0),
|
|
902
|
+
g("div", {
|
|
903
|
+
ref_key: "elementRef",
|
|
904
|
+
ref: a,
|
|
905
|
+
class: T(["vue-stripe-p24-bank-element-mount", { "vue-stripe-p24-bank-element-loading": m(r) }])
|
|
906
|
+
}, null, 2),
|
|
907
|
+
m(r) ? (h(), f("div", ze, [
|
|
908
|
+
b(t.$slots, "loading", {}, () => [
|
|
909
|
+
c[0] || (c[0] = g("div", { class: "vue-stripe-loading-message" }, " Loading Przelewy24 bank selector... ", -1))
|
|
910
|
+
], !0)
|
|
911
|
+
])) : k("", !0)
|
|
912
|
+
]));
|
|
913
|
+
}
|
|
914
|
+
}), it = /* @__PURE__ */ C(Ne, [["__scopeId", "data-v-29dc009e"]]), je = { class: "vue-stripe-eps-bank-element" }, Ke = {
|
|
915
|
+
key: 0,
|
|
916
|
+
class: "vue-stripe-eps-bank-element-error"
|
|
917
|
+
}, qe = { class: "vue-stripe-error-message" }, De = {
|
|
918
|
+
key: 1,
|
|
919
|
+
class: "vue-stripe-eps-bank-element-loader"
|
|
920
|
+
}, We = /* @__PURE__ */ V({
|
|
921
|
+
__name: "VueStripeEpsBankElement",
|
|
922
|
+
props: {
|
|
923
|
+
options: {}
|
|
924
|
+
},
|
|
925
|
+
emits: ["ready", "change", "focus", "blur", "escape"],
|
|
926
|
+
setup(u, { expose: l, emit: i }) {
|
|
927
|
+
const o = u, n = i, a = p(), e = p(null), r = p(!0), s = p(null), v = _(S);
|
|
928
|
+
if (!v)
|
|
929
|
+
throw new w(
|
|
930
|
+
"VueStripeEpsBankElement must be used within VueStripeElements"
|
|
931
|
+
);
|
|
932
|
+
const d = () => {
|
|
933
|
+
if (!v.elements.value) {
|
|
934
|
+
s.value = "Elements instance not available", r.value = !1;
|
|
935
|
+
return;
|
|
936
|
+
}
|
|
937
|
+
if (!a.value) {
|
|
938
|
+
s.value = "Mount point not available", r.value = !1;
|
|
939
|
+
return;
|
|
940
|
+
}
|
|
941
|
+
try {
|
|
942
|
+
s.value = null, r.value = !0, e.value = v.elements.value.create("epsBank", o.options || {}), e.value.on("ready", () => {
|
|
943
|
+
r.value = !1, n("ready", e.value);
|
|
944
|
+
}), e.value.on("change", (t) => {
|
|
945
|
+
t.error ? s.value = t.error.message : s.value = null, n("change", t);
|
|
946
|
+
}), e.value.on("focus", () => {
|
|
947
|
+
n("focus");
|
|
948
|
+
}), e.value.on("blur", () => {
|
|
949
|
+
n("blur");
|
|
950
|
+
}), e.value.on("escape", () => {
|
|
951
|
+
n("escape");
|
|
952
|
+
}), e.value.mount(a.value);
|
|
953
|
+
} catch (t) {
|
|
954
|
+
const c = t instanceof Error ? t.message : "Failed to create EPS bank element";
|
|
955
|
+
s.value = c, r.value = !1, console.error("[Vue Stripe] EPS bank element creation error:", c);
|
|
956
|
+
}
|
|
957
|
+
};
|
|
958
|
+
return y(
|
|
959
|
+
() => o.options,
|
|
960
|
+
(t) => {
|
|
961
|
+
e.value && t && e.value.update(t);
|
|
962
|
+
},
|
|
963
|
+
{ deep: !0 }
|
|
964
|
+
), y(
|
|
965
|
+
() => v.elements.value,
|
|
966
|
+
(t) => {
|
|
967
|
+
t && a.value && !e.value && d();
|
|
968
|
+
},
|
|
969
|
+
{ immediate: !0 }
|
|
970
|
+
), I(() => {
|
|
971
|
+
v.elements.value && a.value && !e.value && d();
|
|
972
|
+
}), x(() => {
|
|
973
|
+
e.value && e.value.destroy();
|
|
974
|
+
}), l({
|
|
975
|
+
element: e,
|
|
976
|
+
loading: r,
|
|
977
|
+
error: s,
|
|
978
|
+
focus: () => e.value?.focus(),
|
|
979
|
+
blur: () => e.value?.blur(),
|
|
980
|
+
clear: () => e.value?.clear()
|
|
981
|
+
}), (t, c) => (h(), f("div", je, [
|
|
982
|
+
m(s) ? (h(), f("div", Ke, [
|
|
983
|
+
b(t.$slots, "error", { error: m(s) }, () => [
|
|
984
|
+
g("div", qe, P(m(s)), 1)
|
|
985
|
+
], !0)
|
|
986
|
+
])) : k("", !0),
|
|
987
|
+
g("div", {
|
|
988
|
+
ref_key: "elementRef",
|
|
989
|
+
ref: a,
|
|
990
|
+
class: T(["vue-stripe-eps-bank-element-mount", { "vue-stripe-eps-bank-element-loading": m(r) }])
|
|
991
|
+
}, null, 2),
|
|
992
|
+
m(r) ? (h(), f("div", De, [
|
|
993
|
+
b(t.$slots, "loading", {}, () => [
|
|
994
|
+
c[0] || (c[0] = g("div", { class: "vue-stripe-loading-message" }, " Loading EPS bank selector... ", -1))
|
|
995
|
+
], !0)
|
|
996
|
+
])) : k("", !0)
|
|
997
|
+
]));
|
|
998
|
+
}
|
|
999
|
+
}), ct = /* @__PURE__ */ C(We, [["__scopeId", "data-v-27c62f72"]]);
|
|
1000
|
+
function W() {
|
|
1001
|
+
const u = _(A);
|
|
1002
|
+
if (!u)
|
|
1003
|
+
throw new E(
|
|
659
1004
|
"useStripe must be called within a VueStripeProvider component"
|
|
660
1005
|
);
|
|
661
1006
|
return {
|
|
662
|
-
stripe:
|
|
663
|
-
loading:
|
|
664
|
-
error:
|
|
1007
|
+
stripe: $(u.stripe),
|
|
1008
|
+
loading: $(u.loading),
|
|
1009
|
+
error: $(u.error),
|
|
665
1010
|
initialize: async () => {
|
|
666
1011
|
}
|
|
667
1012
|
};
|
|
668
1013
|
}
|
|
669
|
-
const
|
|
1014
|
+
const Xe = ["disabled"], Ge = /* @__PURE__ */ V({
|
|
670
1015
|
__name: "VueStripeCheckout",
|
|
671
1016
|
props: {
|
|
672
1017
|
sessionId: {},
|
|
1018
|
+
sessionUrl: {},
|
|
673
1019
|
priceId: {},
|
|
674
1020
|
mode: { default: "payment" },
|
|
675
1021
|
successUrl: {},
|
|
@@ -677,220 +1023,270 @@ const Ve = ["disabled"], ke = /* @__PURE__ */ w({
|
|
|
677
1023
|
customerEmail: {},
|
|
678
1024
|
clientReferenceId: {},
|
|
679
1025
|
submitType: {},
|
|
680
|
-
options: {},
|
|
681
1026
|
buttonText: { default: "Checkout" },
|
|
682
1027
|
loadingText: { default: "Redirecting..." },
|
|
683
1028
|
disabled: { type: Boolean, default: !1 },
|
|
684
1029
|
buttonClass: { default: "vue-stripe-checkout-button" }
|
|
685
1030
|
},
|
|
686
|
-
emits: ["
|
|
687
|
-
setup(
|
|
688
|
-
const o =
|
|
689
|
-
|
|
690
|
-
const e = new b("Stripe not initialized");
|
|
691
|
-
i("error", e);
|
|
692
|
-
return;
|
|
693
|
-
}
|
|
694
|
-
if (!o.sessionId && !o.priceId) {
|
|
695
|
-
const e = new b("Either sessionId or priceId is required");
|
|
696
|
-
i("error", e);
|
|
697
|
-
return;
|
|
698
|
-
}
|
|
1031
|
+
emits: ["checkout", "success", "error", "before-redirect"],
|
|
1032
|
+
setup(u, { expose: l, emit: i }) {
|
|
1033
|
+
const o = u, n = i, { stripe: a } = W(), e = p(!1), r = H(), s = J(() => !!r.default), v = () => a.value !== null && typeof a.value.redirectToCheckout == "function", d = async () => {
|
|
1034
|
+
e.value = !0, n("checkout");
|
|
699
1035
|
try {
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
}
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
1036
|
+
if (o.sessionUrl) {
|
|
1037
|
+
n("before-redirect", { url: o.sessionUrl }), window.location.replace(o.sessionUrl), n("success");
|
|
1038
|
+
return;
|
|
1039
|
+
}
|
|
1040
|
+
if (o.sessionId) {
|
|
1041
|
+
if (!v())
|
|
1042
|
+
throw new E(
|
|
1043
|
+
"redirectToCheckout is not available. This method was removed in @stripe/stripe-js v8.x. Use sessionUrl prop with the checkout session URL instead."
|
|
1044
|
+
);
|
|
1045
|
+
if (!a.value)
|
|
1046
|
+
throw new E("Stripe not initialized");
|
|
1047
|
+
const t = await a.value.redirectToCheckout({
|
|
1048
|
+
sessionId: o.sessionId
|
|
1049
|
+
});
|
|
1050
|
+
if (t.error)
|
|
1051
|
+
throw new E(t.error.message || "Redirect to checkout failed");
|
|
1052
|
+
n("success");
|
|
1053
|
+
return;
|
|
1054
|
+
}
|
|
1055
|
+
if (o.priceId) {
|
|
1056
|
+
if (!v())
|
|
1057
|
+
throw new E(
|
|
1058
|
+
"Price-based checkout using redirectToCheckout is not available in @stripe/stripe-js v8.x. Create a Checkout Session on your server and use sessionUrl prop instead."
|
|
1059
|
+
);
|
|
1060
|
+
if (!a.value)
|
|
1061
|
+
throw new E("Stripe not initialized");
|
|
1062
|
+
console.warn(
|
|
1063
|
+
"[Vue Stripe] Price-based checkout is deprecated in v8.x. Create a Checkout Session on your server and use sessionUrl prop instead."
|
|
1064
|
+
);
|
|
1065
|
+
const t = await a.value.redirectToCheckout({
|
|
1066
|
+
lineItems: [
|
|
1067
|
+
{
|
|
1068
|
+
price: o.priceId,
|
|
1069
|
+
quantity: 1
|
|
1070
|
+
}
|
|
1071
|
+
],
|
|
1072
|
+
mode: o.mode,
|
|
1073
|
+
successUrl: o.successUrl || window.location.origin + "/success",
|
|
1074
|
+
cancelUrl: o.cancelUrl || window.location.origin + "/cancel",
|
|
1075
|
+
customerEmail: o.customerEmail,
|
|
1076
|
+
clientReferenceId: o.clientReferenceId,
|
|
1077
|
+
submitType: o.submitType
|
|
1078
|
+
});
|
|
1079
|
+
if (t.error)
|
|
1080
|
+
throw new E(t.error.message || "Redirect to checkout failed");
|
|
1081
|
+
n("success");
|
|
1082
|
+
return;
|
|
1083
|
+
}
|
|
1084
|
+
throw new E(
|
|
1085
|
+
"Either sessionUrl, sessionId, or priceId is required. For @stripe/stripe-js v8.x, use sessionUrl."
|
|
1086
|
+
);
|
|
1087
|
+
} catch (t) {
|
|
1088
|
+
const c = t instanceof Error ? t : new Error("Checkout failed");
|
|
1089
|
+
n("error", c), console.error("[Vue Stripe] Checkout error:", c);
|
|
724
1090
|
} finally {
|
|
725
|
-
|
|
1091
|
+
e.value = !1;
|
|
726
1092
|
}
|
|
727
1093
|
};
|
|
728
|
-
return (e,
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
1094
|
+
return l({ checkout: d, loading: e }), (t, c) => m(s) ? (h(), f("span", {
|
|
1095
|
+
key: 0,
|
|
1096
|
+
onClick: d,
|
|
1097
|
+
class: "vue-stripe-checkout-wrapper"
|
|
732
1098
|
}, [
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
1099
|
+
b(t.$slots, "default", {
|
|
1100
|
+
checkout: d,
|
|
1101
|
+
loading: m(e),
|
|
1102
|
+
disabled: u.disabled
|
|
1103
|
+
}, void 0, !0)
|
|
1104
|
+
])) : (h(), f("button", {
|
|
1105
|
+
key: 1,
|
|
1106
|
+
disabled: m(e) || u.disabled,
|
|
1107
|
+
class: T(u.buttonClass),
|
|
1108
|
+
onClick: d
|
|
1109
|
+
}, [
|
|
1110
|
+
m(e) ? (h(), f(j, { key: 1 }, [
|
|
1111
|
+
c[0] || (c[0] = g("span", { class: "vue-stripe-loading-spinner" }, null, -1)),
|
|
1112
|
+
K(" " + P(u.loadingText), 1)
|
|
1113
|
+
], 64)) : (h(), f(j, { key: 0 }, [
|
|
1114
|
+
K(P(u.buttonText), 1)
|
|
1115
|
+
], 64))
|
|
1116
|
+
], 10, Xe));
|
|
740
1117
|
}
|
|
741
|
-
}),
|
|
742
|
-
function
|
|
743
|
-
const
|
|
744
|
-
if (!
|
|
745
|
-
throw new
|
|
1118
|
+
}), vt = /* @__PURE__ */ C(Ge, [["__scopeId", "data-v-639387e4"]]);
|
|
1119
|
+
function dt() {
|
|
1120
|
+
const u = _(A), l = _(S);
|
|
1121
|
+
if (!u)
|
|
1122
|
+
throw new E(
|
|
746
1123
|
"usePaymentIntent must be called within a VueStripeProvider component"
|
|
747
1124
|
);
|
|
748
|
-
const
|
|
1125
|
+
const i = p(!1), o = p(null);
|
|
749
1126
|
return {
|
|
750
|
-
confirmPayment: async (
|
|
751
|
-
if (!
|
|
752
|
-
return
|
|
753
|
-
|
|
1127
|
+
confirmPayment: async (a) => {
|
|
1128
|
+
if (!u.stripe.value)
|
|
1129
|
+
return o.value = "Stripe not initialized", { error: { message: "Stripe not initialized" } };
|
|
1130
|
+
i.value = !0, o.value = null;
|
|
754
1131
|
try {
|
|
755
|
-
const
|
|
756
|
-
if (
|
|
757
|
-
const { error:
|
|
758
|
-
if (
|
|
759
|
-
return
|
|
1132
|
+
const e = a.elements ?? l?.elements.value;
|
|
1133
|
+
if (e && !a.skipSubmit) {
|
|
1134
|
+
const { error: s } = await e.submit();
|
|
1135
|
+
if (s)
|
|
1136
|
+
return o.value = s.message || "Form validation failed", { error: s };
|
|
760
1137
|
}
|
|
761
|
-
const
|
|
762
|
-
elements:
|
|
763
|
-
clientSecret:
|
|
764
|
-
confirmParams:
|
|
765
|
-
redirect:
|
|
1138
|
+
const r = await u.stripe.value.confirmPayment({
|
|
1139
|
+
elements: e ?? void 0,
|
|
1140
|
+
clientSecret: a.clientSecret,
|
|
1141
|
+
confirmParams: a.confirmParams ?? {},
|
|
1142
|
+
redirect: a.redirect ?? "if_required"
|
|
766
1143
|
});
|
|
767
|
-
return
|
|
768
|
-
} catch (
|
|
769
|
-
const
|
|
770
|
-
return
|
|
1144
|
+
return r.error && (o.value = r.error.message || "Payment confirmation failed"), r;
|
|
1145
|
+
} catch (e) {
|
|
1146
|
+
const r = e instanceof Error ? e.message : "Payment confirmation failed";
|
|
1147
|
+
return o.value = r, { error: { message: r } };
|
|
771
1148
|
} finally {
|
|
772
|
-
|
|
1149
|
+
i.value = !1;
|
|
773
1150
|
}
|
|
774
1151
|
},
|
|
775
|
-
loading:
|
|
776
|
-
error:
|
|
1152
|
+
loading: $(i),
|
|
1153
|
+
error: $(o)
|
|
777
1154
|
};
|
|
778
1155
|
}
|
|
779
|
-
function
|
|
780
|
-
const
|
|
781
|
-
if (!
|
|
782
|
-
throw new
|
|
1156
|
+
function pt() {
|
|
1157
|
+
const u = _(A), l = _(S);
|
|
1158
|
+
if (!u)
|
|
1159
|
+
throw new E(
|
|
783
1160
|
"useSetupIntent must be called within a VueStripeProvider component"
|
|
784
1161
|
);
|
|
785
|
-
const
|
|
1162
|
+
const i = p(!1), o = p(null);
|
|
786
1163
|
return {
|
|
787
|
-
confirmSetup: async (
|
|
788
|
-
if (!
|
|
789
|
-
return
|
|
790
|
-
|
|
1164
|
+
confirmSetup: async (a) => {
|
|
1165
|
+
if (!u.stripe.value)
|
|
1166
|
+
return o.value = "Stripe not initialized", { error: { message: "Stripe not initialized" } };
|
|
1167
|
+
i.value = !0, o.value = null;
|
|
791
1168
|
try {
|
|
792
|
-
const
|
|
793
|
-
if (
|
|
794
|
-
const { error:
|
|
795
|
-
if (
|
|
796
|
-
return
|
|
1169
|
+
const e = a.elements ?? l?.elements.value;
|
|
1170
|
+
if (e && !a.skipSubmit) {
|
|
1171
|
+
const { error: s } = await e.submit();
|
|
1172
|
+
if (s)
|
|
1173
|
+
return o.value = s.message || "Form validation failed", { error: s };
|
|
797
1174
|
}
|
|
798
|
-
const
|
|
799
|
-
elements:
|
|
800
|
-
clientSecret:
|
|
801
|
-
confirmParams:
|
|
802
|
-
redirect:
|
|
1175
|
+
const r = await u.stripe.value.confirmSetup({
|
|
1176
|
+
elements: e ?? void 0,
|
|
1177
|
+
clientSecret: a.clientSecret,
|
|
1178
|
+
confirmParams: a.confirmParams ?? {},
|
|
1179
|
+
redirect: a.redirect ?? "if_required"
|
|
803
1180
|
});
|
|
804
|
-
return
|
|
805
|
-
} catch (
|
|
806
|
-
const
|
|
807
|
-
return
|
|
1181
|
+
return r.error && (o.value = r.error.message || "Setup confirmation failed"), r;
|
|
1182
|
+
} catch (e) {
|
|
1183
|
+
const r = e instanceof Error ? e.message : "Setup confirmation failed";
|
|
1184
|
+
return o.value = r, { error: { message: r } };
|
|
808
1185
|
} finally {
|
|
809
|
-
|
|
1186
|
+
i.value = !1;
|
|
810
1187
|
}
|
|
811
1188
|
},
|
|
812
|
-
loading:
|
|
813
|
-
error:
|
|
1189
|
+
loading: $(i),
|
|
1190
|
+
error: $(o)
|
|
814
1191
|
};
|
|
815
1192
|
}
|
|
816
|
-
function
|
|
817
|
-
const { stripe:
|
|
1193
|
+
function mt() {
|
|
1194
|
+
const { stripe: u } = W(), l = p(!1), i = p(null), o = () => u.value !== null && typeof u.value.redirectToCheckout == "function";
|
|
818
1195
|
return {
|
|
819
|
-
redirectToCheckout: async (
|
|
820
|
-
|
|
821
|
-
throw new b("Stripe not initialized");
|
|
1196
|
+
redirectToCheckout: async (e) => {
|
|
1197
|
+
l.value = !0, i.value = null;
|
|
822
1198
|
try {
|
|
823
|
-
|
|
824
|
-
|
|
1199
|
+
if ("url" in e && e.url) {
|
|
1200
|
+
window.location.replace(e.url);
|
|
1201
|
+
return;
|
|
1202
|
+
}
|
|
1203
|
+
const r = e;
|
|
1204
|
+
if (!o())
|
|
1205
|
+
throw new E(
|
|
1206
|
+
"redirectToCheckout is not available. This method was removed in @stripe/stripe-js v8.x. Create a Checkout Session on your server and use redirectToUrl() or pass { url } instead."
|
|
1207
|
+
);
|
|
1208
|
+
if (!u.value)
|
|
1209
|
+
throw new E("Stripe not initialized");
|
|
1210
|
+
console.warn(
|
|
1211
|
+
"[Vue Stripe] Legacy redirectToCheckout is deprecated in @stripe/stripe-js v8.x. Use redirectToUrl() with a session URL from your server instead."
|
|
1212
|
+
);
|
|
1213
|
+
const s = await u.value.redirectToCheckout(r);
|
|
825
1214
|
if (s.error) {
|
|
826
|
-
const
|
|
827
|
-
throw
|
|
1215
|
+
const v = s.error.message || "Checkout redirect failed";
|
|
1216
|
+
throw i.value = v, new E(v);
|
|
828
1217
|
}
|
|
829
|
-
} catch (
|
|
830
|
-
const
|
|
831
|
-
throw
|
|
1218
|
+
} catch (r) {
|
|
1219
|
+
const s = r instanceof Error ? r.message : "Checkout redirect failed";
|
|
1220
|
+
throw i.value = s, r;
|
|
832
1221
|
} finally {
|
|
833
|
-
|
|
1222
|
+
l.value = !1;
|
|
834
1223
|
}
|
|
835
1224
|
},
|
|
836
|
-
|
|
837
|
-
|
|
1225
|
+
redirectToUrl: (e) => {
|
|
1226
|
+
l.value = !0, i.value = null, window.location.replace(e);
|
|
1227
|
+
},
|
|
1228
|
+
loading: $(l),
|
|
1229
|
+
error: $(i)
|
|
838
1230
|
};
|
|
839
1231
|
}
|
|
840
|
-
function
|
|
841
|
-
const
|
|
842
|
-
if (!
|
|
843
|
-
throw new
|
|
1232
|
+
function ft() {
|
|
1233
|
+
const u = _(S);
|
|
1234
|
+
if (!u)
|
|
1235
|
+
throw new w(
|
|
844
1236
|
"Elements context not found. Make sure to wrap your component with VueStripeElements."
|
|
845
1237
|
);
|
|
846
|
-
const
|
|
1238
|
+
const l = async () => u.elements.value ? u.elements.value.submit() : { error: { message: "Elements not initialized" } };
|
|
847
1239
|
return {
|
|
848
|
-
elements:
|
|
849
|
-
submit:
|
|
850
|
-
loading:
|
|
851
|
-
error:
|
|
1240
|
+
elements: $(u.elements),
|
|
1241
|
+
submit: l,
|
|
1242
|
+
loading: $(u.loading),
|
|
1243
|
+
error: $(u.error)
|
|
852
1244
|
};
|
|
853
1245
|
}
|
|
854
|
-
function
|
|
1246
|
+
function ht(u) {
|
|
855
1247
|
return {
|
|
856
|
-
install(
|
|
857
|
-
|
|
858
|
-
let
|
|
859
|
-
|
|
1248
|
+
install(l) {
|
|
1249
|
+
l.provide("vue-stripe-config", u);
|
|
1250
|
+
let i = null;
|
|
1251
|
+
l.provide("vue-stripe-global", {
|
|
860
1252
|
get stripe() {
|
|
861
|
-
if (!
|
|
862
|
-
const
|
|
863
|
-
|
|
1253
|
+
if (!i) {
|
|
1254
|
+
const o = {};
|
|
1255
|
+
u.stripeAccount && (o.stripeAccount = u.stripeAccount), u.apiVersion && (o.apiVersion = u.apiVersion), u.locale && (o.locale = u.locale), i = q(u.publishableKey, o).then((n) => (n && n.registerAppInfo(D), n));
|
|
864
1256
|
}
|
|
865
|
-
return
|
|
1257
|
+
return i;
|
|
866
1258
|
}
|
|
867
1259
|
});
|
|
868
1260
|
}
|
|
869
1261
|
};
|
|
870
1262
|
}
|
|
871
1263
|
export {
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
1264
|
+
lt as VueStripeAddressElement,
|
|
1265
|
+
nt as VueStripeCardCvcElement,
|
|
1266
|
+
tt as VueStripeCardElement,
|
|
1267
|
+
st as VueStripeCardExpiryElement,
|
|
1268
|
+
rt as VueStripeCardNumberElement,
|
|
1269
|
+
vt as VueStripeCheckout,
|
|
1270
|
+
Ze as VueStripeElements,
|
|
1271
|
+
w as VueStripeElementsError,
|
|
1272
|
+
ct as VueStripeEpsBankElement,
|
|
1273
|
+
et as VueStripeExpressCheckoutElement,
|
|
1274
|
+
ot as VueStripeIbanElement,
|
|
1275
|
+
ut as VueStripeIdealBankElement,
|
|
1276
|
+
at as VueStripeLinkAuthenticationElement,
|
|
1277
|
+
Q as VueStripeLoadError,
|
|
1278
|
+
it as VueStripeP24BankElement,
|
|
1279
|
+
Oe as VueStripePaymentElement,
|
|
1280
|
+
Ye as VueStripeProvider,
|
|
1281
|
+
E as VueStripeProviderError,
|
|
1282
|
+
ht as createVueStripe,
|
|
1283
|
+
Qe as createVueStripeError,
|
|
1284
|
+
bt as loadStripe,
|
|
1285
|
+
mt as useCheckout,
|
|
1286
|
+
ft as useElements,
|
|
1287
|
+
dt as usePaymentIntent,
|
|
1288
|
+
pt as useSetupIntent,
|
|
1289
|
+
W as useStripe,
|
|
1290
|
+
mt as useStripeCheckout,
|
|
1291
|
+
ft as useStripeElements
|
|
896
1292
|
};
|