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