@vue-stripe/vue-stripe 5.1.1 → 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/README.md +16 -3
- package/dist/cjs/index.js +1 -1
- package/dist/es/index.js +881 -529
- package/dist/types/components/VueStripeCheckout.vue.d.ts +1 -1
- package/dist/types/components/VueStripeCheckout.vue.d.ts.map +1 -1
- package/dist/types/components/VueStripeElements.vue.d.ts +8 -1
- package/dist/types/components/VueStripeElements.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/tsconfig.build.tsbuildinfo +1 -1
- package/dist/umd/index.js +1 -1
- package/dist/vue-stripe.css +1 -1
- package/package.json +1 -1
package/dist/es/index.js
CHANGED
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
import { loadStripe as
|
|
2
|
-
import { loadStripe as
|
|
3
|
-
import { defineComponent as V, ref as
|
|
4
|
-
const
|
|
5
|
-
class
|
|
6
|
-
constructor(
|
|
7
|
-
super(
|
|
1
|
+
import { loadStripe as q } from "@stripe/stripe-js";
|
|
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
|
+
const A = Symbol("stripe"), S = Symbol("stripe-elements");
|
|
5
|
+
class E extends Error {
|
|
6
|
+
constructor(d) {
|
|
7
|
+
super(d), this.name = "VueStripeProviderError";
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
|
-
class
|
|
11
|
-
constructor(
|
|
12
|
-
super(
|
|
10
|
+
class w extends Error {
|
|
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
|
|
23
|
+
return new E(d);
|
|
24
24
|
case "elements":
|
|
25
|
-
return new
|
|
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.
|
|
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
|
|
56
|
-
if (!
|
|
57
|
-
throw new
|
|
58
|
-
const
|
|
59
|
-
publishableKey:
|
|
60
|
-
stripeAccount:
|
|
61
|
-
apiVersion:
|
|
62
|
-
locale:
|
|
63
|
-
},
|
|
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
|
+
if (!r)
|
|
57
|
+
throw new E("publishableKey or stripeKey is required");
|
|
58
|
+
const s = {
|
|
59
|
+
publishableKey: r,
|
|
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
65
|
l.value = !0, e.value = null;
|
|
66
|
-
const
|
|
67
|
-
if (
|
|
68
|
-
throw new
|
|
69
|
-
|
|
70
|
-
} catch (
|
|
71
|
-
const
|
|
72
|
-
e.value =
|
|
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
|
+
throw new E("Failed to initialize Stripe");
|
|
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
|
-
return
|
|
78
|
-
|
|
79
|
-
}),
|
|
80
|
-
stripe:
|
|
77
|
+
return I(() => {
|
|
78
|
+
u();
|
|
79
|
+
}), B("vue-stripe-config", s), B(A, {
|
|
80
|
+
stripe: n,
|
|
81
81
|
loading: l,
|
|
82
82
|
error: e
|
|
83
|
-
}), (
|
|
84
|
-
|
|
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(l) ? (h(), f("div",
|
|
88
|
-
|
|
89
|
-
|
|
87
|
+
])) : m(l) ? (h(), f("div", ee, [
|
|
88
|
+
b(v.$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", te, [
|
|
92
|
+
b(v.$slots, "default", {}, void 0, !0)
|
|
93
93
|
]));
|
|
94
94
|
}
|
|
95
|
-
}),
|
|
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,66 +115,69 @@ const D = {
|
|
|
115
115
|
paymentMethodTypes: {},
|
|
116
116
|
options: {}
|
|
117
117
|
},
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
118
|
+
emits: ["ready", "error"],
|
|
119
|
+
setup(o, { emit: d }) {
|
|
120
|
+
const c = d, a = o, n = _(A);
|
|
121
|
+
if (!n)
|
|
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
|
-
return
|
|
141
|
-
() =>
|
|
142
|
-
(
|
|
143
|
-
|
|
143
|
+
return y(
|
|
144
|
+
() => n.stripe.value,
|
|
145
|
+
(u) => {
|
|
146
|
+
u && !l.value && s();
|
|
144
147
|
},
|
|
145
148
|
{ immediate: !0 }
|
|
146
|
-
),
|
|
147
|
-
() =>
|
|
149
|
+
), y(
|
|
150
|
+
() => a.clientSecret,
|
|
148
151
|
() => {
|
|
149
|
-
|
|
152
|
+
n.stripe.value && s();
|
|
150
153
|
}
|
|
151
|
-
),
|
|
152
|
-
() => [
|
|
154
|
+
), y(
|
|
155
|
+
() => [a.mode, a.currency, a.amount, a.setupFutureUsage],
|
|
153
156
|
() => {
|
|
154
|
-
|
|
157
|
+
n.stripe.value && s();
|
|
155
158
|
}
|
|
156
|
-
),
|
|
157
|
-
|
|
158
|
-
}),
|
|
159
|
-
elements:
|
|
160
|
-
loading:
|
|
161
|
-
error:
|
|
162
|
-
}), (
|
|
163
|
-
|
|
164
|
-
g("div",
|
|
159
|
+
), I(() => {
|
|
160
|
+
n.stripe.value && !l.value && s();
|
|
161
|
+
}), B(S, {
|
|
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
|
-
|
|
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
|
-
|
|
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({
|
|
@@ -183,255 +186,255 @@ const D = {
|
|
|
183
186
|
options: {}
|
|
184
187
|
},
|
|
185
188
|
emits: ["ready", "change", "focus", "blur", "escape", "loaderstart", "loaderstop"],
|
|
186
|
-
setup(
|
|
187
|
-
const
|
|
188
|
-
if (!
|
|
189
|
-
throw new
|
|
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)
|
|
192
|
+
throw new w(
|
|
190
193
|
"VueStripePaymentElement must be used within VueStripeElements"
|
|
191
194
|
);
|
|
192
|
-
const
|
|
193
|
-
if (!
|
|
194
|
-
|
|
195
|
+
const v = () => {
|
|
196
|
+
if (!u.elements.value) {
|
|
197
|
+
s.value = "Elements instance not available", r.value = !1;
|
|
195
198
|
return;
|
|
196
199
|
}
|
|
197
200
|
if (!l.value) {
|
|
198
|
-
|
|
201
|
+
s.value = "Mount point not available", r.value = !1;
|
|
199
202
|
return;
|
|
200
203
|
}
|
|
201
204
|
try {
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
}), e.value.on("change", (
|
|
205
|
-
|
|
205
|
+
s.value = null, r.value = !0, e.value = u.elements.value.create("payment", a.options), e.value.on("ready", () => {
|
|
206
|
+
r.value = !1, n("ready", e.value);
|
|
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", () => {
|
|
209
|
-
|
|
212
|
+
n("blur");
|
|
210
213
|
}), e.value.on("escape", () => {
|
|
211
|
-
|
|
214
|
+
n("escape");
|
|
212
215
|
});
|
|
213
|
-
const
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
}),
|
|
217
|
-
|
|
216
|
+
const t = e.value;
|
|
217
|
+
t.on("loaderstart", () => {
|
|
218
|
+
n("loaderstart");
|
|
219
|
+
}), t.on("loaderstop", () => {
|
|
220
|
+
n("loaderstop");
|
|
218
221
|
}), e.value.mount(l.value);
|
|
219
|
-
} catch (
|
|
220
|
-
const
|
|
221
|
-
|
|
222
|
+
} catch (t) {
|
|
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
|
-
return
|
|
225
|
-
() =>
|
|
226
|
-
(
|
|
227
|
-
e.value &&
|
|
227
|
+
return y(
|
|
228
|
+
() => a.options,
|
|
229
|
+
(t) => {
|
|
230
|
+
e.value && t && e.value.update(t);
|
|
228
231
|
},
|
|
229
232
|
{ deep: !0 }
|
|
230
|
-
),
|
|
231
|
-
() =>
|
|
232
|
-
(
|
|
233
|
-
|
|
233
|
+
), y(
|
|
234
|
+
() => u.elements.value,
|
|
235
|
+
(t) => {
|
|
236
|
+
t && l.value && !e.value && v();
|
|
234
237
|
},
|
|
235
238
|
{ immediate: !0 }
|
|
236
|
-
),
|
|
237
|
-
|
|
238
|
-
}),
|
|
239
|
+
), I(() => {
|
|
240
|
+
u.elements.value && l.value && !e.value && v();
|
|
241
|
+
}), x(() => {
|
|
239
242
|
e.value && e.value.destroy();
|
|
240
|
-
}),
|
|
243
|
+
}), d({
|
|
241
244
|
element: e,
|
|
242
|
-
loading:
|
|
243
|
-
error:
|
|
244
|
-
}), (
|
|
245
|
-
m(
|
|
246
|
-
|
|
247
|
-
g("div",
|
|
245
|
+
loading: r,
|
|
246
|
+
error: s
|
|
247
|
+
}), (t, i) => (h(), f("div", ue, [
|
|
248
|
+
m(s) ? (h(), f("div", ie, [
|
|
249
|
+
b(t.$slots, "error", { error: m(s) }, () => [
|
|
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
255
|
ref: l,
|
|
253
|
-
class:
|
|
256
|
+
class: R(["vue-stripe-payment-element-mount", { "vue-stripe-payment-element-loading": m(r) }])
|
|
254
257
|
}, null, 2),
|
|
255
|
-
m(
|
|
256
|
-
|
|
257
|
-
|
|
258
|
+
m(r) ? (h(), f("div", ve, [
|
|
259
|
+
b(t.$slots, "loading", {}, () => [
|
|
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
|
-
throw new
|
|
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)
|
|
280
|
+
throw new w(
|
|
278
281
|
"VueStripeExpressCheckoutElement must be used within VueStripeElements"
|
|
279
282
|
);
|
|
280
|
-
const
|
|
281
|
-
if (!
|
|
282
|
-
|
|
283
|
+
const v = () => {
|
|
284
|
+
if (!u.elements.value) {
|
|
285
|
+
s.value = "Elements instance not available", r.value = !1;
|
|
283
286
|
return;
|
|
284
287
|
}
|
|
285
288
|
if (!l.value) {
|
|
286
|
-
|
|
289
|
+
s.value = "Mount point not available", r.value = !1;
|
|
287
290
|
return;
|
|
288
291
|
}
|
|
289
292
|
try {
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
}), e.value.on("click", (
|
|
293
|
-
|
|
294
|
-
}), e.value.on("confirm", (
|
|
295
|
-
|
|
293
|
+
s.value = null, r.value = !0, e.value = u.elements.value.create("expressCheckout", a.options), e.value.on("ready", (t) => {
|
|
294
|
+
r.value = !1, n("ready", t);
|
|
295
|
+
}), e.value.on("click", (t) => {
|
|
296
|
+
n("click", t);
|
|
297
|
+
}), e.value.on("confirm", (t) => {
|
|
298
|
+
n("confirm", t);
|
|
296
299
|
}), e.value.on("cancel", () => {
|
|
297
|
-
|
|
298
|
-
}), e.value.on("shippingaddresschange", (
|
|
299
|
-
|
|
300
|
-
}), e.value.on("shippingratechange", (
|
|
301
|
-
|
|
300
|
+
n("cancel");
|
|
301
|
+
}), e.value.on("shippingaddresschange", (t) => {
|
|
302
|
+
n("shippingaddresschange", t);
|
|
303
|
+
}), e.value.on("shippingratechange", (t) => {
|
|
304
|
+
n("shippingratechange", t);
|
|
302
305
|
}), e.value.mount(l.value);
|
|
303
|
-
} catch (
|
|
304
|
-
const
|
|
305
|
-
|
|
306
|
+
} catch (t) {
|
|
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
|
-
return
|
|
309
|
-
() =>
|
|
310
|
-
(
|
|
311
|
-
e.value &&
|
|
311
|
+
return y(
|
|
312
|
+
() => a.options,
|
|
313
|
+
(t) => {
|
|
314
|
+
e.value && t && e.value.update(t);
|
|
312
315
|
},
|
|
313
316
|
{ deep: !0 }
|
|
314
|
-
),
|
|
315
|
-
() =>
|
|
316
|
-
(
|
|
317
|
-
|
|
317
|
+
), y(
|
|
318
|
+
() => u.elements.value,
|
|
319
|
+
(t) => {
|
|
320
|
+
t && l.value && !e.value && v();
|
|
318
321
|
},
|
|
319
322
|
{ immediate: !0 }
|
|
320
|
-
),
|
|
321
|
-
|
|
322
|
-
}),
|
|
323
|
+
), I(() => {
|
|
324
|
+
u.elements.value && l.value && !e.value && v();
|
|
325
|
+
}), x(() => {
|
|
323
326
|
e.value && e.value.destroy();
|
|
324
|
-
}),
|
|
327
|
+
}), d({
|
|
325
328
|
element: e,
|
|
326
|
-
loading:
|
|
327
|
-
error:
|
|
328
|
-
}), (
|
|
329
|
-
m(
|
|
330
|
-
|
|
331
|
-
g("div",
|
|
329
|
+
loading: r,
|
|
330
|
+
error: s
|
|
331
|
+
}), (t, i) => (h(), f("div", pe, [
|
|
332
|
+
m(s) ? (h(), f("div", me, [
|
|
333
|
+
b(t.$slots, "error", { error: m(s) }, () => [
|
|
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
339
|
ref: l,
|
|
337
|
-
class:
|
|
340
|
+
class: R(["vue-stripe-express-checkout-element-mount", { "vue-stripe-express-checkout-element-loading": m(r) }])
|
|
338
341
|
}, null, 2),
|
|
339
|
-
m(
|
|
340
|
-
|
|
341
|
-
|
|
342
|
+
m(r) ? (h(), f("div", he, [
|
|
343
|
+
b(t.$slots, "loading", {}, () => [
|
|
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
|
-
}, Ee = { class: "vue-stripe-error-message" },
|
|
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
|
-
throw new
|
|
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)
|
|
364
|
+
throw new w(
|
|
362
365
|
"VueStripeCardElement must be used within VueStripeElements"
|
|
363
366
|
);
|
|
364
|
-
const
|
|
365
|
-
if (!
|
|
366
|
-
|
|
367
|
+
const v = () => {
|
|
368
|
+
if (!u.elements.value) {
|
|
369
|
+
s.value = "Elements instance not available", r.value = !1;
|
|
367
370
|
return;
|
|
368
371
|
}
|
|
369
372
|
if (!l.value) {
|
|
370
|
-
|
|
373
|
+
s.value = "Mount point not available", r.value = !1;
|
|
371
374
|
return;
|
|
372
375
|
}
|
|
373
376
|
try {
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
}), e.value.on("change", (
|
|
377
|
-
|
|
377
|
+
s.value = null, r.value = !0, e.value = u.elements.value.create("card", a.options), e.value.on("ready", () => {
|
|
378
|
+
r.value = !1, n("ready", e.value);
|
|
379
|
+
}), e.value.on("change", (t) => {
|
|
380
|
+
t.error ? s.value = t.error.message : s.value = null, n("change", t);
|
|
378
381
|
}), e.value.on("focus", () => {
|
|
379
|
-
|
|
382
|
+
n("focus");
|
|
380
383
|
}), e.value.on("blur", () => {
|
|
381
|
-
|
|
384
|
+
n("blur");
|
|
382
385
|
}), e.value.on("escape", () => {
|
|
383
|
-
|
|
386
|
+
n("escape");
|
|
384
387
|
}), e.value.mount(l.value);
|
|
385
|
-
} catch (
|
|
386
|
-
const
|
|
387
|
-
|
|
388
|
+
} catch (t) {
|
|
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
|
-
return
|
|
391
|
-
() =>
|
|
392
|
-
(
|
|
393
|
-
e.value &&
|
|
393
|
+
return y(
|
|
394
|
+
() => a.options,
|
|
395
|
+
(t) => {
|
|
396
|
+
e.value && t && e.value.update(t);
|
|
394
397
|
},
|
|
395
398
|
{ deep: !0 }
|
|
396
|
-
),
|
|
397
|
-
() =>
|
|
398
|
-
(
|
|
399
|
-
|
|
399
|
+
), y(
|
|
400
|
+
() => u.elements.value,
|
|
401
|
+
(t) => {
|
|
402
|
+
t && l.value && !e.value && v();
|
|
400
403
|
},
|
|
401
404
|
{ immediate: !0 }
|
|
402
|
-
),
|
|
403
|
-
|
|
404
|
-
}),
|
|
405
|
+
), I(() => {
|
|
406
|
+
u.elements.value && l.value && !e.value && v();
|
|
407
|
+
}), x(() => {
|
|
405
408
|
e.value && e.value.destroy();
|
|
406
|
-
}),
|
|
409
|
+
}), d({
|
|
407
410
|
element: e,
|
|
408
|
-
loading:
|
|
409
|
-
error:
|
|
411
|
+
loading: r,
|
|
412
|
+
error: s,
|
|
410
413
|
focus: () => e.value?.focus(),
|
|
411
414
|
blur: () => e.value?.blur(),
|
|
412
415
|
clear: () => e.value?.clear()
|
|
413
|
-
}), (
|
|
414
|
-
m(
|
|
415
|
-
|
|
416
|
-
g("div", Ee,
|
|
416
|
+
}), (t, i) => (h(), f("div", ye, [
|
|
417
|
+
m(s) ? (h(), f("div", be, [
|
|
418
|
+
b(t.$slots, "error", { error: m(s) }, () => [
|
|
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
424
|
ref: l,
|
|
422
|
-
class:
|
|
425
|
+
class: R(["vue-stripe-card-element-mount", { "vue-stripe-card-element-loading": m(r) }])
|
|
423
426
|
}, null, 2),
|
|
424
|
-
m(
|
|
425
|
-
|
|
426
|
-
|
|
427
|
+
m(r) ? (h(), f("div", _e, [
|
|
428
|
+
b(t.$slots, "loading", {}, () => [
|
|
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,61 +442,61 @@ function L({ elementType: a, componentName: n }) {
|
|
|
439
442
|
}
|
|
440
443
|
},
|
|
441
444
|
emits: ["ready", "change", "focus", "blur", "escape"],
|
|
442
|
-
setup(
|
|
443
|
-
const l =
|
|
444
|
-
if (!
|
|
445
|
-
throw new
|
|
446
|
-
`${
|
|
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)
|
|
448
|
+
throw new w(
|
|
449
|
+
`${d} must be used within VueStripeElements`
|
|
447
450
|
);
|
|
448
|
-
const
|
|
449
|
-
if (!
|
|
450
|
-
|
|
451
|
+
const v = () => {
|
|
452
|
+
if (!u.elements.value) {
|
|
453
|
+
s.value = "Elements instance not available", r.value = !1;
|
|
451
454
|
return;
|
|
452
455
|
}
|
|
453
456
|
if (!l.value) {
|
|
454
|
-
|
|
457
|
+
s.value = "Mount point not available", r.value = !1;
|
|
455
458
|
return;
|
|
456
459
|
}
|
|
457
460
|
try {
|
|
458
|
-
|
|
459
|
-
const
|
|
460
|
-
e.value =
|
|
461
|
-
|
|
462
|
-
}),
|
|
463
|
-
const
|
|
464
|
-
|
|
465
|
-
}),
|
|
466
|
-
|
|
467
|
-
}),
|
|
468
|
-
|
|
469
|
-
}),
|
|
470
|
-
|
|
471
|
-
}),
|
|
472
|
-
} catch (
|
|
473
|
-
const
|
|
474
|
-
|
|
461
|
+
s.value = null, r.value = !0;
|
|
462
|
+
const t = u.elements.value.create(o, c.options);
|
|
463
|
+
e.value = t, t.on("ready", () => {
|
|
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);
|
|
468
|
+
}), t.on("focus", () => {
|
|
469
|
+
a("focus");
|
|
470
|
+
}), t.on("blur", () => {
|
|
471
|
+
a("blur");
|
|
472
|
+
}), t.on("escape", () => {
|
|
473
|
+
a("escape");
|
|
474
|
+
}), t.mount(l.value);
|
|
475
|
+
} catch (t) {
|
|
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
|
-
return
|
|
478
|
-
() =>
|
|
479
|
-
(
|
|
480
|
-
e.value?.update &&
|
|
480
|
+
return y(
|
|
481
|
+
() => c.options,
|
|
482
|
+
(t) => {
|
|
483
|
+
e.value?.update && t && e.value.update(t);
|
|
481
484
|
},
|
|
482
485
|
{ deep: !0 }
|
|
483
|
-
),
|
|
484
|
-
() =>
|
|
485
|
-
(
|
|
486
|
-
|
|
486
|
+
), y(
|
|
487
|
+
() => u.elements.value,
|
|
488
|
+
(t) => {
|
|
489
|
+
t && l.value && !e.value && v();
|
|
487
490
|
},
|
|
488
491
|
{ immediate: !0 }
|
|
489
|
-
),
|
|
490
|
-
|
|
491
|
-
}),
|
|
492
|
+
), I(() => {
|
|
493
|
+
u.elements.value && l.value && !e.value && v();
|
|
494
|
+
}), x(() => {
|
|
492
495
|
e.value && e.value.destroy();
|
|
493
|
-
}),
|
|
496
|
+
}), n({
|
|
494
497
|
element: e,
|
|
495
|
-
loading:
|
|
496
|
-
error:
|
|
498
|
+
loading: r,
|
|
499
|
+
error: s,
|
|
497
500
|
focus: () => {
|
|
498
501
|
e.value?.focus?.();
|
|
499
502
|
},
|
|
@@ -504,89 +507,89 @@ function L({ elementType: a, componentName: n }) {
|
|
|
504
507
|
e.value?.clear?.();
|
|
505
508
|
}
|
|
506
509
|
}), () => {
|
|
507
|
-
const
|
|
508
|
-
return
|
|
509
|
-
|
|
510
|
-
|
|
510
|
+
const t = `vue-stripe-${o}-element`;
|
|
511
|
+
return M("div", { class: t }, [
|
|
512
|
+
s.value && M("div", { class: `${t}-error` }, [
|
|
513
|
+
M("div", { class: "vue-stripe-error-message" }, s.value)
|
|
511
514
|
]),
|
|
512
|
-
|
|
515
|
+
M("div", {
|
|
513
516
|
ref: l,
|
|
514
517
|
class: {
|
|
515
|
-
[`${
|
|
516
|
-
[`${
|
|
518
|
+
[`${t}-mount`]: !0,
|
|
519
|
+
[`${t}-loading`]: r.value
|
|
517
520
|
}
|
|
518
521
|
}),
|
|
519
|
-
|
|
520
|
-
|
|
522
|
+
r.value && M("div", { class: `${t}-loader` }, [
|
|
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
|
|
545
|
+
setup(o, { expose: d, emit: c }) {
|
|
546
|
+
const a = o, n = c, l = _(S);
|
|
544
547
|
if (!l)
|
|
545
|
-
throw new
|
|
548
|
+
throw new w(
|
|
546
549
|
"VueStripeLinkAuthenticationElement must be used within VueStripeElements"
|
|
547
550
|
);
|
|
548
|
-
const e =
|
|
551
|
+
const e = p(), r = p(null), s = () => {
|
|
549
552
|
if (!(!l.elements?.value || !e.value))
|
|
550
553
|
try {
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
}),
|
|
554
|
-
|
|
554
|
+
r.value = l.elements?.value.create("linkAuthentication", a.options), r.value.mount(e.value), r.value.on("ready", () => {
|
|
555
|
+
r.value && n("ready", r.value);
|
|
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
|
-
},
|
|
560
|
-
|
|
562
|
+
}, u = () => {
|
|
563
|
+
r.value && (r.value.unmount(), r.value.destroy(), r.value = null);
|
|
561
564
|
};
|
|
562
|
-
return
|
|
565
|
+
return y(
|
|
563
566
|
() => l.elements?.value,
|
|
564
|
-
(
|
|
565
|
-
|
|
567
|
+
(v) => {
|
|
568
|
+
v && e.value && !r.value && s();
|
|
566
569
|
},
|
|
567
570
|
{ immediate: !0 }
|
|
568
|
-
),
|
|
569
|
-
() =>
|
|
570
|
-
(
|
|
571
|
-
|
|
571
|
+
), y(
|
|
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
|
-
),
|
|
575
|
-
l.elements?.value && e.value &&
|
|
576
|
-
}),
|
|
577
|
-
|
|
578
|
-
}),
|
|
579
|
-
element:
|
|
580
|
-
focus: () =>
|
|
581
|
-
blur: () =>
|
|
582
|
-
clear: () =>
|
|
583
|
-
}), (
|
|
577
|
+
), I(() => {
|
|
578
|
+
l.elements?.value && e.value && s();
|
|
579
|
+
}), x(() => {
|
|
580
|
+
u();
|
|
581
|
+
}), d({
|
|
582
|
+
element: r,
|
|
583
|
+
focus: () => r.value?.focus(),
|
|
584
|
+
blur: () => r.value?.blur(),
|
|
585
|
+
clear: () => r.value?.clear()
|
|
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,76 +600,421 @@ const Fe = L({
|
|
|
597
600
|
}
|
|
598
601
|
},
|
|
599
602
|
emits: ["ready", "change", "blur", "focus", "escape", "loadError"],
|
|
600
|
-
setup(
|
|
601
|
-
const
|
|
603
|
+
setup(o, { emit: d, expose: c }) {
|
|
604
|
+
const a = p(), n = p(null), l = _(S);
|
|
602
605
|
if (!l)
|
|
603
|
-
throw new
|
|
606
|
+
throw new w("VueStripeAddressElement must be used within VueStripeElements");
|
|
604
607
|
const e = () => {
|
|
605
|
-
|
|
606
|
-
},
|
|
607
|
-
|
|
608
|
+
d("ready");
|
|
609
|
+
}, r = (U) => {
|
|
610
|
+
d("change", U);
|
|
611
|
+
}, s = () => {
|
|
612
|
+
d("blur");
|
|
613
|
+
}, u = () => {
|
|
614
|
+
d("focus");
|
|
615
|
+
}, v = () => {
|
|
616
|
+
d("escape");
|
|
617
|
+
}, t = (U) => {
|
|
618
|
+
d("loadError", U);
|
|
608
619
|
}, i = () => {
|
|
609
|
-
n("blur");
|
|
610
|
-
},
|
|
611
|
-
n(
|
|
612
|
-
},
|
|
613
|
-
n("escape");
|
|
614
|
-
},
|
|
615
|
-
n
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
},
|
|
619
|
-
|
|
620
|
-
},
|
|
621
|
-
|
|
622
|
-
}, z = async () => {
|
|
623
|
-
if (!s.value)
|
|
624
|
-
throw new k("Address element not mounted");
|
|
625
|
-
return s.value.getValue();
|
|
626
|
-
}, j = () => {
|
|
627
|
-
s.value?.focus();
|
|
628
|
-
}, K = () => {
|
|
629
|
-
s.value?.clear();
|
|
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);
|
|
623
|
+
}, X = () => {
|
|
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);
|
|
625
|
+
}, F = async () => {
|
|
626
|
+
if (!n.value)
|
|
627
|
+
throw new w("Address element not mounted");
|
|
628
|
+
return n.value.getValue();
|
|
629
|
+
}, z = () => {
|
|
630
|
+
n.value?.focus();
|
|
631
|
+
}, N = () => {
|
|
632
|
+
n.value?.clear();
|
|
630
633
|
};
|
|
631
|
-
return
|
|
632
|
-
|
|
633
|
-
}),
|
|
634
|
-
|
|
635
|
-
}),
|
|
636
|
-
|
|
637
|
-
}, { deep: !0 }),
|
|
638
|
-
element:
|
|
639
|
-
getValue:
|
|
640
|
-
focus:
|
|
641
|
-
clear:
|
|
634
|
+
return I(() => {
|
|
635
|
+
i();
|
|
636
|
+
}), H(() => {
|
|
637
|
+
X();
|
|
638
|
+
}), y(() => o.options, () => {
|
|
639
|
+
T();
|
|
640
|
+
}, { deep: !0 }), c({
|
|
641
|
+
element: n,
|
|
642
|
+
getValue: F,
|
|
643
|
+
focus: z,
|
|
644
|
+
clear: N
|
|
642
645
|
}), {
|
|
643
|
-
addressRef:
|
|
644
|
-
element:
|
|
645
|
-
getValue:
|
|
646
|
-
focus:
|
|
647
|
-
clear:
|
|
646
|
+
addressRef: a,
|
|
647
|
+
element: n,
|
|
648
|
+
getValue: F,
|
|
649
|
+
focus: z,
|
|
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
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
657
|
+
const ot = /* @__PURE__ */ C(we, [["render", $e]]), Ie = { class: "vue-stripe-iban-element" }, Ce = {
|
|
658
|
+
key: 0,
|
|
659
|
+
class: "vue-stripe-iban-element-error"
|
|
660
|
+
}, Pe = { class: "vue-stripe-error-message" }, xe = {
|
|
661
|
+
key: 1,
|
|
662
|
+
class: "vue-stripe-iban-element-loader"
|
|
663
|
+
}, Te = /* @__PURE__ */ V({
|
|
664
|
+
__name: "VueStripeIbanElement",
|
|
665
|
+
props: {
|
|
666
|
+
options: {}
|
|
667
|
+
},
|
|
668
|
+
emits: ["ready", "change", "focus", "blur", "escape"],
|
|
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)
|
|
672
|
+
throw new w(
|
|
673
|
+
"VueStripeIbanElement must be used within VueStripeElements"
|
|
674
|
+
);
|
|
675
|
+
const v = () => {
|
|
676
|
+
if (!u.elements.value) {
|
|
677
|
+
s.value = "Elements instance not available", r.value = !1;
|
|
678
|
+
return;
|
|
679
|
+
}
|
|
680
|
+
if (!l.value) {
|
|
681
|
+
s.value = "Mount point not available", r.value = !1;
|
|
682
|
+
return;
|
|
683
|
+
}
|
|
684
|
+
try {
|
|
685
|
+
s.value = null, r.value = !0;
|
|
686
|
+
const t = {
|
|
687
|
+
supportedCountries: ["SEPA"],
|
|
688
|
+
...a.options
|
|
689
|
+
};
|
|
690
|
+
e.value = u.elements.value.create("iban", t), e.value.on("ready", () => {
|
|
691
|
+
r.value = !1, n("ready", e.value);
|
|
692
|
+
}), e.value.on("change", (i) => {
|
|
693
|
+
i.error ? s.value = i.error.message : s.value = null, n("change", i);
|
|
694
|
+
}), e.value.on("focus", () => {
|
|
695
|
+
n("focus");
|
|
696
|
+
}), e.value.on("blur", () => {
|
|
697
|
+
n("blur");
|
|
698
|
+
}), e.value.on("escape", () => {
|
|
699
|
+
n("escape");
|
|
700
|
+
}), e.value.mount(l.value);
|
|
701
|
+
} catch (t) {
|
|
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);
|
|
704
|
+
}
|
|
705
|
+
};
|
|
706
|
+
return y(
|
|
707
|
+
() => a.options,
|
|
708
|
+
(t) => {
|
|
709
|
+
e.value && t && e.value.update(t);
|
|
710
|
+
},
|
|
711
|
+
{ deep: !0 }
|
|
712
|
+
), y(
|
|
713
|
+
() => u.elements.value,
|
|
714
|
+
(t) => {
|
|
715
|
+
t && l.value && !e.value && v();
|
|
716
|
+
},
|
|
717
|
+
{ immediate: !0 }
|
|
718
|
+
), I(() => {
|
|
719
|
+
u.elements.value && l.value && !e.value && v();
|
|
720
|
+
}), x(() => {
|
|
721
|
+
e.value && e.value.destroy();
|
|
722
|
+
}), d({
|
|
723
|
+
element: e,
|
|
724
|
+
loading: r,
|
|
725
|
+
error: s,
|
|
726
|
+
focus: () => e.value?.focus(),
|
|
727
|
+
blur: () => e.value?.blur(),
|
|
728
|
+
clear: () => e.value?.clear()
|
|
729
|
+
}), (t, i) => (h(), f("div", Ie, [
|
|
730
|
+
m(s) ? (h(), f("div", Ce, [
|
|
731
|
+
b(t.$slots, "error", { error: m(s) }, () => [
|
|
732
|
+
g("div", Pe, P(m(s)), 1)
|
|
733
|
+
], !0)
|
|
734
|
+
])) : k("", !0),
|
|
735
|
+
g("div", {
|
|
736
|
+
ref_key: "elementRef",
|
|
737
|
+
ref: l,
|
|
738
|
+
class: R(["vue-stripe-iban-element-mount", { "vue-stripe-iban-element-loading": m(r) }])
|
|
739
|
+
}, null, 2),
|
|
740
|
+
m(r) ? (h(), f("div", xe, [
|
|
741
|
+
b(t.$slots, "loading", {}, () => [
|
|
742
|
+
i[0] || (i[0] = g("div", { class: "vue-stripe-loading-message" }, " Loading IBAN form... ", -1))
|
|
743
|
+
], !0)
|
|
744
|
+
])) : k("", !0)
|
|
745
|
+
]));
|
|
746
|
+
}
|
|
747
|
+
}), ut = /* @__PURE__ */ C(Te, [["__scopeId", "data-v-f8ffb457"]]), Re = { class: "vue-stripe-ideal-bank-element" }, Me = {
|
|
748
|
+
key: 0,
|
|
749
|
+
class: "vue-stripe-ideal-bank-element-error"
|
|
750
|
+
}, Ae = { class: "vue-stripe-error-message" }, Ue = {
|
|
751
|
+
key: 1,
|
|
752
|
+
class: "vue-stripe-ideal-bank-element-loader"
|
|
753
|
+
}, Be = /* @__PURE__ */ V({
|
|
754
|
+
__name: "VueStripeIdealBankElement",
|
|
755
|
+
props: {
|
|
756
|
+
options: {}
|
|
757
|
+
},
|
|
758
|
+
emits: ["ready", "change", "focus", "blur", "escape"],
|
|
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)
|
|
762
|
+
throw new w(
|
|
763
|
+
"VueStripeIdealBankElement must be used within VueStripeElements"
|
|
764
|
+
);
|
|
765
|
+
const v = () => {
|
|
766
|
+
if (!u.elements.value) {
|
|
767
|
+
s.value = "Elements instance not available", r.value = !1;
|
|
768
|
+
return;
|
|
769
|
+
}
|
|
770
|
+
if (!l.value) {
|
|
771
|
+
s.value = "Mount point not available", r.value = !1;
|
|
772
|
+
return;
|
|
773
|
+
}
|
|
774
|
+
try {
|
|
775
|
+
s.value = null, r.value = !0, e.value = u.elements.value.create("idealBank", a.options), e.value.on("ready", () => {
|
|
776
|
+
r.value = !1, n("ready", e.value);
|
|
777
|
+
}), e.value.on("change", (t) => {
|
|
778
|
+
t.error ? s.value = t.error.message : s.value = null, n("change", t);
|
|
779
|
+
}), e.value.on("focus", () => {
|
|
780
|
+
n("focus");
|
|
781
|
+
}), e.value.on("blur", () => {
|
|
782
|
+
n("blur");
|
|
783
|
+
}), e.value.on("escape", () => {
|
|
784
|
+
n("escape");
|
|
785
|
+
}), e.value.mount(l.value);
|
|
786
|
+
} catch (t) {
|
|
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);
|
|
789
|
+
}
|
|
790
|
+
};
|
|
791
|
+
return y(
|
|
792
|
+
() => a.options,
|
|
793
|
+
(t) => {
|
|
794
|
+
e.value && t && e.value.update(t);
|
|
795
|
+
},
|
|
796
|
+
{ deep: !0 }
|
|
797
|
+
), y(
|
|
798
|
+
() => u.elements.value,
|
|
799
|
+
(t) => {
|
|
800
|
+
t && l.value && !e.value && v();
|
|
801
|
+
},
|
|
802
|
+
{ immediate: !0 }
|
|
803
|
+
), I(() => {
|
|
804
|
+
u.elements.value && l.value && !e.value && v();
|
|
805
|
+
}), x(() => {
|
|
806
|
+
e.value && e.value.destroy();
|
|
807
|
+
}), d({
|
|
808
|
+
element: e,
|
|
809
|
+
loading: r,
|
|
810
|
+
error: s,
|
|
811
|
+
focus: () => e.value?.focus(),
|
|
812
|
+
blur: () => e.value?.blur(),
|
|
813
|
+
clear: () => e.value?.clear()
|
|
814
|
+
}), (t, i) => (h(), f("div", Re, [
|
|
815
|
+
m(s) ? (h(), f("div", Me, [
|
|
816
|
+
b(t.$slots, "error", { error: m(s) }, () => [
|
|
817
|
+
g("div", Ae, P(m(s)), 1)
|
|
818
|
+
], !0)
|
|
819
|
+
])) : k("", !0),
|
|
820
|
+
g("div", {
|
|
821
|
+
ref_key: "elementRef",
|
|
822
|
+
ref: l,
|
|
823
|
+
class: R(["vue-stripe-ideal-bank-element-mount", { "vue-stripe-ideal-bank-element-loading": m(r) }])
|
|
824
|
+
}, null, 2),
|
|
825
|
+
m(r) ? (h(), f("div", Ue, [
|
|
826
|
+
b(t.$slots, "loading", {}, () => [
|
|
827
|
+
i[0] || (i[0] = g("div", { class: "vue-stripe-loading-message" }, " Loading iDEAL bank selector... ", -1))
|
|
828
|
+
], !0)
|
|
829
|
+
])) : k("", !0)
|
|
830
|
+
]));
|
|
831
|
+
}
|
|
832
|
+
}), it = /* @__PURE__ */ C(Be, [["__scopeId", "data-v-3d7f7e08"]]), Le = { class: "vue-stripe-p24-bank-element" }, Fe = {
|
|
833
|
+
key: 0,
|
|
834
|
+
class: "vue-stripe-p24-bank-element-error"
|
|
835
|
+
}, ze = { class: "vue-stripe-error-message" }, Ne = {
|
|
836
|
+
key: 1,
|
|
837
|
+
class: "vue-stripe-p24-bank-element-loader"
|
|
838
|
+
}, je = /* @__PURE__ */ V({
|
|
839
|
+
__name: "VueStripeP24BankElement",
|
|
840
|
+
props: {
|
|
841
|
+
options: {}
|
|
842
|
+
},
|
|
843
|
+
emits: ["ready", "change", "focus", "blur", "escape"],
|
|
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)
|
|
847
|
+
throw new w(
|
|
848
|
+
"VueStripeP24BankElement must be used within VueStripeElements"
|
|
849
|
+
);
|
|
850
|
+
const v = () => {
|
|
851
|
+
if (!u.elements.value) {
|
|
852
|
+
s.value = "Elements instance not available", r.value = !1;
|
|
853
|
+
return;
|
|
854
|
+
}
|
|
855
|
+
if (!l.value) {
|
|
856
|
+
s.value = "Mount point not available", r.value = !1;
|
|
857
|
+
return;
|
|
858
|
+
}
|
|
859
|
+
try {
|
|
860
|
+
s.value = null, r.value = !0, e.value = u.elements.value.create("p24Bank", a.options || {}), e.value.on("ready", () => {
|
|
861
|
+
r.value = !1, n("ready", e.value);
|
|
862
|
+
}), e.value.on("change", (t) => {
|
|
863
|
+
t.error ? s.value = t.error.message : s.value = null, n("change", t);
|
|
864
|
+
}), e.value.on("focus", () => {
|
|
865
|
+
n("focus");
|
|
866
|
+
}), e.value.on("blur", () => {
|
|
867
|
+
n("blur");
|
|
868
|
+
}), e.value.on("escape", () => {
|
|
869
|
+
n("escape");
|
|
870
|
+
}), e.value.mount(l.value);
|
|
871
|
+
} catch (t) {
|
|
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);
|
|
874
|
+
}
|
|
875
|
+
};
|
|
876
|
+
return y(
|
|
877
|
+
() => a.options,
|
|
878
|
+
(t) => {
|
|
879
|
+
e.value && t && e.value.update(t);
|
|
880
|
+
},
|
|
881
|
+
{ deep: !0 }
|
|
882
|
+
), y(
|
|
883
|
+
() => u.elements.value,
|
|
884
|
+
(t) => {
|
|
885
|
+
t && l.value && !e.value && v();
|
|
886
|
+
},
|
|
887
|
+
{ immediate: !0 }
|
|
888
|
+
), I(() => {
|
|
889
|
+
u.elements.value && l.value && !e.value && v();
|
|
890
|
+
}), x(() => {
|
|
891
|
+
e.value && e.value.destroy();
|
|
892
|
+
}), d({
|
|
893
|
+
element: e,
|
|
894
|
+
loading: r,
|
|
895
|
+
error: s,
|
|
896
|
+
focus: () => e.value?.focus(),
|
|
897
|
+
blur: () => e.value?.blur(),
|
|
898
|
+
clear: () => e.value?.clear()
|
|
899
|
+
}), (t, i) => (h(), f("div", Le, [
|
|
900
|
+
m(s) ? (h(), f("div", Fe, [
|
|
901
|
+
b(t.$slots, "error", { error: m(s) }, () => [
|
|
902
|
+
g("div", ze, P(m(s)), 1)
|
|
903
|
+
], !0)
|
|
904
|
+
])) : k("", !0),
|
|
905
|
+
g("div", {
|
|
906
|
+
ref_key: "elementRef",
|
|
907
|
+
ref: l,
|
|
908
|
+
class: R(["vue-stripe-p24-bank-element-mount", { "vue-stripe-p24-bank-element-loading": m(r) }])
|
|
909
|
+
}, null, 2),
|
|
910
|
+
m(r) ? (h(), f("div", Ne, [
|
|
911
|
+
b(t.$slots, "loading", {}, () => [
|
|
912
|
+
i[0] || (i[0] = g("div", { class: "vue-stripe-loading-message" }, " Loading Przelewy24 bank selector... ", -1))
|
|
913
|
+
], !0)
|
|
914
|
+
])) : k("", !0)
|
|
915
|
+
]));
|
|
916
|
+
}
|
|
917
|
+
}), ct = /* @__PURE__ */ C(je, [["__scopeId", "data-v-29dc009e"]]), Ke = { class: "vue-stripe-eps-bank-element" }, qe = {
|
|
918
|
+
key: 0,
|
|
919
|
+
class: "vue-stripe-eps-bank-element-error"
|
|
920
|
+
}, De = { class: "vue-stripe-error-message" }, We = {
|
|
921
|
+
key: 1,
|
|
922
|
+
class: "vue-stripe-eps-bank-element-loader"
|
|
923
|
+
}, Xe = /* @__PURE__ */ V({
|
|
924
|
+
__name: "VueStripeEpsBankElement",
|
|
925
|
+
props: {
|
|
926
|
+
options: {}
|
|
927
|
+
},
|
|
928
|
+
emits: ["ready", "change", "focus", "blur", "escape"],
|
|
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)
|
|
932
|
+
throw new w(
|
|
933
|
+
"VueStripeEpsBankElement must be used within VueStripeElements"
|
|
934
|
+
);
|
|
935
|
+
const v = () => {
|
|
936
|
+
if (!u.elements.value) {
|
|
937
|
+
s.value = "Elements instance not available", r.value = !1;
|
|
938
|
+
return;
|
|
939
|
+
}
|
|
940
|
+
if (!l.value) {
|
|
941
|
+
s.value = "Mount point not available", r.value = !1;
|
|
942
|
+
return;
|
|
943
|
+
}
|
|
944
|
+
try {
|
|
945
|
+
s.value = null, r.value = !0, e.value = u.elements.value.create("epsBank", a.options || {}), e.value.on("ready", () => {
|
|
946
|
+
r.value = !1, n("ready", e.value);
|
|
947
|
+
}), e.value.on("change", (t) => {
|
|
948
|
+
t.error ? s.value = t.error.message : s.value = null, n("change", t);
|
|
949
|
+
}), e.value.on("focus", () => {
|
|
950
|
+
n("focus");
|
|
951
|
+
}), e.value.on("blur", () => {
|
|
952
|
+
n("blur");
|
|
953
|
+
}), e.value.on("escape", () => {
|
|
954
|
+
n("escape");
|
|
955
|
+
}), e.value.mount(l.value);
|
|
956
|
+
} catch (t) {
|
|
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);
|
|
959
|
+
}
|
|
960
|
+
};
|
|
961
|
+
return y(
|
|
962
|
+
() => a.options,
|
|
963
|
+
(t) => {
|
|
964
|
+
e.value && t && e.value.update(t);
|
|
965
|
+
},
|
|
966
|
+
{ deep: !0 }
|
|
967
|
+
), y(
|
|
968
|
+
() => u.elements.value,
|
|
969
|
+
(t) => {
|
|
970
|
+
t && l.value && !e.value && v();
|
|
971
|
+
},
|
|
972
|
+
{ immediate: !0 }
|
|
973
|
+
), I(() => {
|
|
974
|
+
u.elements.value && l.value && !e.value && v();
|
|
975
|
+
}), x(() => {
|
|
976
|
+
e.value && e.value.destroy();
|
|
977
|
+
}), d({
|
|
978
|
+
element: e,
|
|
979
|
+
loading: r,
|
|
980
|
+
error: s,
|
|
981
|
+
focus: () => e.value?.focus(),
|
|
982
|
+
blur: () => e.value?.blur(),
|
|
983
|
+
clear: () => e.value?.clear()
|
|
984
|
+
}), (t, i) => (h(), f("div", Ke, [
|
|
985
|
+
m(s) ? (h(), f("div", qe, [
|
|
986
|
+
b(t.$slots, "error", { error: m(s) }, () => [
|
|
987
|
+
g("div", De, P(m(s)), 1)
|
|
988
|
+
], !0)
|
|
989
|
+
])) : k("", !0),
|
|
990
|
+
g("div", {
|
|
991
|
+
ref_key: "elementRef",
|
|
992
|
+
ref: l,
|
|
993
|
+
class: R(["vue-stripe-eps-bank-element-mount", { "vue-stripe-eps-bank-element-loading": m(r) }])
|
|
994
|
+
}, null, 2),
|
|
995
|
+
m(r) ? (h(), f("div", We, [
|
|
996
|
+
b(t.$slots, "loading", {}, () => [
|
|
997
|
+
i[0] || (i[0] = g("div", { class: "vue-stripe-loading-message" }, " Loading EPS bank selector... ", -1))
|
|
998
|
+
], !0)
|
|
999
|
+
])) : k("", !0)
|
|
1000
|
+
]));
|
|
1001
|
+
}
|
|
1002
|
+
}), vt = /* @__PURE__ */ C(Xe, [["__scopeId", "data-v-27c62f72"]]);
|
|
1003
|
+
function W() {
|
|
1004
|
+
const o = _(A);
|
|
1005
|
+
if (!o)
|
|
1006
|
+
throw new E(
|
|
659
1007
|
"useStripe must be called within a VueStripeProvider component"
|
|
660
1008
|
);
|
|
661
1009
|
return {
|
|
662
|
-
stripe:
|
|
663
|
-
loading:
|
|
664
|
-
error:
|
|
1010
|
+
stripe: $(o.stripe),
|
|
1011
|
+
loading: $(o.loading),
|
|
1012
|
+
error: $(o.error),
|
|
665
1013
|
initialize: async () => {
|
|
666
1014
|
}
|
|
667
1015
|
};
|
|
668
1016
|
}
|
|
669
|
-
const
|
|
1017
|
+
const Ge = ["disabled"], He = /* @__PURE__ */ V({
|
|
670
1018
|
__name: "VueStripeCheckout",
|
|
671
1019
|
props: {
|
|
672
1020
|
sessionId: {},
|
|
@@ -684,260 +1032,264 @@ const Ce = ["disabled"], $e = /* @__PURE__ */ V({
|
|
|
684
1032
|
buttonClass: { default: "vue-stripe-checkout-button" }
|
|
685
1033
|
},
|
|
686
1034
|
emits: ["checkout", "success", "error", "before-redirect"],
|
|
687
|
-
setup(
|
|
688
|
-
const
|
|
689
|
-
e.value = !0,
|
|
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 () => {
|
|
1037
|
+
e.value = !0, n("checkout");
|
|
690
1038
|
try {
|
|
691
|
-
if (
|
|
692
|
-
|
|
1039
|
+
if (a.sessionUrl) {
|
|
1040
|
+
n("before-redirect", { url: a.sessionUrl }), window.location.replace(a.sessionUrl), n("success");
|
|
693
1041
|
return;
|
|
694
1042
|
}
|
|
695
|
-
if (
|
|
696
|
-
if (!
|
|
697
|
-
throw new
|
|
1043
|
+
if (a.sessionId) {
|
|
1044
|
+
if (!u())
|
|
1045
|
+
throw new E(
|
|
698
1046
|
"redirectToCheckout is not available. This method was removed in @stripe/stripe-js v8.x. Use sessionUrl prop with the checkout session URL instead."
|
|
699
1047
|
);
|
|
700
1048
|
if (!l.value)
|
|
701
|
-
throw new
|
|
702
|
-
const
|
|
703
|
-
sessionId:
|
|
1049
|
+
throw new E("Stripe not initialized");
|
|
1050
|
+
const t = await l.value.redirectToCheckout({
|
|
1051
|
+
sessionId: a.sessionId
|
|
704
1052
|
});
|
|
705
|
-
if (
|
|
706
|
-
throw new
|
|
707
|
-
|
|
1053
|
+
if (t.error)
|
|
1054
|
+
throw new E(t.error.message || "Redirect to checkout failed");
|
|
1055
|
+
n("success");
|
|
708
1056
|
return;
|
|
709
1057
|
}
|
|
710
|
-
if (
|
|
711
|
-
if (!
|
|
712
|
-
throw new
|
|
1058
|
+
if (a.priceId) {
|
|
1059
|
+
if (!u())
|
|
1060
|
+
throw new E(
|
|
713
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."
|
|
714
1062
|
);
|
|
715
1063
|
if (!l.value)
|
|
716
|
-
throw new
|
|
1064
|
+
throw new E("Stripe not initialized");
|
|
717
1065
|
console.warn(
|
|
718
1066
|
"[Vue Stripe] Price-based checkout is deprecated in v8.x. Create a Checkout Session on your server and use sessionUrl prop instead."
|
|
719
1067
|
);
|
|
720
|
-
const
|
|
1068
|
+
const t = await l.value.redirectToCheckout({
|
|
721
1069
|
lineItems: [
|
|
722
1070
|
{
|
|
723
|
-
price:
|
|
1071
|
+
price: a.priceId,
|
|
724
1072
|
quantity: 1
|
|
725
1073
|
}
|
|
726
1074
|
],
|
|
727
|
-
mode:
|
|
728
|
-
successUrl:
|
|
729
|
-
cancelUrl:
|
|
730
|
-
customerEmail:
|
|
731
|
-
clientReferenceId:
|
|
732
|
-
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
|
|
733
1081
|
});
|
|
734
|
-
if (
|
|
735
|
-
throw new
|
|
736
|
-
|
|
1082
|
+
if (t.error)
|
|
1083
|
+
throw new E(t.error.message || "Redirect to checkout failed");
|
|
1084
|
+
n("success");
|
|
737
1085
|
return;
|
|
738
1086
|
}
|
|
739
|
-
throw new
|
|
1087
|
+
throw new E(
|
|
740
1088
|
"Either sessionUrl, sessionId, or priceId is required. For @stripe/stripe-js v8.x, use sessionUrl."
|
|
741
1089
|
);
|
|
742
|
-
} catch (
|
|
743
|
-
const
|
|
744
|
-
|
|
1090
|
+
} catch (t) {
|
|
1091
|
+
const i = t instanceof Error ? t : new Error("Checkout failed");
|
|
1092
|
+
n("error", i), console.error("[Vue Stripe] Checkout error:", i);
|
|
745
1093
|
} finally {
|
|
746
1094
|
e.value = !1;
|
|
747
1095
|
}
|
|
748
1096
|
};
|
|
749
|
-
return
|
|
1097
|
+
return d({ checkout: v, loading: e }), (t, i) => m(s) ? (h(), f("span", {
|
|
750
1098
|
key: 0,
|
|
751
|
-
onClick:
|
|
1099
|
+
onClick: v,
|
|
752
1100
|
class: "vue-stripe-checkout-wrapper"
|
|
753
1101
|
}, [
|
|
754
|
-
|
|
755
|
-
checkout:
|
|
1102
|
+
b(t.$slots, "default", {
|
|
1103
|
+
checkout: v,
|
|
756
1104
|
loading: m(e),
|
|
757
|
-
disabled:
|
|
1105
|
+
disabled: o.disabled
|
|
758
1106
|
}, void 0, !0)
|
|
759
1107
|
])) : (h(), f("button", {
|
|
760
1108
|
key: 1,
|
|
761
|
-
disabled: m(e) ||
|
|
762
|
-
class:
|
|
763
|
-
onClick:
|
|
1109
|
+
disabled: m(e) || o.disabled,
|
|
1110
|
+
class: R(o.buttonClass),
|
|
1111
|
+
onClick: v
|
|
764
1112
|
}, [
|
|
765
|
-
m(e) ? (h(), f(
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
], 64)) : (h(), f(
|
|
769
|
-
|
|
1113
|
+
m(e) ? (h(), f(j, { key: 1 }, [
|
|
1114
|
+
i[0] || (i[0] = g("span", { class: "vue-stripe-loading-spinner" }, null, -1)),
|
|
1115
|
+
K(" " + P(o.loadingText), 1)
|
|
1116
|
+
], 64)) : (h(), f(j, { key: 0 }, [
|
|
1117
|
+
K(P(o.buttonText), 1)
|
|
770
1118
|
], 64))
|
|
771
|
-
], 10,
|
|
1119
|
+
], 10, Ge));
|
|
772
1120
|
}
|
|
773
|
-
}),
|
|
774
|
-
function
|
|
775
|
-
const
|
|
776
|
-
if (!
|
|
777
|
-
throw new
|
|
1121
|
+
}), dt = /* @__PURE__ */ C(He, [["__scopeId", "data-v-639387e4"]]);
|
|
1122
|
+
function pt() {
|
|
1123
|
+
const o = _(A), d = _(S);
|
|
1124
|
+
if (!o)
|
|
1125
|
+
throw new E(
|
|
778
1126
|
"usePaymentIntent must be called within a VueStripeProvider component"
|
|
779
1127
|
);
|
|
780
|
-
const
|
|
1128
|
+
const c = p(!1), a = p(null);
|
|
781
1129
|
return {
|
|
782
1130
|
confirmPayment: async (l) => {
|
|
783
|
-
if (!
|
|
784
|
-
return
|
|
785
|
-
|
|
1131
|
+
if (!o.stripe.value)
|
|
1132
|
+
return a.value = "Stripe not initialized", { error: { message: "Stripe not initialized" } };
|
|
1133
|
+
c.value = !0, a.value = null;
|
|
786
1134
|
try {
|
|
787
|
-
const e = l.elements ??
|
|
1135
|
+
const e = l.elements ?? d?.elements.value;
|
|
788
1136
|
if (e && !l.skipSubmit) {
|
|
789
|
-
const { error:
|
|
790
|
-
if (
|
|
791
|
-
return
|
|
1137
|
+
const { error: s } = await e.submit();
|
|
1138
|
+
if (s)
|
|
1139
|
+
return a.value = s.message || "Form validation failed", { error: s };
|
|
792
1140
|
}
|
|
793
|
-
const
|
|
1141
|
+
const r = await o.stripe.value.confirmPayment({
|
|
794
1142
|
elements: e ?? void 0,
|
|
795
1143
|
clientSecret: l.clientSecret,
|
|
796
1144
|
confirmParams: l.confirmParams ?? {},
|
|
797
1145
|
redirect: l.redirect ?? "if_required"
|
|
798
1146
|
});
|
|
799
|
-
return
|
|
1147
|
+
return r.error && (a.value = r.error.message || "Payment confirmation failed"), r;
|
|
800
1148
|
} catch (e) {
|
|
801
|
-
const
|
|
802
|
-
return
|
|
1149
|
+
const r = e instanceof Error ? e.message : "Payment confirmation failed";
|
|
1150
|
+
return a.value = r, { error: { message: r } };
|
|
803
1151
|
} finally {
|
|
804
|
-
|
|
1152
|
+
c.value = !1;
|
|
805
1153
|
}
|
|
806
1154
|
},
|
|
807
|
-
loading:
|
|
808
|
-
error:
|
|
1155
|
+
loading: $(c),
|
|
1156
|
+
error: $(a)
|
|
809
1157
|
};
|
|
810
1158
|
}
|
|
811
|
-
function
|
|
812
|
-
const
|
|
813
|
-
if (!
|
|
814
|
-
throw new
|
|
1159
|
+
function mt() {
|
|
1160
|
+
const o = _(A), d = _(S);
|
|
1161
|
+
if (!o)
|
|
1162
|
+
throw new E(
|
|
815
1163
|
"useSetupIntent must be called within a VueStripeProvider component"
|
|
816
1164
|
);
|
|
817
|
-
const
|
|
1165
|
+
const c = p(!1), a = p(null);
|
|
818
1166
|
return {
|
|
819
1167
|
confirmSetup: async (l) => {
|
|
820
|
-
if (!
|
|
821
|
-
return
|
|
822
|
-
|
|
1168
|
+
if (!o.stripe.value)
|
|
1169
|
+
return a.value = "Stripe not initialized", { error: { message: "Stripe not initialized" } };
|
|
1170
|
+
c.value = !0, a.value = null;
|
|
823
1171
|
try {
|
|
824
|
-
const e = l.elements ??
|
|
1172
|
+
const e = l.elements ?? d?.elements.value;
|
|
825
1173
|
if (e && !l.skipSubmit) {
|
|
826
|
-
const { error:
|
|
827
|
-
if (
|
|
828
|
-
return
|
|
1174
|
+
const { error: s } = await e.submit();
|
|
1175
|
+
if (s)
|
|
1176
|
+
return a.value = s.message || "Form validation failed", { error: s };
|
|
829
1177
|
}
|
|
830
|
-
const
|
|
1178
|
+
const r = await o.stripe.value.confirmSetup({
|
|
831
1179
|
elements: e ?? void 0,
|
|
832
1180
|
clientSecret: l.clientSecret,
|
|
833
1181
|
confirmParams: l.confirmParams ?? {},
|
|
834
1182
|
redirect: l.redirect ?? "if_required"
|
|
835
1183
|
});
|
|
836
|
-
return
|
|
1184
|
+
return r.error && (a.value = r.error.message || "Setup confirmation failed"), r;
|
|
837
1185
|
} catch (e) {
|
|
838
|
-
const
|
|
839
|
-
return
|
|
1186
|
+
const r = e instanceof Error ? e.message : "Setup confirmation failed";
|
|
1187
|
+
return a.value = r, { error: { message: r } };
|
|
840
1188
|
} finally {
|
|
841
|
-
|
|
1189
|
+
c.value = !1;
|
|
842
1190
|
}
|
|
843
1191
|
},
|
|
844
|
-
loading:
|
|
845
|
-
error:
|
|
1192
|
+
loading: $(c),
|
|
1193
|
+
error: $(a)
|
|
846
1194
|
};
|
|
847
1195
|
}
|
|
848
|
-
function
|
|
849
|
-
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";
|
|
850
1198
|
return {
|
|
851
1199
|
redirectToCheckout: async (e) => {
|
|
852
|
-
|
|
1200
|
+
d.value = !0, c.value = null;
|
|
853
1201
|
try {
|
|
854
1202
|
if ("url" in e && e.url) {
|
|
855
1203
|
window.location.replace(e.url);
|
|
856
1204
|
return;
|
|
857
1205
|
}
|
|
858
|
-
const
|
|
859
|
-
if (!
|
|
860
|
-
throw new
|
|
1206
|
+
const r = e;
|
|
1207
|
+
if (!a())
|
|
1208
|
+
throw new E(
|
|
861
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."
|
|
862
1210
|
);
|
|
863
|
-
if (!
|
|
864
|
-
throw new
|
|
1211
|
+
if (!o.value)
|
|
1212
|
+
throw new E("Stripe not initialized");
|
|
865
1213
|
console.warn(
|
|
866
1214
|
"[Vue Stripe] Legacy redirectToCheckout is deprecated in @stripe/stripe-js v8.x. Use redirectToUrl() with a session URL from your server instead."
|
|
867
1215
|
);
|
|
868
|
-
const
|
|
869
|
-
if (
|
|
870
|
-
const
|
|
871
|
-
throw
|
|
1216
|
+
const s = await o.value.redirectToCheckout(r);
|
|
1217
|
+
if (s.error) {
|
|
1218
|
+
const u = s.error.message || "Checkout redirect failed";
|
|
1219
|
+
throw c.value = u, new E(u);
|
|
872
1220
|
}
|
|
873
|
-
} catch (
|
|
874
|
-
const
|
|
875
|
-
throw
|
|
1221
|
+
} catch (r) {
|
|
1222
|
+
const s = r instanceof Error ? r.message : "Checkout redirect failed";
|
|
1223
|
+
throw c.value = s, r;
|
|
876
1224
|
} finally {
|
|
877
|
-
|
|
1225
|
+
d.value = !1;
|
|
878
1226
|
}
|
|
879
1227
|
},
|
|
880
1228
|
redirectToUrl: (e) => {
|
|
881
|
-
|
|
1229
|
+
d.value = !0, c.value = null, window.location.replace(e);
|
|
882
1230
|
},
|
|
883
|
-
loading:
|
|
884
|
-
error:
|
|
1231
|
+
loading: $(d),
|
|
1232
|
+
error: $(c)
|
|
885
1233
|
};
|
|
886
1234
|
}
|
|
887
|
-
function
|
|
888
|
-
const
|
|
889
|
-
if (!
|
|
890
|
-
throw new
|
|
1235
|
+
function ht() {
|
|
1236
|
+
const o = _(S);
|
|
1237
|
+
if (!o)
|
|
1238
|
+
throw new w(
|
|
891
1239
|
"Elements context not found. Make sure to wrap your component with VueStripeElements."
|
|
892
1240
|
);
|
|
893
|
-
const
|
|
1241
|
+
const d = async () => o.elements.value ? o.elements.value.submit() : { error: { message: "Elements not initialized" } };
|
|
894
1242
|
return {
|
|
895
|
-
elements:
|
|
896
|
-
submit:
|
|
897
|
-
loading:
|
|
898
|
-
error:
|
|
1243
|
+
elements: $(o.elements),
|
|
1244
|
+
submit: d,
|
|
1245
|
+
loading: $(o.loading),
|
|
1246
|
+
error: $(o.error)
|
|
899
1247
|
};
|
|
900
1248
|
}
|
|
901
|
-
function
|
|
1249
|
+
function gt(o) {
|
|
902
1250
|
return {
|
|
903
|
-
install(
|
|
904
|
-
|
|
905
|
-
let
|
|
906
|
-
|
|
1251
|
+
install(d) {
|
|
1252
|
+
d.provide("vue-stripe-config", o);
|
|
1253
|
+
let c = null;
|
|
1254
|
+
d.provide("vue-stripe-global", {
|
|
907
1255
|
get stripe() {
|
|
908
|
-
if (!
|
|
909
|
-
const
|
|
910
|
-
|
|
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));
|
|
911
1259
|
}
|
|
912
|
-
return
|
|
1260
|
+
return c;
|
|
913
1261
|
}
|
|
914
1262
|
});
|
|
915
1263
|
}
|
|
916
1264
|
};
|
|
917
1265
|
}
|
|
918
1266
|
export {
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
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,
|
|
1274
|
+
w as VueStripeElementsError,
|
|
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,
|
|
1284
|
+
E as VueStripeProviderError,
|
|
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,
|
|
1292
|
+
W as useStripe,
|
|
1293
|
+
ft as useStripeCheckout,
|
|
1294
|
+
ht as useStripeElements
|
|
943
1295
|
};
|