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