@vue-stripe/vue-stripe 5.2.0 → 5.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/dist/cjs/index.js +1 -1
- package/dist/es/index.js +561 -501
- 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/VueStripePricingTable.vue.d.ts +32 -0
- package/dist/types/components/VueStripePricingTable.vue.d.ts.map +1 -0
- package/dist/types/components/index.d.ts +1 -0
- package/dist/types/components/index.d.ts.map +1 -1
- package/dist/types/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/types/index.d.ts +26 -0
- package/dist/types/types/index.d.ts.map +1 -1
- package/dist/types/utils/injection-keys.d.ts +7 -0
- package/dist/types/utils/injection-keys.d.ts.map +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
|
|
4
|
-
const A = Symbol("stripe"),
|
|
1
|
+
import { loadStripe as D } from "@stripe/stripe-js";
|
|
2
|
+
import { loadStripe as Tt } from "@stripe/stripe-js";
|
|
3
|
+
import { defineComponent as S, ref as m, onMounted as $, provide as B, createElementBlock as f, unref as p, openBlock as h, renderSlot as b, createElementVNode as g, toDisplayString as P, inject as _, watch as y, nextTick as J, onUnmounted as T, createCommentVNode as k, normalizeClass as x, h as M, onBeforeUnmount as Q, readonly as C, useSlots as Y, computed as Z, Fragment as N, createTextVNode as j, resolveComponent as O, withDirectives as ee, createVNode as te, vShow as re } from "vue-demi";
|
|
4
|
+
const A = Symbol("stripe"), w = Symbol("stripe-elements"), G = Symbol("vue-stripe-config");
|
|
5
5
|
class E extends Error {
|
|
6
|
-
constructor(
|
|
7
|
-
super(
|
|
6
|
+
constructor(d) {
|
|
7
|
+
super(d), this.name = "VueStripeProviderError";
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
|
-
class
|
|
11
|
-
constructor(
|
|
12
|
-
super(
|
|
10
|
+
class V extends Error {
|
|
11
|
+
constructor(d) {
|
|
12
|
+
super(d), this.name = "VueStripeElementsError";
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
|
-
class
|
|
16
|
-
constructor(
|
|
17
|
-
super(
|
|
15
|
+
class se extends Error {
|
|
16
|
+
constructor(d) {
|
|
17
|
+
super(d), this.name = "VueStripeLoadError";
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
-
function
|
|
21
|
-
switch (
|
|
20
|
+
function lt(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
|
|
25
|
+
return new V(d);
|
|
26
26
|
case "load":
|
|
27
|
-
return new
|
|
27
|
+
return new se(d);
|
|
28
28
|
default:
|
|
29
|
-
return new Error(
|
|
29
|
+
return new Error(d);
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
|
-
const
|
|
32
|
+
const W = {
|
|
33
33
|
name: "vue-stripe",
|
|
34
|
-
version: "5.
|
|
34
|
+
version: "5.3.0",
|
|
35
35
|
url: "https://vuestripe.com",
|
|
36
36
|
partner_id: "pp_partner_IqtOXpBSuz0IE2"
|
|
37
|
-
},
|
|
37
|
+
}, ne = {
|
|
38
38
|
key: 0,
|
|
39
39
|
class: "vue-stripe-error"
|
|
40
|
-
},
|
|
40
|
+
}, ae = { class: "vue-stripe-error-message" }, le = {
|
|
41
41
|
key: 1,
|
|
42
42
|
class: "vue-stripe-loading"
|
|
43
|
-
},
|
|
43
|
+
}, oe = { key: 2 }, ue = /* @__PURE__ */ S({
|
|
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 v = o, a = d, n = m(null), l = m(!0), e = m(null), r = v.publishableKey || v.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: v.stripeAccount || v.options?.stripeAccount,
|
|
61
|
+
apiVersion: v.apiVersion || v.options?.apiVersion,
|
|
62
|
+
locale: v.locale || v.options?.locale
|
|
63
|
+
}, u = async () => {
|
|
64
64
|
try {
|
|
65
|
-
|
|
66
|
-
const
|
|
67
|
-
if (t && (
|
|
65
|
+
l.value = !0, e.value = null;
|
|
66
|
+
const i = {}, t = v.stripeAccount || v.options?.stripeAccount, c = v.apiVersion || v.options?.apiVersion, R = v.locale || v.options?.locale;
|
|
67
|
+
if (t && (i.stripeAccount = t), c && (i.apiVersion = c), R && (i.locale = R), n.value = await D(r, i), !n.value)
|
|
68
68
|
throw new E("Failed to initialize Stripe");
|
|
69
|
-
n.value.registerAppInfo(
|
|
70
|
-
} catch (
|
|
71
|
-
const t =
|
|
72
|
-
e.value = t, console.error("[Vue Stripe] Initialization error:", t),
|
|
69
|
+
n.value.registerAppInfo(W), a("load", n.value);
|
|
70
|
+
} catch (i) {
|
|
71
|
+
const t = i instanceof Error ? i.message : "Failed to load Stripe";
|
|
72
|
+
e.value = t, console.error("[Vue Stripe] Initialization error:", t), a("error", i instanceof Error ? i : new Error(t));
|
|
73
73
|
} finally {
|
|
74
|
-
|
|
74
|
+
l.value = !1;
|
|
75
75
|
}
|
|
76
76
|
};
|
|
77
|
-
return
|
|
78
|
-
|
|
79
|
-
}), B(
|
|
77
|
+
return $(() => {
|
|
78
|
+
u();
|
|
79
|
+
}), B(G, s), B(A, {
|
|
80
80
|
stripe: n,
|
|
81
|
-
loading:
|
|
81
|
+
loading: l,
|
|
82
82
|
error: e
|
|
83
|
-
}), (
|
|
84
|
-
b(
|
|
85
|
-
g("div",
|
|
83
|
+
}), (i, t) => p(e) ? (h(), f("div", ne, [
|
|
84
|
+
b(i.$slots, "error", { error: p(e) }, () => [
|
|
85
|
+
g("div", ae, P(p(e)), 1)
|
|
86
86
|
], !0)
|
|
87
|
-
])) :
|
|
88
|
-
b(
|
|
87
|
+
])) : p(l) ? (h(), f("div", le, [
|
|
88
|
+
b(i.$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", oe, [
|
|
92
|
+
b(i.$slots, "default", {}, void 0, !0)
|
|
93
93
|
]));
|
|
94
94
|
}
|
|
95
|
-
}),
|
|
96
|
-
const
|
|
97
|
-
for (const [
|
|
98
|
-
|
|
99
|
-
return
|
|
100
|
-
},
|
|
95
|
+
}), I = (o, d) => {
|
|
96
|
+
const v = o.__vccOpts || o;
|
|
97
|
+
for (const [a, n] of d)
|
|
98
|
+
v[a] = n;
|
|
99
|
+
return v;
|
|
100
|
+
}, ot = /* @__PURE__ */ I(ue, [["__scopeId", "data-v-573ddc51"]]), ie = {
|
|
101
101
|
key: 0,
|
|
102
102
|
class: "vue-stripe-elements-error"
|
|
103
|
-
},
|
|
103
|
+
}, ce = { class: "vue-stripe-error-message" }, ve = {
|
|
104
104
|
key: 1,
|
|
105
105
|
class: "vue-stripe-elements-loading"
|
|
106
|
-
},
|
|
106
|
+
}, de = { key: 2 }, pe = /* @__PURE__ */ S({
|
|
107
107
|
__name: "VueStripeElements",
|
|
108
108
|
props: {
|
|
109
109
|
clientSecret: {},
|
|
@@ -115,91 +115,94 @@ const D = {
|
|
|
115
115
|
paymentMethodTypes: {},
|
|
116
116
|
options: {}
|
|
117
117
|
},
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
118
|
+
emits: ["ready", "error"],
|
|
119
|
+
setup(o, { emit: d }) {
|
|
120
|
+
const v = 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 = m(null), e = m(!0), r = m(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, J(() => {
|
|
136
|
+
v("ready", l.value);
|
|
137
|
+
});
|
|
138
|
+
} catch (u) {
|
|
139
|
+
const i = u instanceof Error ? u.message : "Failed to create elements";
|
|
140
|
+
r.value = i, e.value = !1, console.error("[Vue Stripe] Elements creation error:", i), v("error", i);
|
|
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
|
-
),
|
|
157
|
-
|
|
158
|
-
}), B(
|
|
159
|
-
elements:
|
|
160
|
-
loading:
|
|
161
|
-
error:
|
|
162
|
-
}), (
|
|
163
|
-
b(
|
|
164
|
-
g("div",
|
|
159
|
+
), $(() => {
|
|
160
|
+
n.stripe.value && !l.value && s();
|
|
161
|
+
}), B(w, {
|
|
162
|
+
elements: l,
|
|
163
|
+
loading: e,
|
|
164
|
+
error: r
|
|
165
|
+
}), (u, i) => p(r) ? (h(), f("div", ie, [
|
|
166
|
+
b(u.$slots, "error", { error: p(r) }, () => [
|
|
167
|
+
g("div", ce, P(p(r)), 1)
|
|
165
168
|
], !0)
|
|
166
|
-
])) :
|
|
167
|
-
b(
|
|
168
|
-
|
|
169
|
+
])) : p(e) ? (h(), f("div", ve, [
|
|
170
|
+
b(u.$slots, "loading", {}, () => [
|
|
171
|
+
i[0] || (i[0] = g("div", { class: "vue-stripe-loading-message" }, " Initializing Elements... ", -1))
|
|
169
172
|
], !0)
|
|
170
|
-
])) : (h(), f("div",
|
|
171
|
-
b(
|
|
173
|
+
])) : (h(), f("div", de, [
|
|
174
|
+
b(u.$slots, "default", {}, void 0, !0)
|
|
172
175
|
]));
|
|
173
176
|
}
|
|
174
|
-
}),
|
|
177
|
+
}), ut = /* @__PURE__ */ I(pe, [["__scopeId", "data-v-c54b80f7"]]), me = { class: "vue-stripe-payment-element" }, fe = {
|
|
175
178
|
key: 0,
|
|
176
179
|
class: "vue-stripe-payment-element-error"
|
|
177
|
-
},
|
|
180
|
+
}, he = { class: "vue-stripe-error-message" }, ge = {
|
|
178
181
|
key: 1,
|
|
179
182
|
class: "vue-stripe-payment-element-loader"
|
|
180
|
-
},
|
|
183
|
+
}, be = /* @__PURE__ */ S({
|
|
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
|
-
throw new
|
|
189
|
+
setup(o, { expose: d, emit: v }) {
|
|
190
|
+
const a = o, n = v, l = m(), e = m(null), r = m(!0), s = m(null), u = _(w);
|
|
191
|
+
if (!u)
|
|
192
|
+
throw new V(
|
|
190
193
|
"VueStripePaymentElement must be used within VueStripeElements"
|
|
191
194
|
);
|
|
192
|
-
const
|
|
193
|
-
if (!
|
|
195
|
+
const i = () => {
|
|
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
207
|
}), e.value.on("change", (c) => {
|
|
205
208
|
n("change", c);
|
|
@@ -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
223
|
const c = t instanceof Error ? t.message : "Failed to create payment element";
|
|
221
224
|
s.value = c, r.value = !1, console.error("[Vue Stripe] Payment element creation error:", c);
|
|
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 && i();
|
|
234
237
|
},
|
|
235
238
|
{ immediate: !0 }
|
|
236
|
-
),
|
|
237
|
-
|
|
238
|
-
}),
|
|
239
|
+
), $(() => {
|
|
240
|
+
u.elements.value && l.value && !e.value && i();
|
|
241
|
+
}), T(() => {
|
|
239
242
|
e.value && e.value.destroy();
|
|
240
|
-
}),
|
|
243
|
+
}), d({
|
|
241
244
|
element: e,
|
|
242
245
|
loading: r,
|
|
243
246
|
error: s
|
|
244
|
-
}), (t, c) => (h(), f("div",
|
|
245
|
-
|
|
246
|
-
b(t.$slots, "error", { error:
|
|
247
|
-
g("div",
|
|
247
|
+
}), (t, c) => (h(), f("div", me, [
|
|
248
|
+
p(s) ? (h(), f("div", fe, [
|
|
249
|
+
b(t.$slots, "error", { error: p(s) }, () => [
|
|
250
|
+
g("div", he, P(p(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: x(["vue-stripe-payment-element-mount", { "vue-stripe-payment-element-loading": p(r) }])
|
|
254
257
|
}, null, 2),
|
|
255
|
-
|
|
258
|
+
p(r) ? (h(), f("div", ge, [
|
|
256
259
|
b(t.$slots, "loading", {}, () => [
|
|
257
260
|
c[0] || (c[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
|
+
}), it = /* @__PURE__ */ I(be, [["__scopeId", "data-v-2477e9df"]]), ye = { class: "vue-stripe-express-checkout-element" }, Ee = {
|
|
263
266
|
key: 0,
|
|
264
267
|
class: "vue-stripe-express-checkout-element-error"
|
|
265
|
-
},
|
|
268
|
+
}, _e = { class: "vue-stripe-error-message" }, ke = {
|
|
266
269
|
key: 1,
|
|
267
270
|
class: "vue-stripe-express-checkout-element-loader"
|
|
268
|
-
},
|
|
271
|
+
}, Se = /* @__PURE__ */ S({
|
|
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: v }) {
|
|
278
|
+
const a = o, n = v, l = m(), e = m(null), r = m(!0), s = m(null), u = _(w);
|
|
279
|
+
if (!u)
|
|
280
|
+
throw new V(
|
|
278
281
|
"VueStripeExpressCheckoutElement must be used within VueStripeElements"
|
|
279
282
|
);
|
|
280
|
-
const
|
|
281
|
-
if (!
|
|
283
|
+
const i = () => {
|
|
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
307
|
const c = t instanceof Error ? t.message : "Failed to create express checkout element";
|
|
305
308
|
s.value = c, r.value = !1, console.error("[Vue Stripe] Express checkout element creation error:", c);
|
|
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 && i();
|
|
318
321
|
},
|
|
319
322
|
{ immediate: !0 }
|
|
320
|
-
),
|
|
321
|
-
|
|
322
|
-
}),
|
|
323
|
+
), $(() => {
|
|
324
|
+
u.elements.value && l.value && !e.value && i();
|
|
325
|
+
}), T(() => {
|
|
323
326
|
e.value && e.value.destroy();
|
|
324
|
-
}),
|
|
327
|
+
}), d({
|
|
325
328
|
element: e,
|
|
326
329
|
loading: r,
|
|
327
330
|
error: s
|
|
328
|
-
}), (t, c) => (h(), f("div",
|
|
329
|
-
|
|
330
|
-
b(t.$slots, "error", { error:
|
|
331
|
-
g("div",
|
|
331
|
+
}), (t, c) => (h(), f("div", ye, [
|
|
332
|
+
p(s) ? (h(), f("div", Ee, [
|
|
333
|
+
b(t.$slots, "error", { error: p(s) }, () => [
|
|
334
|
+
g("div", _e, P(p(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: x(["vue-stripe-express-checkout-element-mount", { "vue-stripe-express-checkout-element-loading": p(r) }])
|
|
338
341
|
}, null, 2),
|
|
339
|
-
|
|
342
|
+
p(r) ? (h(), f("div", ke, [
|
|
340
343
|
b(t.$slots, "loading", {}, () => [
|
|
341
344
|
c[0] || (c[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
|
+
}), ct = /* @__PURE__ */ I(Se, [["__scopeId", "data-v-20294cda"]]), we = { class: "vue-stripe-card-element" }, Ve = {
|
|
347
350
|
key: 0,
|
|
348
351
|
class: "vue-stripe-card-element-error"
|
|
349
|
-
},
|
|
352
|
+
}, $e = { class: "vue-stripe-error-message" }, Ie = {
|
|
350
353
|
key: 1,
|
|
351
354
|
class: "vue-stripe-card-element-loader"
|
|
352
|
-
},
|
|
355
|
+
}, Ce = /* @__PURE__ */ S({
|
|
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: v }) {
|
|
362
|
+
const a = o, n = v, l = m(), e = m(null), r = m(!0), s = m(null), u = _(w);
|
|
363
|
+
if (!u)
|
|
364
|
+
throw new V(
|
|
362
365
|
"VueStripeCardElement must be used within VueStripeElements"
|
|
363
366
|
);
|
|
364
|
-
const
|
|
365
|
-
if (!
|
|
367
|
+
const i = () => {
|
|
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
389
|
const c = t instanceof Error ? t.message : "Failed to create card element";
|
|
387
390
|
s.value = c, r.value = !1, console.error("[Vue Stripe] Card element creation error:", c);
|
|
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 && i();
|
|
400
403
|
},
|
|
401
404
|
{ immediate: !0 }
|
|
402
|
-
),
|
|
403
|
-
|
|
404
|
-
}),
|
|
405
|
+
), $(() => {
|
|
406
|
+
u.elements.value && l.value && !e.value && i();
|
|
407
|
+
}), T(() => {
|
|
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, c) => (h(), f("div",
|
|
414
|
-
|
|
415
|
-
b(t.$slots, "error", { error:
|
|
416
|
-
g("div",
|
|
416
|
+
}), (t, c) => (h(), f("div", we, [
|
|
417
|
+
p(s) ? (h(), f("div", Ve, [
|
|
418
|
+
b(t.$slots, "error", { error: p(s) }, () => [
|
|
419
|
+
g("div", $e, P(p(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: x(["vue-stripe-card-element-mount", { "vue-stripe-card-element-loading": p(r) }])
|
|
423
426
|
}, null, 2),
|
|
424
|
-
|
|
427
|
+
p(r) ? (h(), f("div", Ie, [
|
|
425
428
|
b(t.$slots, "loading", {}, () => [
|
|
426
429
|
c[0] || (c[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:
|
|
433
|
-
return
|
|
434
|
-
name:
|
|
434
|
+
}), vt = /* @__PURE__ */ I(Ce, [["__scopeId", "data-v-a41a7ee5"]]);
|
|
435
|
+
function L({ elementType: o, componentName: d }) {
|
|
436
|
+
return S({
|
|
437
|
+
name: d,
|
|
435
438
|
props: {
|
|
436
439
|
options: {
|
|
437
440
|
type: Object,
|
|
@@ -439,56 +442,56 @@ 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
|
-
throw new
|
|
446
|
-
`${
|
|
445
|
+
setup(v, { emit: a, expose: n }) {
|
|
446
|
+
const l = m(), e = m(null), r = m(!0), s = m(null), u = _(w);
|
|
447
|
+
if (!u)
|
|
448
|
+
throw new V(
|
|
449
|
+
`${d} must be used within VueStripeElements`
|
|
447
450
|
);
|
|
448
|
-
const
|
|
449
|
-
if (!
|
|
451
|
+
const i = () => {
|
|
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, v.options);
|
|
460
463
|
e.value = t, t.on("ready", () => {
|
|
461
|
-
r.value = !1,
|
|
464
|
+
r.value = !1, a("ready", e.value);
|
|
462
465
|
}), t.on("change", (c) => {
|
|
463
466
|
const R = c;
|
|
464
|
-
R.error ? s.value = R.error.message : s.value = null,
|
|
467
|
+
R.error ? s.value = R.error.message : s.value = null, a("change", R);
|
|
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 c = t instanceof Error ? t.message : `Failed to create ${
|
|
474
|
-
s.value = c, r.value = !1, console.error(`[Vue Stripe] ${
|
|
476
|
+
const c = t instanceof Error ? t.message : `Failed to create ${o} element`;
|
|
477
|
+
s.value = c, r.value = !1, console.error(`[Vue Stripe] ${d} creation error:`, c);
|
|
475
478
|
}
|
|
476
479
|
};
|
|
477
480
|
return y(
|
|
478
|
-
() =>
|
|
481
|
+
() => v.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 && i();
|
|
487
490
|
},
|
|
488
491
|
{ immediate: !0 }
|
|
489
|
-
),
|
|
490
|
-
|
|
491
|
-
}),
|
|
492
|
+
), $(() => {
|
|
493
|
+
u.elements.value && l.value && !e.value && i();
|
|
494
|
+
}), T(() => {
|
|
492
495
|
e.value && e.value.destroy();
|
|
493
496
|
}), n({
|
|
494
497
|
element: e,
|
|
@@ -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 dt = L({
|
|
528
531
|
elementType: "cardNumber",
|
|
529
532
|
componentName: "VueStripeCardNumberElement"
|
|
530
|
-
}),
|
|
533
|
+
}), pt = L({
|
|
531
534
|
elementType: "cardExpiry",
|
|
532
535
|
componentName: "VueStripeCardExpiryElement"
|
|
533
|
-
}),
|
|
536
|
+
}), mt = L({
|
|
534
537
|
elementType: "cardCvc",
|
|
535
538
|
componentName: "VueStripeCardCvcElement"
|
|
536
|
-
}),
|
|
539
|
+
}), Pe = /* @__PURE__ */ S({
|
|
537
540
|
__name: "VueStripeLinkAuthenticationElement",
|
|
538
541
|
props: {
|
|
539
542
|
options: {}
|
|
540
543
|
},
|
|
541
544
|
emits: ["ready", "change"],
|
|
542
|
-
setup(
|
|
543
|
-
const
|
|
544
|
-
if (!
|
|
545
|
-
throw new
|
|
545
|
+
setup(o, { expose: d, emit: v }) {
|
|
546
|
+
const a = o, n = v, l = _(w);
|
|
547
|
+
if (!l)
|
|
548
|
+
throw new V(
|
|
546
549
|
"VueStripeLinkAuthenticationElement must be used within VueStripeElements"
|
|
547
550
|
);
|
|
548
|
-
const e =
|
|
549
|
-
if (!(!
|
|
551
|
+
const e = m(), r = m(null), s = () => {
|
|
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", (i) => {
|
|
557
|
+
n("change", i);
|
|
555
558
|
});
|
|
556
|
-
} catch (
|
|
557
|
-
console.error("[Vue Stripe] Link authentication element creation error:",
|
|
559
|
+
} catch (i) {
|
|
560
|
+
console.error("[Vue Stripe] Link authentication element creation error:", i);
|
|
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
|
+
(i) => {
|
|
568
|
+
i && e.value && !r.value && s();
|
|
566
569
|
},
|
|
567
570
|
{ immediate: !0 }
|
|
568
571
|
), y(
|
|
569
|
-
() =>
|
|
570
|
-
(
|
|
571
|
-
r.value &&
|
|
572
|
+
() => a.options,
|
|
573
|
+
(i) => {
|
|
574
|
+
r.value && i && typeof r.value.update == "function" && r.value.update(i);
|
|
572
575
|
},
|
|
573
576
|
{ deep: !0 }
|
|
574
|
-
),
|
|
575
|
-
|
|
576
|
-
}),
|
|
577
|
-
|
|
578
|
-
}),
|
|
577
|
+
), $(() => {
|
|
578
|
+
l.elements?.value && e.value && s();
|
|
579
|
+
}), T(() => {
|
|
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
|
+
}), (i, 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
|
+
}), ft = /* @__PURE__ */ I(Pe, [["__scopeId", "data-v-b79076eb"]]), Te = S({
|
|
590
593
|
name: "VueStripeAddressElement",
|
|
591
594
|
props: {
|
|
592
595
|
options: {
|
|
@@ -597,84 +600,84 @@ const rt = L({
|
|
|
597
600
|
}
|
|
598
601
|
},
|
|
599
602
|
emits: ["ready", "change", "blur", "focus", "escape", "loadError"],
|
|
600
|
-
setup(
|
|
601
|
-
const
|
|
602
|
-
if (!
|
|
603
|
-
throw new
|
|
603
|
+
setup(o, { emit: d, expose: v }) {
|
|
604
|
+
const a = m(), n = m(null), l = _(w);
|
|
605
|
+
if (!l)
|
|
606
|
+
throw new V("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
|
-
|
|
610
|
-
},
|
|
611
|
-
|
|
612
|
-
},
|
|
613
|
-
|
|
612
|
+
d("blur");
|
|
613
|
+
}, u = () => {
|
|
614
|
+
d("focus");
|
|
615
|
+
}, i = () => {
|
|
616
|
+
d("escape");
|
|
614
617
|
}, t = (U) => {
|
|
615
|
-
|
|
618
|
+
d("loadError", U);
|
|
616
619
|
}, c = () => {
|
|
617
|
-
!
|
|
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", i), n.value.on("loaderror", t));
|
|
618
621
|
}, R = () => {
|
|
619
|
-
n.value && n.value.update(
|
|
620
|
-
},
|
|
621
|
-
n.value && (n.value.off("ready", e), n.value.off("change", r), n.value.off("blur", s), n.value.off("focus",
|
|
622
|
+
n.value && n.value.update(o.options);
|
|
623
|
+
}, H = () => {
|
|
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", i), n.value.off("loaderror", t), n.value.destroy(), n.value = null);
|
|
622
625
|
}, F = async () => {
|
|
623
626
|
if (!n.value)
|
|
624
|
-
throw new
|
|
627
|
+
throw new V("Address element not mounted");
|
|
625
628
|
return n.value.getValue();
|
|
626
629
|
}, z = () => {
|
|
627
630
|
n.value?.focus();
|
|
628
|
-
},
|
|
631
|
+
}, K = () => {
|
|
629
632
|
n.value?.clear();
|
|
630
633
|
};
|
|
631
|
-
return
|
|
634
|
+
return $(() => {
|
|
632
635
|
c();
|
|
633
|
-
}),
|
|
634
|
-
|
|
635
|
-
}), y(() =>
|
|
636
|
+
}), Q(() => {
|
|
637
|
+
H();
|
|
638
|
+
}), y(() => o.options, () => {
|
|
636
639
|
R();
|
|
637
|
-
}, { deep: !0 }),
|
|
640
|
+
}, { deep: !0 }), v({
|
|
638
641
|
element: n,
|
|
639
642
|
getValue: F,
|
|
640
643
|
focus: z,
|
|
641
|
-
clear:
|
|
644
|
+
clear: K
|
|
642
645
|
}), {
|
|
643
|
-
addressRef:
|
|
646
|
+
addressRef: a,
|
|
644
647
|
element: n,
|
|
645
648
|
getValue: F,
|
|
646
649
|
focus: z,
|
|
647
|
-
clear:
|
|
650
|
+
clear: K
|
|
648
651
|
};
|
|
649
652
|
}
|
|
650
|
-
}),
|
|
651
|
-
function
|
|
652
|
-
return h(), f("div",
|
|
653
|
+
}), Re = { ref: "addressRef" };
|
|
654
|
+
function xe(o, d, v, a, n, l) {
|
|
655
|
+
return h(), f("div", Re, null, 512);
|
|
653
656
|
}
|
|
654
|
-
const
|
|
657
|
+
const ht = /* @__PURE__ */ I(Te, [["render", xe]]), Me = { class: "vue-stripe-iban-element" }, Ae = {
|
|
655
658
|
key: 0,
|
|
656
659
|
class: "vue-stripe-iban-element-error"
|
|
657
|
-
},
|
|
660
|
+
}, Ue = { class: "vue-stripe-error-message" }, Be = {
|
|
658
661
|
key: 1,
|
|
659
662
|
class: "vue-stripe-iban-element-loader"
|
|
660
|
-
},
|
|
663
|
+
}, Le = /* @__PURE__ */ S({
|
|
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
|
-
throw new
|
|
669
|
+
setup(o, { expose: d, emit: v }) {
|
|
670
|
+
const a = o, n = v, l = m(), e = m(null), r = m(!0), s = m(null), u = _(w);
|
|
671
|
+
if (!u)
|
|
672
|
+
throw new V(
|
|
670
673
|
"VueStripeIbanElement must be used within VueStripeElements"
|
|
671
674
|
);
|
|
672
|
-
const
|
|
673
|
-
if (!
|
|
675
|
+
const i = () => {
|
|
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,9 +685,9 @@ 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
692
|
}), e.value.on("change", (c) => {
|
|
690
693
|
c.error ? s.value = c.error.message : s.value = null, n("change", c);
|
|
@@ -694,82 +697,82 @@ const lt = /* @__PURE__ */ C(Se, [["render", Ve]]), $e = { class: "vue-stripe-ib
|
|
|
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
702
|
const c = t instanceof Error ? t.message : "Failed to create IBAN element";
|
|
700
703
|
s.value = c, r.value = !1, console.error("[Vue Stripe] IBAN element creation error:", c);
|
|
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 && i();
|
|
713
716
|
},
|
|
714
717
|
{ immediate: !0 }
|
|
715
|
-
),
|
|
716
|
-
|
|
717
|
-
}),
|
|
718
|
+
), $(() => {
|
|
719
|
+
u.elements.value && l.value && !e.value && i();
|
|
720
|
+
}), T(() => {
|
|
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, c) => (h(), f("div",
|
|
727
|
-
|
|
728
|
-
b(t.$slots, "error", { error:
|
|
729
|
-
g("div",
|
|
729
|
+
}), (t, c) => (h(), f("div", Me, [
|
|
730
|
+
p(s) ? (h(), f("div", Ae, [
|
|
731
|
+
b(t.$slots, "error", { error: p(s) }, () => [
|
|
732
|
+
g("div", Ue, P(p(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: x(["vue-stripe-iban-element-mount", { "vue-stripe-iban-element-loading": p(r) }])
|
|
736
739
|
}, null, 2),
|
|
737
|
-
|
|
740
|
+
p(r) ? (h(), f("div", Be, [
|
|
738
741
|
b(t.$slots, "loading", {}, () => [
|
|
739
742
|
c[0] || (c[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
|
+
}), gt = /* @__PURE__ */ I(Le, [["__scopeId", "data-v-f8ffb457"]]), Fe = { class: "vue-stripe-ideal-bank-element" }, ze = {
|
|
745
748
|
key: 0,
|
|
746
749
|
class: "vue-stripe-ideal-bank-element-error"
|
|
747
|
-
},
|
|
750
|
+
}, Ke = { class: "vue-stripe-error-message" }, Ne = {
|
|
748
751
|
key: 1,
|
|
749
752
|
class: "vue-stripe-ideal-bank-element-loader"
|
|
750
|
-
},
|
|
753
|
+
}, je = /* @__PURE__ */ S({
|
|
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
|
-
throw new
|
|
759
|
+
setup(o, { expose: d, emit: v }) {
|
|
760
|
+
const a = o, n = v, l = m(), e = m(null), r = m(!0), s = m(null), u = _(w);
|
|
761
|
+
if (!u)
|
|
762
|
+
throw new V(
|
|
760
763
|
"VueStripeIdealBankElement must be used within VueStripeElements"
|
|
761
764
|
);
|
|
762
|
-
const
|
|
763
|
-
if (!
|
|
765
|
+
const i = () => {
|
|
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
787
|
const c = t instanceof Error ? t.message : "Failed to create iDEAL bank element";
|
|
785
788
|
s.value = c, r.value = !1, console.error("[Vue Stripe] iDEAL bank element creation error:", c);
|
|
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 && i();
|
|
798
801
|
},
|
|
799
802
|
{ immediate: !0 }
|
|
800
|
-
),
|
|
801
|
-
|
|
802
|
-
}),
|
|
803
|
+
), $(() => {
|
|
804
|
+
u.elements.value && l.value && !e.value && i();
|
|
805
|
+
}), T(() => {
|
|
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, c) => (h(), f("div",
|
|
812
|
-
|
|
813
|
-
b(t.$slots, "error", { error:
|
|
814
|
-
g("div",
|
|
814
|
+
}), (t, c) => (h(), f("div", Fe, [
|
|
815
|
+
p(s) ? (h(), f("div", ze, [
|
|
816
|
+
b(t.$slots, "error", { error: p(s) }, () => [
|
|
817
|
+
g("div", Ke, P(p(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: x(["vue-stripe-ideal-bank-element-mount", { "vue-stripe-ideal-bank-element-loading": p(r) }])
|
|
821
824
|
}, null, 2),
|
|
822
|
-
|
|
825
|
+
p(r) ? (h(), f("div", Ne, [
|
|
823
826
|
b(t.$slots, "loading", {}, () => [
|
|
824
827
|
c[0] || (c[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
|
+
}), bt = /* @__PURE__ */ I(je, [["__scopeId", "data-v-3d7f7e08"]]), qe = { class: "vue-stripe-p24-bank-element" }, De = {
|
|
830
833
|
key: 0,
|
|
831
834
|
class: "vue-stripe-p24-bank-element-error"
|
|
832
|
-
},
|
|
835
|
+
}, Ge = { class: "vue-stripe-error-message" }, We = {
|
|
833
836
|
key: 1,
|
|
834
837
|
class: "vue-stripe-p24-bank-element-loader"
|
|
835
|
-
},
|
|
838
|
+
}, Xe = /* @__PURE__ */ S({
|
|
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
|
-
throw new
|
|
844
|
+
setup(o, { expose: d, emit: v }) {
|
|
845
|
+
const a = o, n = v, l = m(), e = m(null), r = m(!0), s = m(null), u = _(w);
|
|
846
|
+
if (!u)
|
|
847
|
+
throw new V(
|
|
845
848
|
"VueStripeP24BankElement must be used within VueStripeElements"
|
|
846
849
|
);
|
|
847
|
-
const
|
|
848
|
-
if (!
|
|
850
|
+
const i = () => {
|
|
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
872
|
const c = t instanceof Error ? t.message : "Failed to create P24 bank element";
|
|
870
873
|
s.value = c, r.value = !1, console.error("[Vue Stripe] P24 bank element creation error:", c);
|
|
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 && i();
|
|
883
886
|
},
|
|
884
887
|
{ immediate: !0 }
|
|
885
|
-
),
|
|
886
|
-
|
|
887
|
-
}),
|
|
888
|
+
), $(() => {
|
|
889
|
+
u.elements.value && l.value && !e.value && i();
|
|
890
|
+
}), T(() => {
|
|
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, c) => (h(), f("div",
|
|
897
|
-
|
|
898
|
-
b(t.$slots, "error", { error:
|
|
899
|
-
g("div",
|
|
899
|
+
}), (t, c) => (h(), f("div", qe, [
|
|
900
|
+
p(s) ? (h(), f("div", De, [
|
|
901
|
+
b(t.$slots, "error", { error: p(s) }, () => [
|
|
902
|
+
g("div", Ge, P(p(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: x(["vue-stripe-p24-bank-element-mount", { "vue-stripe-p24-bank-element-loading": p(r) }])
|
|
906
909
|
}, null, 2),
|
|
907
|
-
|
|
910
|
+
p(r) ? (h(), f("div", We, [
|
|
908
911
|
b(t.$slots, "loading", {}, () => [
|
|
909
912
|
c[0] || (c[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
|
+
}), yt = /* @__PURE__ */ I(Xe, [["__scopeId", "data-v-29dc009e"]]), He = { class: "vue-stripe-eps-bank-element" }, Je = {
|
|
915
918
|
key: 0,
|
|
916
919
|
class: "vue-stripe-eps-bank-element-error"
|
|
917
|
-
},
|
|
920
|
+
}, Qe = { class: "vue-stripe-error-message" }, Ye = {
|
|
918
921
|
key: 1,
|
|
919
922
|
class: "vue-stripe-eps-bank-element-loader"
|
|
920
|
-
},
|
|
923
|
+
}, Ze = /* @__PURE__ */ S({
|
|
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
|
-
throw new
|
|
929
|
+
setup(o, { expose: d, emit: v }) {
|
|
930
|
+
const a = o, n = v, l = m(), e = m(null), r = m(!0), s = m(null), u = _(w);
|
|
931
|
+
if (!u)
|
|
932
|
+
throw new V(
|
|
930
933
|
"VueStripeEpsBankElement must be used within VueStripeElements"
|
|
931
934
|
);
|
|
932
|
-
const
|
|
933
|
-
if (!
|
|
935
|
+
const i = () => {
|
|
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
957
|
const c = t instanceof Error ? t.message : "Failed to create EPS bank element";
|
|
955
958
|
s.value = c, r.value = !1, console.error("[Vue Stripe] EPS bank element creation error:", c);
|
|
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 && i();
|
|
968
971
|
},
|
|
969
972
|
{ immediate: !0 }
|
|
970
|
-
),
|
|
971
|
-
|
|
972
|
-
}),
|
|
973
|
+
), $(() => {
|
|
974
|
+
u.elements.value && l.value && !e.value && i();
|
|
975
|
+
}), T(() => {
|
|
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, c) => (h(), f("div",
|
|
982
|
-
|
|
983
|
-
b(t.$slots, "error", { error:
|
|
984
|
-
g("div",
|
|
984
|
+
}), (t, c) => (h(), f("div", He, [
|
|
985
|
+
p(s) ? (h(), f("div", Je, [
|
|
986
|
+
b(t.$slots, "error", { error: p(s) }, () => [
|
|
987
|
+
g("div", Qe, P(p(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: x(["vue-stripe-eps-bank-element-mount", { "vue-stripe-eps-bank-element-loading": p(r) }])
|
|
991
994
|
}, null, 2),
|
|
992
|
-
|
|
995
|
+
p(r) ? (h(), f("div", Ye, [
|
|
993
996
|
b(t.$slots, "loading", {}, () => [
|
|
994
997
|
c[0] || (c[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
|
-
}),
|
|
1000
|
-
function
|
|
1001
|
-
const
|
|
1002
|
-
if (!
|
|
1002
|
+
}), Et = /* @__PURE__ */ I(Ze, [["__scopeId", "data-v-27c62f72"]]);
|
|
1003
|
+
function X() {
|
|
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: C(o.stripe),
|
|
1011
|
+
loading: C(o.loading),
|
|
1012
|
+
error: C(o.error),
|
|
1010
1013
|
initialize: async () => {
|
|
1011
1014
|
}
|
|
1012
1015
|
};
|
|
1013
1016
|
}
|
|
1014
|
-
const
|
|
1017
|
+
const Oe = ["disabled"], et = /* @__PURE__ */ S({
|
|
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: v }) {
|
|
1036
|
+
const a = o, n = v, { stripe: l } = X(), e = m(!1), r = Y(), s = Z(() => !!r.default), u = () => l.value !== null && typeof l.value.redirectToCheckout == "function", i = 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");
|
|
@@ -1091,202 +1094,259 @@ const Xe = ["disabled"], Ge = /* @__PURE__ */ V({
|
|
|
1091
1094
|
e.value = !1;
|
|
1092
1095
|
}
|
|
1093
1096
|
};
|
|
1094
|
-
return
|
|
1097
|
+
return d({ checkout: i, loading: e }), (t, c) => p(s) ? (h(), f("span", {
|
|
1095
1098
|
key: 0,
|
|
1096
|
-
onClick:
|
|
1099
|
+
onClick: i,
|
|
1097
1100
|
class: "vue-stripe-checkout-wrapper"
|
|
1098
1101
|
}, [
|
|
1099
1102
|
b(t.$slots, "default", {
|
|
1100
|
-
checkout:
|
|
1101
|
-
loading:
|
|
1102
|
-
disabled:
|
|
1103
|
+
checkout: i,
|
|
1104
|
+
loading: p(e),
|
|
1105
|
+
disabled: o.disabled
|
|
1103
1106
|
}, void 0, !0)
|
|
1104
1107
|
])) : (h(), f("button", {
|
|
1105
1108
|
key: 1,
|
|
1106
|
-
disabled:
|
|
1107
|
-
class:
|
|
1108
|
-
onClick:
|
|
1109
|
+
disabled: p(e) || o.disabled,
|
|
1110
|
+
class: x(o.buttonClass),
|
|
1111
|
+
onClick: i
|
|
1109
1112
|
}, [
|
|
1110
|
-
|
|
1113
|
+
p(e) ? (h(), f(N, { key: 1 }, [
|
|
1111
1114
|
c[0] || (c[0] = g("span", { class: "vue-stripe-loading-spinner" }, null, -1)),
|
|
1112
|
-
|
|
1113
|
-
], 64)) : (h(), f(
|
|
1114
|
-
|
|
1115
|
+
j(" " + P(o.loadingText), 1)
|
|
1116
|
+
], 64)) : (h(), f(N, { key: 0 }, [
|
|
1117
|
+
j(P(o.buttonText), 1)
|
|
1115
1118
|
], 64))
|
|
1116
|
-
], 10,
|
|
1119
|
+
], 10, Oe));
|
|
1120
|
+
}
|
|
1121
|
+
}), _t = /* @__PURE__ */ I(et, [["__scopeId", "data-v-8fe59422"]]), tt = { class: "vue-stripe-pricing-table" }, rt = { class: "vue-stripe-pricing-table-error" }, q = "https://js.stripe.com/v3/pricing-table.js", st = /* @__PURE__ */ S({
|
|
1122
|
+
__name: "VueStripePricingTable",
|
|
1123
|
+
props: {
|
|
1124
|
+
pricingTableId: {},
|
|
1125
|
+
customerEmail: {},
|
|
1126
|
+
customerSessionClientSecret: {},
|
|
1127
|
+
clientReferenceId: {}
|
|
1128
|
+
},
|
|
1129
|
+
emits: ["load", "error"],
|
|
1130
|
+
setup(o, { expose: d, emit: v }) {
|
|
1131
|
+
const a = o, n = v, l = _(G);
|
|
1132
|
+
if (!l?.publishableKey)
|
|
1133
|
+
throw new E(
|
|
1134
|
+
"VueStripePricingTable must be used within a VueStripeProvider component"
|
|
1135
|
+
);
|
|
1136
|
+
const e = l.publishableKey, r = m(!0), s = m(null), u = () => new Promise((i, t) => {
|
|
1137
|
+
if (document.querySelector(`script[src="${q}"]`)) {
|
|
1138
|
+
i();
|
|
1139
|
+
return;
|
|
1140
|
+
}
|
|
1141
|
+
const c = document.createElement("script");
|
|
1142
|
+
c.src = q, c.async = !0, c.onload = () => i(), c.onerror = () => t(new Error("Failed to load Stripe pricing table script")), document.head.appendChild(c);
|
|
1143
|
+
});
|
|
1144
|
+
return $(async () => {
|
|
1145
|
+
try {
|
|
1146
|
+
r.value = !0, s.value = null, await u(), r.value = !1, n("load");
|
|
1147
|
+
} catch (i) {
|
|
1148
|
+
const t = i instanceof Error ? i.message : "Failed to load pricing table";
|
|
1149
|
+
s.value = t, r.value = !1, n("error", i instanceof Error ? i : new Error(t)), console.error("[Vue Stripe] Pricing table error:", t);
|
|
1150
|
+
}
|
|
1151
|
+
}), d({
|
|
1152
|
+
loading: r,
|
|
1153
|
+
error: s
|
|
1154
|
+
}), (i, t) => {
|
|
1155
|
+
const c = O("stripe-pricing-table");
|
|
1156
|
+
return h(), f("div", tt, [
|
|
1157
|
+
p(r) ? b(i.$slots, "loading", { key: 0 }, () => [
|
|
1158
|
+
t[0] || (t[0] = g("div", { class: "vue-stripe-pricing-table-loading" }, " Loading pricing table... ", -1))
|
|
1159
|
+
], !0) : p(s) ? b(i.$slots, "error", {
|
|
1160
|
+
key: 1,
|
|
1161
|
+
error: p(s)
|
|
1162
|
+
}, () => [
|
|
1163
|
+
g("div", rt, P(p(s)), 1)
|
|
1164
|
+
], !0) : k("", !0),
|
|
1165
|
+
ee(te(c, {
|
|
1166
|
+
"pricing-table-id": a.pricingTableId,
|
|
1167
|
+
"publishable-key": p(e),
|
|
1168
|
+
"customer-email": a.customerEmail,
|
|
1169
|
+
"customer-session-client-secret": a.customerSessionClientSecret,
|
|
1170
|
+
"client-reference-id": a.clientReferenceId
|
|
1171
|
+
}, null, 8, ["pricing-table-id", "publishable-key", "customer-email", "customer-session-client-secret", "client-reference-id"]), [
|
|
1172
|
+
[re, !p(r) && !p(s)]
|
|
1173
|
+
])
|
|
1174
|
+
]);
|
|
1175
|
+
};
|
|
1117
1176
|
}
|
|
1118
|
-
}),
|
|
1119
|
-
function
|
|
1120
|
-
const
|
|
1121
|
-
if (!
|
|
1177
|
+
}), kt = /* @__PURE__ */ I(st, [["__scopeId", "data-v-2b89dbe1"]]);
|
|
1178
|
+
function St() {
|
|
1179
|
+
const o = _(A), d = _(w);
|
|
1180
|
+
if (!o)
|
|
1122
1181
|
throw new E(
|
|
1123
1182
|
"usePaymentIntent must be called within a VueStripeProvider component"
|
|
1124
1183
|
);
|
|
1125
|
-
const
|
|
1184
|
+
const v = m(!1), a = m(null);
|
|
1126
1185
|
return {
|
|
1127
|
-
confirmPayment: async (
|
|
1128
|
-
if (!
|
|
1129
|
-
return
|
|
1130
|
-
|
|
1186
|
+
confirmPayment: async (l) => {
|
|
1187
|
+
if (!o.stripe.value)
|
|
1188
|
+
return a.value = "Stripe not initialized", { error: { message: "Stripe not initialized" } };
|
|
1189
|
+
v.value = !0, a.value = null;
|
|
1131
1190
|
try {
|
|
1132
|
-
const e =
|
|
1133
|
-
if (e && !
|
|
1191
|
+
const e = l.elements ?? d?.elements.value;
|
|
1192
|
+
if (e && !l.skipSubmit) {
|
|
1134
1193
|
const { error: s } = await e.submit();
|
|
1135
1194
|
if (s)
|
|
1136
|
-
return
|
|
1195
|
+
return a.value = s.message || "Form validation failed", { error: s };
|
|
1137
1196
|
}
|
|
1138
|
-
const r = await
|
|
1197
|
+
const r = await o.stripe.value.confirmPayment({
|
|
1139
1198
|
elements: e ?? void 0,
|
|
1140
|
-
clientSecret:
|
|
1141
|
-
confirmParams:
|
|
1142
|
-
redirect:
|
|
1199
|
+
clientSecret: l.clientSecret,
|
|
1200
|
+
confirmParams: l.confirmParams ?? {},
|
|
1201
|
+
redirect: l.redirect ?? "if_required"
|
|
1143
1202
|
});
|
|
1144
|
-
return r.error && (
|
|
1203
|
+
return r.error && (a.value = r.error.message || "Payment confirmation failed"), r;
|
|
1145
1204
|
} catch (e) {
|
|
1146
1205
|
const r = e instanceof Error ? e.message : "Payment confirmation failed";
|
|
1147
|
-
return
|
|
1206
|
+
return a.value = r, { error: { message: r } };
|
|
1148
1207
|
} finally {
|
|
1149
|
-
|
|
1208
|
+
v.value = !1;
|
|
1150
1209
|
}
|
|
1151
1210
|
},
|
|
1152
|
-
loading:
|
|
1153
|
-
error:
|
|
1211
|
+
loading: C(v),
|
|
1212
|
+
error: C(a)
|
|
1154
1213
|
};
|
|
1155
1214
|
}
|
|
1156
|
-
function
|
|
1157
|
-
const
|
|
1158
|
-
if (!
|
|
1215
|
+
function wt() {
|
|
1216
|
+
const o = _(A), d = _(w);
|
|
1217
|
+
if (!o)
|
|
1159
1218
|
throw new E(
|
|
1160
1219
|
"useSetupIntent must be called within a VueStripeProvider component"
|
|
1161
1220
|
);
|
|
1162
|
-
const
|
|
1221
|
+
const v = m(!1), a = m(null);
|
|
1163
1222
|
return {
|
|
1164
|
-
confirmSetup: async (
|
|
1165
|
-
if (!
|
|
1166
|
-
return
|
|
1167
|
-
|
|
1223
|
+
confirmSetup: async (l) => {
|
|
1224
|
+
if (!o.stripe.value)
|
|
1225
|
+
return a.value = "Stripe not initialized", { error: { message: "Stripe not initialized" } };
|
|
1226
|
+
v.value = !0, a.value = null;
|
|
1168
1227
|
try {
|
|
1169
|
-
const e =
|
|
1170
|
-
if (e && !
|
|
1228
|
+
const e = l.elements ?? d?.elements.value;
|
|
1229
|
+
if (e && !l.skipSubmit) {
|
|
1171
1230
|
const { error: s } = await e.submit();
|
|
1172
1231
|
if (s)
|
|
1173
|
-
return
|
|
1232
|
+
return a.value = s.message || "Form validation failed", { error: s };
|
|
1174
1233
|
}
|
|
1175
|
-
const r = await
|
|
1234
|
+
const r = await o.stripe.value.confirmSetup({
|
|
1176
1235
|
elements: e ?? void 0,
|
|
1177
|
-
clientSecret:
|
|
1178
|
-
confirmParams:
|
|
1179
|
-
redirect:
|
|
1236
|
+
clientSecret: l.clientSecret,
|
|
1237
|
+
confirmParams: l.confirmParams ?? {},
|
|
1238
|
+
redirect: l.redirect ?? "if_required"
|
|
1180
1239
|
});
|
|
1181
|
-
return r.error && (
|
|
1240
|
+
return r.error && (a.value = r.error.message || "Setup confirmation failed"), r;
|
|
1182
1241
|
} catch (e) {
|
|
1183
1242
|
const r = e instanceof Error ? e.message : "Setup confirmation failed";
|
|
1184
|
-
return
|
|
1243
|
+
return a.value = r, { error: { message: r } };
|
|
1185
1244
|
} finally {
|
|
1186
|
-
|
|
1245
|
+
v.value = !1;
|
|
1187
1246
|
}
|
|
1188
1247
|
},
|
|
1189
|
-
loading:
|
|
1190
|
-
error:
|
|
1248
|
+
loading: C(v),
|
|
1249
|
+
error: C(a)
|
|
1191
1250
|
};
|
|
1192
1251
|
}
|
|
1193
|
-
function
|
|
1194
|
-
const { stripe:
|
|
1252
|
+
function Vt() {
|
|
1253
|
+
const { stripe: o } = X(), d = m(!1), v = m(null), a = () => o.value !== null && typeof o.value.redirectToCheckout == "function";
|
|
1195
1254
|
return {
|
|
1196
1255
|
redirectToCheckout: async (e) => {
|
|
1197
|
-
|
|
1256
|
+
d.value = !0, v.value = null;
|
|
1198
1257
|
try {
|
|
1199
1258
|
if ("url" in e && e.url) {
|
|
1200
1259
|
window.location.replace(e.url);
|
|
1201
1260
|
return;
|
|
1202
1261
|
}
|
|
1203
1262
|
const r = e;
|
|
1204
|
-
if (!
|
|
1263
|
+
if (!a())
|
|
1205
1264
|
throw new E(
|
|
1206
1265
|
"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
1266
|
);
|
|
1208
|
-
if (!
|
|
1267
|
+
if (!o.value)
|
|
1209
1268
|
throw new E("Stripe not initialized");
|
|
1210
1269
|
console.warn(
|
|
1211
1270
|
"[Vue Stripe] Legacy redirectToCheckout is deprecated in @stripe/stripe-js v8.x. Use redirectToUrl() with a session URL from your server instead."
|
|
1212
1271
|
);
|
|
1213
|
-
const s = await
|
|
1272
|
+
const s = await o.value.redirectToCheckout(r);
|
|
1214
1273
|
if (s.error) {
|
|
1215
|
-
const
|
|
1216
|
-
throw
|
|
1274
|
+
const u = s.error.message || "Checkout redirect failed";
|
|
1275
|
+
throw v.value = u, new E(u);
|
|
1217
1276
|
}
|
|
1218
1277
|
} catch (r) {
|
|
1219
1278
|
const s = r instanceof Error ? r.message : "Checkout redirect failed";
|
|
1220
|
-
throw
|
|
1279
|
+
throw v.value = s, r;
|
|
1221
1280
|
} finally {
|
|
1222
|
-
|
|
1281
|
+
d.value = !1;
|
|
1223
1282
|
}
|
|
1224
1283
|
},
|
|
1225
1284
|
redirectToUrl: (e) => {
|
|
1226
|
-
|
|
1285
|
+
d.value = !0, v.value = null, window.location.replace(e);
|
|
1227
1286
|
},
|
|
1228
|
-
loading:
|
|
1229
|
-
error:
|
|
1287
|
+
loading: C(d),
|
|
1288
|
+
error: C(v)
|
|
1230
1289
|
};
|
|
1231
1290
|
}
|
|
1232
|
-
function
|
|
1233
|
-
const
|
|
1234
|
-
if (!
|
|
1235
|
-
throw new
|
|
1291
|
+
function $t() {
|
|
1292
|
+
const o = _(w);
|
|
1293
|
+
if (!o)
|
|
1294
|
+
throw new V(
|
|
1236
1295
|
"Elements context not found. Make sure to wrap your component with VueStripeElements."
|
|
1237
1296
|
);
|
|
1238
|
-
const
|
|
1297
|
+
const d = async () => o.elements.value ? o.elements.value.submit() : { error: { message: "Elements not initialized" } };
|
|
1239
1298
|
return {
|
|
1240
|
-
elements:
|
|
1241
|
-
submit:
|
|
1242
|
-
loading:
|
|
1243
|
-
error:
|
|
1299
|
+
elements: C(o.elements),
|
|
1300
|
+
submit: d,
|
|
1301
|
+
loading: C(o.loading),
|
|
1302
|
+
error: C(o.error)
|
|
1244
1303
|
};
|
|
1245
1304
|
}
|
|
1246
|
-
function
|
|
1305
|
+
function It(o) {
|
|
1247
1306
|
return {
|
|
1248
|
-
install(
|
|
1249
|
-
|
|
1250
|
-
let
|
|
1251
|
-
|
|
1307
|
+
install(d) {
|
|
1308
|
+
d.provide("vue-stripe-config", o);
|
|
1309
|
+
let v = null;
|
|
1310
|
+
d.provide("vue-stripe-global", {
|
|
1252
1311
|
get stripe() {
|
|
1253
|
-
if (!
|
|
1254
|
-
const
|
|
1255
|
-
|
|
1312
|
+
if (!v) {
|
|
1313
|
+
const a = {};
|
|
1314
|
+
o.stripeAccount && (a.stripeAccount = o.stripeAccount), o.apiVersion && (a.apiVersion = o.apiVersion), o.locale && (a.locale = o.locale), v = D(o.publishableKey, a).then((n) => (n && n.registerAppInfo(W), n));
|
|
1256
1315
|
}
|
|
1257
|
-
return
|
|
1316
|
+
return v;
|
|
1258
1317
|
}
|
|
1259
1318
|
});
|
|
1260
1319
|
}
|
|
1261
1320
|
};
|
|
1262
1321
|
}
|
|
1263
1322
|
export {
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1323
|
+
ht as VueStripeAddressElement,
|
|
1324
|
+
mt as VueStripeCardCvcElement,
|
|
1325
|
+
vt as VueStripeCardElement,
|
|
1326
|
+
pt as VueStripeCardExpiryElement,
|
|
1327
|
+
dt as VueStripeCardNumberElement,
|
|
1328
|
+
_t as VueStripeCheckout,
|
|
1329
|
+
ut as VueStripeElements,
|
|
1330
|
+
V as VueStripeElementsError,
|
|
1331
|
+
Et as VueStripeEpsBankElement,
|
|
1332
|
+
ct as VueStripeExpressCheckoutElement,
|
|
1333
|
+
gt as VueStripeIbanElement,
|
|
1334
|
+
bt as VueStripeIdealBankElement,
|
|
1335
|
+
ft as VueStripeLinkAuthenticationElement,
|
|
1336
|
+
se as VueStripeLoadError,
|
|
1337
|
+
yt as VueStripeP24BankElement,
|
|
1338
|
+
it as VueStripePaymentElement,
|
|
1339
|
+
kt as VueStripePricingTable,
|
|
1340
|
+
ot as VueStripeProvider,
|
|
1281
1341
|
E as VueStripeProviderError,
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1342
|
+
It as createVueStripe,
|
|
1343
|
+
lt as createVueStripeError,
|
|
1344
|
+
Tt as loadStripe,
|
|
1345
|
+
Vt as useCheckout,
|
|
1346
|
+
$t as useElements,
|
|
1347
|
+
St as usePaymentIntent,
|
|
1348
|
+
wt as useSetupIntent,
|
|
1349
|
+
X as useStripe,
|
|
1350
|
+
Vt as useStripeCheckout,
|
|
1351
|
+
$t as useStripeElements
|
|
1292
1352
|
};
|