cppay-sdk 0.0.2-beta.36 → 0.0.2-beta.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{cppay-GXgivhbP.cjs → cppay-B52ulQGn.cjs} +1 -1
- package/dist/{cppay-DnoMkyVy.js → cppay-J9nBy01A.js} +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1 -1
- package/dist/locales-De6oJnka.js +112 -0
- package/dist/locales-DfK0OLJI.cjs +1 -0
- package/dist/react.cjs +1 -1
- package/dist/react.d.ts +6 -10
- package/dist/react.js +243 -246
- package/dist/vue.cjs +1 -1
- package/dist/vue.d.ts +9 -19
- package/dist/vue.js +245 -255
- package/package.json +1 -1
- package/dist/locales-KW7cSv4d.js +0 -112
- package/dist/locales-mdiXS8LU.cjs +0 -1
package/dist/vue.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as cppay_default } from "./cppay-
|
|
2
|
-
import { n as injectStyle, r as payment_dialog_default, t as getLocaleMessages } from "./locales-
|
|
3
|
-
import { Fragment, computed, createApp, createCommentVNode, createElementBlock, createElementVNode,
|
|
1
|
+
import { t as cppay_default } from "./cppay-J9nBy01A.js";
|
|
2
|
+
import { n as injectStyle, r as payment_dialog_default, t as getLocaleMessages } from "./locales-De6oJnka.js";
|
|
3
|
+
import { Fragment, computed, createApp, createBlock, createCommentVNode, createElementBlock, createElementVNode, defineComponent, h, normalizeClass, onMounted, onUnmounted, openBlock, ref, renderList, renderSlot, shallowRef, toDisplayString, watch, withCtx } from "vue";
|
|
4
4
|
import * as QRCode from "qrcode";
|
|
5
5
|
import { EMPTY, defer, timer } from "rxjs";
|
|
6
6
|
import { expand, retry, switchMap, tap, timeout } from "rxjs/operators";
|
|
@@ -56,7 +56,7 @@ var _hoisted_1$1 = { class: "_cppay-content" }, _hoisted_2$1 = {
|
|
|
56
56
|
apikey: {},
|
|
57
57
|
orderId: {},
|
|
58
58
|
amount: {},
|
|
59
|
-
plain: {
|
|
59
|
+
plain: {},
|
|
60
60
|
intervalDays: {},
|
|
61
61
|
slots: {},
|
|
62
62
|
locale: {}
|
|
@@ -66,14 +66,11 @@ var _hoisted_1$1 = { class: "_cppay-content" }, _hoisted_2$1 = {
|
|
|
66
66
|
"success",
|
|
67
67
|
"expired",
|
|
68
68
|
"failed",
|
|
69
|
-
"error"
|
|
70
|
-
"update:loading",
|
|
71
|
-
"update:isCheckingPayment",
|
|
72
|
-
"update:error"
|
|
69
|
+
"error"
|
|
73
70
|
],
|
|
74
|
-
setup(
|
|
75
|
-
let
|
|
76
|
-
typeof window < "u" && !
|
|
71
|
+
setup(i, { emit: a }) {
|
|
72
|
+
let c = i, l = a, u = computed(() => getLocaleMessages(c.locale)), d = new cppay_default(c.apikey), g = ref("select"), _ = ref(!1), v = computed(() => g.value === "checking"), y = ref(), b = ref([]), x = ref(), S = ref(), C = ref(), w = ref(), T = ref(!1), E = ref(), D = ref(""), O = ref(!1), k = ref(!1), A = shallowRef(null), j = ref(null), M = ref(null), N = ref(null), P = () => {
|
|
73
|
+
typeof window < "u" && !A.value && (A.value = createAppKit({
|
|
77
74
|
debug: !1,
|
|
78
75
|
enableNetworkSwitch: !1,
|
|
79
76
|
adapters: [new EthersAdapter()],
|
|
@@ -94,30 +91,24 @@ var _hoisted_1$1 = { class: "_cppay-content" }, _hoisted_2$1 = {
|
|
|
94
91
|
icons: ["https://cppay.com/icon.png"]
|
|
95
92
|
},
|
|
96
93
|
features: { analytics: !1 }
|
|
97
|
-
}),
|
|
98
|
-
e.isConnected ?
|
|
99
|
-
}),
|
|
100
|
-
|
|
94
|
+
}), w.value = A.value.getAddress(), E.value = A.value.getProvider("eip155"), A.value.subscribeAccount((e) => {
|
|
95
|
+
e.isConnected ? w.value = e.address : (w.value = void 0, E.value = void 0);
|
|
96
|
+
}), A.value.subscribeProviders((e) => {
|
|
97
|
+
E.value = e?.eip155;
|
|
101
98
|
}));
|
|
102
99
|
};
|
|
103
|
-
watch(
|
|
104
|
-
|
|
105
|
-
}), watch(y, (e) => {
|
|
106
|
-
o("update:loading", e);
|
|
107
|
-
}), watch(b, (e) => {
|
|
108
|
-
o("update:isCheckingPayment", e);
|
|
109
|
-
}), watch(x, (e) => {
|
|
110
|
-
o("update:error", e);
|
|
100
|
+
watch(g, (e) => {
|
|
101
|
+
l("update:paymentStep", e);
|
|
111
102
|
});
|
|
112
|
-
let
|
|
103
|
+
let F = async () => {
|
|
113
104
|
try {
|
|
114
|
-
|
|
105
|
+
T.value = !0, y.value = void 0, A.value && await A.value.open();
|
|
115
106
|
} catch (e) {
|
|
116
|
-
|
|
107
|
+
y.value = e instanceof Error ? e.message : u.value.walletConnectionFailed, l("error", e);
|
|
117
108
|
} finally {
|
|
118
|
-
|
|
109
|
+
T.value = !1;
|
|
119
110
|
}
|
|
120
|
-
},
|
|
111
|
+
}, I = computed(() => b.value.find((e) => e.chain === x.value)), L = computed(() => I.value?.tokens || []), R = computed(() => L.value.find((e) => e.symbol === S.value)), z = (e) => [
|
|
121
112
|
"USDT",
|
|
122
113
|
"USDC",
|
|
123
114
|
"BUSD",
|
|
@@ -125,90 +116,102 @@ var _hoisted_1$1 = { class: "_cppay-content" }, _hoisted_2$1 = {
|
|
|
125
116
|
"TUSD",
|
|
126
117
|
"USDD",
|
|
127
118
|
"FDUSD"
|
|
128
|
-
].includes(e.toUpperCase()) ? 2 : 6,
|
|
129
|
-
let
|
|
130
|
-
return isNaN(
|
|
131
|
-
},
|
|
132
|
-
if (e <= 0) return
|
|
133
|
-
let
|
|
134
|
-
return
|
|
135
|
-
},
|
|
136
|
-
|
|
137
|
-
let
|
|
138
|
-
|
|
139
|
-
|
|
119
|
+
].includes(e.toUpperCase()) ? 2 : 6, B = (e, i) => {
|
|
120
|
+
let a = parseFloat(e);
|
|
121
|
+
return isNaN(a) ? "0" : a.toFixed(i).replace(/\.?0+$/, "");
|
|
122
|
+
}, V = (e) => {
|
|
123
|
+
if (e <= 0) return u.value.expired;
|
|
124
|
+
let i = Math.floor(e / 3600), a = Math.floor(e % 3600 / 60), o = e % 60;
|
|
125
|
+
return i > 0 ? `${i}${u.value.hours}${a}${u.value.minutes}${o}${u.value.seconds}` : `${a}${u.value.minutes}${o}${u.value.seconds}`;
|
|
126
|
+
}, H = (e) => {
|
|
127
|
+
M.value && clearInterval(M.value);
|
|
128
|
+
let i = () => {
|
|
129
|
+
if (g.value === "checking") {
|
|
130
|
+
U();
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
let i = e - Math.floor(Date.now() / 1e3);
|
|
134
|
+
D.value = V(i), i <= 0 && (g.value = "expired", U());
|
|
140
135
|
};
|
|
141
|
-
|
|
142
|
-
},
|
|
143
|
-
|
|
144
|
-
},
|
|
145
|
-
if (!
|
|
146
|
-
let e = parseFloat(
|
|
136
|
+
i(), M.value = setInterval(i, 1e3);
|
|
137
|
+
}, U = () => {
|
|
138
|
+
M.value &&= (clearInterval(M.value), null);
|
|
139
|
+
}, W = computed(() => {
|
|
140
|
+
if (!S.value || !R.value) return "0";
|
|
141
|
+
let e = parseFloat(R.value.price);
|
|
147
142
|
if (isNaN(e) || e === 0) return "0";
|
|
148
|
-
let
|
|
149
|
-
return
|
|
150
|
-
}),
|
|
143
|
+
let i = z(S.value);
|
|
144
|
+
return B((parseFloat(c.amount) / e).toFixed(i), i);
|
|
145
|
+
}), G = async () => {
|
|
151
146
|
try {
|
|
152
|
-
|
|
153
|
-
let e = await c.getSupportedChains();
|
|
154
|
-
S.value = e, e.length > 0 && (C.value = e[0].chain);
|
|
147
|
+
_.value = !0, y.value = void 0, b.value = await d.getSupportedChains(), b.value.length > 0 && (x.value = b.value[0].chain);
|
|
155
148
|
} catch (e) {
|
|
156
|
-
|
|
149
|
+
y.value = e instanceof Error ? e.message : u.value.loadPaymentNetworkFailed, l("error", e);
|
|
150
|
+
} finally {
|
|
151
|
+
_.value = !1;
|
|
157
152
|
}
|
|
158
|
-
},
|
|
159
|
-
if (
|
|
160
|
-
await
|
|
153
|
+
}, K = async (e) => {
|
|
154
|
+
if (E.value) try {
|
|
155
|
+
await E.value.request({
|
|
161
156
|
method: "wallet_switchEthereumChain",
|
|
162
157
|
params: [{ chainId: `0x${e.toString(16)}` }]
|
|
163
158
|
});
|
|
164
159
|
} catch (e) {
|
|
165
|
-
throw e.code === 4902 ? Error(
|
|
160
|
+
throw e.code === 4902 ? Error(u.value.pleaseAddNetwork) : e;
|
|
166
161
|
}
|
|
167
|
-
},
|
|
168
|
-
if (!(!
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
162
|
+
}, q = async () => {
|
|
163
|
+
if (!(!w.value || !E.value || !N.value || !R.value || !I.value)) try {
|
|
164
|
+
_.value = !0;
|
|
165
|
+
let e = N.value;
|
|
166
|
+
await K(I.value.chainId);
|
|
167
|
+
let i = createWalletClient({
|
|
168
|
+
account: w.value,
|
|
169
|
+
transport: custom(E.value)
|
|
174
170
|
});
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
171
|
+
if (R.value.address) {
|
|
172
|
+
let a = await i.writeContract({
|
|
173
|
+
address: R.value.address,
|
|
174
|
+
abi: [{
|
|
175
|
+
name: "transfer",
|
|
176
|
+
type: "function",
|
|
177
|
+
stateMutability: "nonpayable",
|
|
178
|
+
inputs: [{
|
|
179
|
+
name: "to",
|
|
180
|
+
type: "address"
|
|
181
|
+
}, {
|
|
182
|
+
name: "amount",
|
|
183
|
+
type: "uint256"
|
|
184
|
+
}],
|
|
185
|
+
outputs: [{ type: "bool" }]
|
|
187
186
|
}],
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
187
|
+
functionName: "transfer",
|
|
188
|
+
args: [e.receiveAddress, parseUnits(e.paymentAmount, R.value.decimals)],
|
|
189
|
+
chain: null
|
|
190
|
+
});
|
|
191
|
+
console.log("转账交易哈希:", a);
|
|
192
|
+
} else {
|
|
193
|
+
let a = await i.sendTransaction({
|
|
194
|
+
to: e.receiveAddress,
|
|
195
|
+
value: parseUnits(e.paymentAmount, R.value.decimals),
|
|
196
|
+
chain: null
|
|
197
|
+
});
|
|
198
|
+
console.log("转账交易哈希:", a);
|
|
199
|
+
}
|
|
200
|
+
_.value = !1, g.value = "checking";
|
|
198
201
|
} catch (e) {
|
|
199
|
-
|
|
202
|
+
console.error("钱包支付失败:", e), y.value = e instanceof Error ? e.message : u.value.walletPaymentFailed, l("error", e), _.value = !1;
|
|
200
203
|
}
|
|
201
|
-
},
|
|
202
|
-
if (!(!
|
|
203
|
-
let e =
|
|
204
|
-
await
|
|
205
|
-
let
|
|
206
|
-
account:
|
|
207
|
-
transport: custom(
|
|
204
|
+
}, J = async () => {
|
|
205
|
+
if (!(!w.value || !E.value || !N.value || !R.value || !I.value)) try {
|
|
206
|
+
let e = N.value;
|
|
207
|
+
await K(I.value.chainId);
|
|
208
|
+
let i = createWalletClient({
|
|
209
|
+
account: w.value,
|
|
210
|
+
transport: custom(E.value)
|
|
208
211
|
});
|
|
209
|
-
if (!
|
|
210
|
-
await
|
|
211
|
-
address:
|
|
212
|
+
if (!R.value.address) throw Error(u.value.subscriptionDoesNotSupportNative);
|
|
213
|
+
let a = await i.writeContract({
|
|
214
|
+
address: R.value.address,
|
|
212
215
|
abi: [{
|
|
213
216
|
name: "approve",
|
|
214
217
|
type: "function",
|
|
@@ -223,143 +226,142 @@ var _hoisted_1$1 = { class: "_cppay-content" }, _hoisted_2$1 = {
|
|
|
223
226
|
outputs: [{ type: "bool" }]
|
|
224
227
|
}],
|
|
225
228
|
functionName: "approve",
|
|
226
|
-
args: [e.spenderAddress, parseUnits(e.approveAmount,
|
|
229
|
+
args: [e.spenderAddress, parseUnits(e.approveAmount, R.value.decimals)],
|
|
227
230
|
chain: null
|
|
228
|
-
})
|
|
231
|
+
});
|
|
232
|
+
console.log("授权交易哈希:", a), _.value = !1, g.value = "checking";
|
|
229
233
|
} catch (e) {
|
|
230
|
-
|
|
234
|
+
console.error("钱包授权失败:", e), y.value = e instanceof Error ? e.message : u.value.walletPaymentFailed, l("error", e), _.value = !1;
|
|
231
235
|
}
|
|
232
|
-
},
|
|
233
|
-
if (!
|
|
234
|
-
|
|
236
|
+
}, Y = async () => {
|
|
237
|
+
if (!w.value) {
|
|
238
|
+
y.value = u.value.pleaseConnectWallet, l("error", Error(u.value.pleaseConnectWallet));
|
|
235
239
|
return;
|
|
236
240
|
}
|
|
237
|
-
|
|
238
|
-
},
|
|
239
|
-
if (!(!
|
|
240
|
-
|
|
241
|
+
c.plain === "instant" ? await q() : c.plain === "subscription" && await J();
|
|
242
|
+
}, X = async () => {
|
|
243
|
+
if (!(!x.value || !S.value)) try {
|
|
244
|
+
y.value = void 0;
|
|
241
245
|
let e = "";
|
|
242
|
-
|
|
243
|
-
paymentChain:
|
|
244
|
-
paymentToken:
|
|
245
|
-
orderId:
|
|
246
|
-
amount:
|
|
247
|
-
}), e = `${
|
|
248
|
-
paymentChain:
|
|
249
|
-
paymentToken:
|
|
250
|
-
orderId:
|
|
251
|
-
amountOfUsd:
|
|
252
|
-
intervalDays:
|
|
253
|
-
}), e = `${
|
|
246
|
+
c.plain === "instant" ? (N.value = await d.createOnetimePayment({
|
|
247
|
+
paymentChain: x.value,
|
|
248
|
+
paymentToken: S.value,
|
|
249
|
+
orderId: c.orderId,
|
|
250
|
+
amount: W.value
|
|
251
|
+
}), e = `${x.value.toLowerCase()}:${N.value.receiveAddress}?amount=${N.value.paymentAmount}`, H(N.value.expireAt), Q({ paymentId: N.value.paymentId })) : c.plain === "subscription" && (N.value = await d.createSubscriptionPayment({
|
|
252
|
+
paymentChain: x.value,
|
|
253
|
+
paymentToken: S.value,
|
|
254
|
+
orderId: c.orderId,
|
|
255
|
+
amountOfUsd: W.value,
|
|
256
|
+
intervalDays: c.intervalDays || 30
|
|
257
|
+
}), e = `${x.value.toLowerCase()}:${N.value.spenderAddress}?amount=${N.value.approveAmount}`, H(N.value.expireAt), Q({ subscriptionId: N.value.subscriptionId })), g.value = "payment", C.value = await QRCode.toDataURL(e, {
|
|
254
258
|
width: 200,
|
|
255
259
|
margin: 2,
|
|
256
260
|
errorCorrectionLevel: "H"
|
|
257
261
|
});
|
|
258
262
|
} catch (e) {
|
|
259
|
-
|
|
263
|
+
y.value = e instanceof Error ? e.message : u.value.createPaymentFailed, l("error", e);
|
|
260
264
|
}
|
|
261
|
-
},
|
|
262
|
-
N.value
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
265
|
+
}, Z = () => {
|
|
266
|
+
N.value && (y.value = void 0, g.value = "checking");
|
|
267
|
+
}, Q = (e) => {
|
|
268
|
+
j.value?.unsubscribe();
|
|
269
|
+
let i = () => defer(() => c.plain === "subscription" ? d.checkSubscriptionPaymentStatus(e) : d.checkOnetimePaymentStatus(e)).pipe(timeout(15e3), retry({ delay: 2e3 }));
|
|
270
|
+
j.value = i().pipe(expand((e) => e.status === "pending" ? timer(2e3).pipe(switchMap(() => i())) : EMPTY), tap((e) => {
|
|
271
|
+
(e.status === "paid" || e.status === "approved") && (g.value = "success", l("success", e)), e.status === "expired" && (g.value = "expired", l("expired", e)), e.status === "failed" && (g.value = "failed", l("failed", e));
|
|
266
272
|
})).subscribe({
|
|
267
273
|
error: (e) => {
|
|
268
|
-
if (
|
|
269
|
-
let
|
|
270
|
-
|
|
274
|
+
if (N.value) {
|
|
275
|
+
let i = e instanceof Error ? e.message : u.value.checkPaymentStatusFailed;
|
|
276
|
+
g.value = "error", y.value = i, l("error", e);
|
|
271
277
|
}
|
|
272
278
|
},
|
|
273
279
|
complete: () => {
|
|
274
|
-
|
|
280
|
+
j.value?.unsubscribe();
|
|
275
281
|
}
|
|
276
282
|
});
|
|
277
|
-
},
|
|
278
|
-
if (!
|
|
279
|
-
let e =
|
|
283
|
+
}, $ = async () => {
|
|
284
|
+
if (!N.value) return;
|
|
285
|
+
let e = c.plain === "subscription" ? N.value.spenderAddress : N.value.receiveAddress;
|
|
280
286
|
if (e) try {
|
|
281
|
-
await navigator.clipboard.writeText(e),
|
|
282
|
-
|
|
287
|
+
await navigator.clipboard.writeText(e), O.value = !0, setTimeout(() => {
|
|
288
|
+
O.value = !1;
|
|
283
289
|
}, 2e3);
|
|
284
290
|
} catch (e) {
|
|
285
291
|
console.error("复制失败:", e);
|
|
286
292
|
}
|
|
287
293
|
};
|
|
288
|
-
return watch(
|
|
289
|
-
e
|
|
290
|
-
}, { immediate: !0 }), watch(z, (e) => {
|
|
291
|
-
e.length > 0 && !w.value && (w.value = e[0].symbol);
|
|
292
|
-
}), watch(() => a.orderId, (e) => {
|
|
293
|
-
e && $({ orderId: e });
|
|
294
|
+
return watch(L, (e) => {
|
|
295
|
+
e.length > 0 && (S.value = e[0].symbol);
|
|
294
296
|
}), onMounted(() => {
|
|
295
|
-
|
|
297
|
+
P(), b.value.length || G(), c.orderId && Q({ orderId: c.orderId });
|
|
296
298
|
}), onUnmounted(() => {
|
|
297
|
-
|
|
298
|
-
}), (e,
|
|
299
|
-
|
|
300
|
-
createElementVNode("h3", _hoisted_3$1, toDisplayString(
|
|
301
|
-
createElementVNode("p", _hoisted_4$1, toDisplayString(
|
|
302
|
-
])) :
|
|
303
|
-
|
|
304
|
-
createElementVNode("h3", _hoisted_6, toDisplayString(
|
|
299
|
+
j.value?.unsubscribe(), U();
|
|
300
|
+
}), (e, a) => (openBlock(), createElementBlock("div", _hoisted_1$1, [g.value === "success" ? (openBlock(), createElementBlock("div", _hoisted_2$1, [
|
|
301
|
+
a[6] ||= createElementVNode("div", { class: "_cppay-state-icon" }, "✅", -1),
|
|
302
|
+
createElementVNode("h3", _hoisted_3$1, toDisplayString(i.plain === "subscription" ? u.value.authorizationSuccess : u.value.paymentSuccess), 1),
|
|
303
|
+
createElementVNode("p", _hoisted_4$1, toDisplayString(i.plain === "subscription" ? u.value.subscriptionActivated : u.value.transactionCompleted), 1)
|
|
304
|
+
])) : g.value === "expired" ? (openBlock(), createElementBlock("div", _hoisted_5, [
|
|
305
|
+
a[7] ||= createElementVNode("div", { class: "_cppay-state-icon" }, "⏰", -1),
|
|
306
|
+
createElementVNode("h3", _hoisted_6, toDisplayString(u.value.paymentExpired), 1),
|
|
305
307
|
createElementVNode("button", {
|
|
306
|
-
onClick:
|
|
307
|
-
disabled:
|
|
308
|
+
onClick: a[0] ||= (e) => g.value = "select",
|
|
309
|
+
disabled: _.value || v.value,
|
|
308
310
|
class: "_cppay-btn _cppay-btn-text"
|
|
309
|
-
}, toDisplayString(
|
|
310
|
-
])) :
|
|
311
|
+
}, toDisplayString(u.value.returnButton), 9, _hoisted_7)
|
|
312
|
+
])) : g.value === "error" ? (openBlock(), createElementBlock("div", _hoisted_8, [a[8] ||= createElementVNode("div", { class: "_cppay-state-icon" }, "❌", -1), createElementVNode("h3", _hoisted_9, toDisplayString(u.value.checking), 1)])) : g.value === "failed" ? (openBlock(), createElementBlock("div", _hoisted_10, [a[9] ||= createElementVNode("div", { class: "_cppay-state-icon" }, "❌", -1), createElementVNode("h3", _hoisted_11, toDisplayString(u.value.paymentFailed), 1)])) : g.value === "select" ? (openBlock(), createElementBlock("div", _hoisted_12, [
|
|
311
313
|
renderSlot(e.$slots, "choose-top"),
|
|
312
|
-
createElementVNode("div", _hoisted_13, [createElementVNode("label", _hoisted_14, toDisplayString(
|
|
314
|
+
createElementVNode("div", _hoisted_13, [createElementVNode("label", _hoisted_14, toDisplayString(u.value.paymentNetwork), 1), createElementVNode("div", _hoisted_15, [(openBlock(!0), createElementBlock(Fragment, null, renderList(b.value, (e) => (openBlock(), createElementBlock("button", {
|
|
313
315
|
key: e.chain,
|
|
314
|
-
onClick: (
|
|
315
|
-
class: normalizeClass(["_cppay-select-btn", { "_cppay-selected":
|
|
316
|
+
onClick: (i) => x.value = e.chain,
|
|
317
|
+
class: normalizeClass(["_cppay-select-btn", { "_cppay-selected": x.value === e.chain }])
|
|
316
318
|
}, [e.icon ? (openBlock(), createElementBlock("img", {
|
|
317
319
|
key: 0,
|
|
318
320
|
src: e.icon,
|
|
319
321
|
alt: e.chain
|
|
320
322
|
}, null, 8, _hoisted_17)) : createCommentVNode("", !0), createElementVNode("span", null, toDisplayString(e.chain), 1)], 10, _hoisted_16))), 128))])]),
|
|
321
|
-
createElementVNode("div", _hoisted_18, [createElementVNode("label", _hoisted_19, toDisplayString(
|
|
323
|
+
createElementVNode("div", _hoisted_18, [createElementVNode("label", _hoisted_19, toDisplayString(u.value.paymentToken), 1), createElementVNode("div", _hoisted_20, [(openBlock(!0), createElementBlock(Fragment, null, renderList(L.value, (e) => (openBlock(), createElementBlock("button", {
|
|
322
324
|
key: e.symbol,
|
|
323
|
-
onClick: (
|
|
324
|
-
class: normalizeClass(["_cppay-select-btn", { "_cppay-selected":
|
|
325
|
+
onClick: (i) => S.value = e.symbol,
|
|
326
|
+
class: normalizeClass(["_cppay-select-btn", { "_cppay-selected": S.value === e.symbol }])
|
|
325
327
|
}, [e.icon ? (openBlock(), createElementBlock("img", {
|
|
326
328
|
key: 0,
|
|
327
329
|
src: e.icon,
|
|
328
330
|
alt: e.symbol
|
|
329
331
|
}, null, 8, _hoisted_22)) : createCommentVNode("", !0), createElementVNode("span", null, toDisplayString(e.symbol), 1)], 10, _hoisted_21))), 128))])]),
|
|
330
332
|
renderSlot(e.$slots, "choose-bottom"),
|
|
331
|
-
createElementVNode("div", _hoisted_23, [createElementVNode("div", _hoisted_24, [createElementVNode("div", _hoisted_25, [createElementVNode("span", _hoisted_26, toDisplayString(
|
|
332
|
-
createElementVNode("div", _hoisted_30, [
|
|
333
|
+
createElementVNode("div", _hoisted_23, [createElementVNode("div", _hoisted_24, [createElementVNode("div", _hoisted_25, [createElementVNode("span", _hoisted_26, toDisplayString(u.value.paymentAmount), 1), createElementVNode("div", _hoisted_27, [createElementVNode("div", _hoisted_28, toDisplayString(W.value ?? "-") + " " + toDisplayString(S.value ?? ""), 1), createElementVNode("div", _hoisted_29, "≈ $" + toDisplayString(i.amount), 1)])])])]),
|
|
334
|
+
createElementVNode("div", _hoisted_30, [y.value ? (openBlock(), createElementBlock("div", {
|
|
333
335
|
key: 0,
|
|
334
336
|
class: "_cppay-error-tooltip-wrapper",
|
|
335
|
-
onMouseenter:
|
|
336
|
-
onMouseleave:
|
|
337
|
-
}, [createElementVNode("div", _hoisted_31, [
|
|
337
|
+
onMouseenter: a[1] ||= (e) => k.value = !0,
|
|
338
|
+
onMouseleave: a[2] ||= (e) => k.value = !1
|
|
339
|
+
}, [createElementVNode("div", _hoisted_31, [a[10] ||= createElementVNode("svg", {
|
|
338
340
|
viewBox: "0 0 20 20",
|
|
339
341
|
fill: "currentColor"
|
|
340
342
|
}, [createElementVNode("path", {
|
|
341
343
|
"fill-rule": "evenodd",
|
|
342
344
|
d: "M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z",
|
|
343
345
|
"clip-rule": "evenodd"
|
|
344
|
-
})], -1), createElementVNode("span", null, toDisplayString(
|
|
345
|
-
onClick:
|
|
346
|
-
disabled: !
|
|
346
|
+
})], -1), createElementVNode("span", null, toDisplayString(y.value), 1)]), k.value ? (openBlock(), createElementBlock("div", _hoisted_32, toDisplayString(y.value), 1)) : createCommentVNode("", !0)], 32)) : createCommentVNode("", !0), createElementVNode("button", {
|
|
347
|
+
onClick: X,
|
|
348
|
+
disabled: !x.value || !S.value || _.value,
|
|
347
349
|
class: "_cppay-btn _cppay-btn-primary"
|
|
348
|
-
}, toDisplayString(
|
|
350
|
+
}, toDisplayString(_.value ? u.value.processing : u.value.continuePayment), 9, _hoisted_33)])
|
|
349
351
|
])) : (openBlock(), createElementBlock("div", _hoisted_34, [
|
|
350
|
-
createElementVNode("div", _hoisted_35, [createElementVNode("div", _hoisted_36, [
|
|
352
|
+
createElementVNode("div", _hoisted_35, [createElementVNode("div", _hoisted_36, [C.value ? (openBlock(), createElementBlock("img", {
|
|
351
353
|
key: 0,
|
|
352
|
-
src:
|
|
354
|
+
src: C.value,
|
|
353
355
|
alt: "Payment QR Code",
|
|
354
356
|
class: "_cppay-qr-image"
|
|
355
357
|
}, null, 8, _hoisted_37)) : createCommentVNode("", !0)])]),
|
|
356
358
|
createElementVNode("div", _hoisted_38, [
|
|
357
|
-
|
|
358
|
-
createElementVNode("div", _hoisted_45, [createElementVNode("div", _hoisted_46, [createElementVNode("div", _hoisted_47, [createElementVNode("span", null, toDisplayString(
|
|
359
|
-
onClick:
|
|
360
|
-
class: normalizeClass(["_cppay-copy-btn", { "_cppay-copy-success":
|
|
361
|
-
title:
|
|
362
|
-
}, [
|
|
359
|
+
R.value ? (openBlock(), createElementBlock("div", _hoisted_39, [createElementVNode("div", _hoisted_40, [createElementVNode("div", _hoisted_41, [createElementVNode("div", _hoisted_42, toDisplayString(i.plain === "subscription" ? u.value.authorizationAmount : u.value.paymentAmount), 1), createElementVNode("div", _hoisted_43, [N.value ? (openBlock(), createElementBlock("span", _hoisted_44, toDisplayString(i.plain === "subscription" ? `${B(N.value.approveAmount, z(R.value.symbol))} ${R.value.symbol}` : `${B(N.value.paymentAmount, z(R.value.symbol))} ${R.value.symbol}`), 1)) : createCommentVNode("", !0), createElementVNode("span", null, "≈ $" + toDisplayString(i.amount), 1)])])])])) : createCommentVNode("", !0),
|
|
360
|
+
createElementVNode("div", _hoisted_45, [createElementVNode("div", _hoisted_46, [createElementVNode("div", _hoisted_47, [createElementVNode("span", null, toDisplayString(i.plain === "subscription" ? u.value.authorizationContractAddress : u.value.paymentAddress), 1), D.value ? (openBlock(), createElementBlock("span", _hoisted_48, "⏰ " + toDisplayString(D.value), 1)) : createCommentVNode("", !0)]), createElementVNode("div", _hoisted_49, [N.value ? (openBlock(), createElementBlock("code", _hoisted_50, toDisplayString(i.plain === "subscription" ? N.value.spenderAddress : N.value.receiveAddress), 1)) : createCommentVNode("", !0), createElementVNode("button", {
|
|
361
|
+
onClick: $,
|
|
362
|
+
class: normalizeClass(["_cppay-copy-btn", { "_cppay-copy-success": O.value }]),
|
|
363
|
+
title: O.value ? u.value.copied : u.value.copyAddress
|
|
364
|
+
}, [O.value ? (openBlock(), createElementBlock("svg", _hoisted_53, [...a[12] ||= [createElementVNode("path", { d: "M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z" }, null, -1)]])) : (openBlock(), createElementBlock("svg", _hoisted_52, [...a[11] ||= [createElementVNode("path", { d: "M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2" }, null, -1), createElementVNode("rect", {
|
|
363
365
|
x: "8",
|
|
364
366
|
y: "2",
|
|
365
367
|
width: "8",
|
|
@@ -367,31 +369,31 @@ var _hoisted_1$1 = { class: "_cppay-content" }, _hoisted_2$1 = {
|
|
|
367
369
|
rx: "1",
|
|
368
370
|
ry: "1"
|
|
369
371
|
}, null, -1)]]))], 10, _hoisted_51)])])]),
|
|
370
|
-
|
|
372
|
+
i.plain === "subscription" ? (openBlock(), createElementBlock("div", _hoisted_54, [createElementVNode("div", _hoisted_55, toDisplayString(u.value.subscriptionNotice), 1), createElementVNode("div", _hoisted_56, toDisplayString(u.value.subscriptionNoticeMessage), 1)])) : createCommentVNode("", !0)
|
|
371
373
|
]),
|
|
372
|
-
|
|
374
|
+
y.value ? (openBlock(), createElementBlock("div", {
|
|
373
375
|
key: 0,
|
|
374
376
|
class: "_cppay-error-tooltip-wrapper",
|
|
375
|
-
onMouseenter:
|
|
376
|
-
onMouseleave:
|
|
377
|
-
}, [createElementVNode("div", _hoisted_57, [
|
|
377
|
+
onMouseenter: a[3] ||= (e) => k.value = !0,
|
|
378
|
+
onMouseleave: a[4] ||= (e) => k.value = !1
|
|
379
|
+
}, [createElementVNode("div", _hoisted_57, [a[13] ||= createElementVNode("svg", {
|
|
378
380
|
viewBox: "0 0 20 20",
|
|
379
381
|
fill: "currentColor"
|
|
380
382
|
}, [createElementVNode("path", {
|
|
381
383
|
"fill-rule": "evenodd",
|
|
382
384
|
d: "M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z",
|
|
383
385
|
"clip-rule": "evenodd"
|
|
384
|
-
})], -1), createElementVNode("span", null, toDisplayString(
|
|
385
|
-
|
|
386
|
-
onClick:
|
|
387
|
-
disabled:
|
|
386
|
+
})], -1), createElementVNode("span", null, toDisplayString(y.value), 1)]), k.value ? (openBlock(), createElementBlock("div", _hoisted_58, toDisplayString(y.value), 1)) : createCommentVNode("", !0)], 32)) : createCommentVNode("", !0),
|
|
387
|
+
v.value ? createCommentVNode("", !0) : (openBlock(), createElementBlock("div", _hoisted_59, [w.value ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [createElementVNode("button", {
|
|
388
|
+
onClick: Y,
|
|
389
|
+
disabled: _.value,
|
|
388
390
|
class: "_cppay-btn _cppay-btn-primary"
|
|
389
|
-
}, toDisplayString(
|
|
390
|
-
onClick:
|
|
391
|
-
disabled:
|
|
391
|
+
}, toDisplayString(_.value ? i.plain === "subscription" ? u.value.authorizing : u.value.processing : (i.plain, u.value.walletPay)), 9, _hoisted_61), createElementVNode("button", {
|
|
392
|
+
onClick: F,
|
|
393
|
+
disabled: _.value,
|
|
392
394
|
class: "_cppay-btn _cppay-wallet-address-btn",
|
|
393
|
-
title:
|
|
394
|
-
}, [createElementVNode("span", _hoisted_63, toDisplayString(
|
|
395
|
+
title: u.value.clickToModifyWallet
|
|
396
|
+
}, [createElementVNode("span", _hoisted_63, toDisplayString(w.value.slice(0, 10)) + "..." + toDisplayString(w.value.slice(-4)), 1), a[14] ||= createElementVNode("svg", {
|
|
395
397
|
class: "_cppay-wallet-arrow",
|
|
396
398
|
viewBox: "0 0 24 24",
|
|
397
399
|
fill: "none",
|
|
@@ -399,21 +401,21 @@ var _hoisted_1$1 = { class: "_cppay-content" }, _hoisted_2$1 = {
|
|
|
399
401
|
"stroke-width": "2"
|
|
400
402
|
}, [createElementVNode("polyline", { points: "6 9 12 15 18 9" })], -1)], 8, _hoisted_62)], 64)) : (openBlock(), createElementBlock("button", {
|
|
401
403
|
key: 0,
|
|
402
|
-
onClick:
|
|
403
|
-
disabled:
|
|
404
|
+
onClick: F,
|
|
405
|
+
disabled: T.value,
|
|
404
406
|
class: "_cppay-btn _cppay-btn-secondary _cppay-connect-wallet-btn"
|
|
405
|
-
}, [createElementVNode("span", null, toDisplayString(
|
|
407
|
+
}, [createElementVNode("span", null, toDisplayString(T.value ? u.value.processing : u.value.connectWallet), 1)], 8, _hoisted_60))])),
|
|
406
408
|
createElementVNode("div", _hoisted_64, [createElementVNode("button", {
|
|
407
|
-
onClick:
|
|
408
|
-
disabled:
|
|
409
|
+
onClick: Z,
|
|
410
|
+
disabled: v.value,
|
|
409
411
|
class: "_cppay-btn _cppay-btn-primary"
|
|
410
|
-
}, toDisplayString(
|
|
411
|
-
|
|
412
|
+
}, toDisplayString(v.value ? u.value.checking : u.value.completedPayment), 9, _hoisted_65)]),
|
|
413
|
+
a[15] ||= createElementVNode("hr", { class: "_cppay-divider" }, null, -1),
|
|
412
414
|
createElementVNode("div", _hoisted_66, [createElementVNode("button", {
|
|
413
|
-
onClick:
|
|
414
|
-
disabled:
|
|
415
|
+
onClick: a[5] ||= (e) => g.value = "select",
|
|
416
|
+
disabled: _.value || v.value,
|
|
415
417
|
class: "_cppay-btn _cppay-btn-text"
|
|
416
|
-
}, toDisplayString(
|
|
418
|
+
}, toDisplayString(u.value.changePaymentMethod), 9, _hoisted_67)])
|
|
417
419
|
]))]));
|
|
418
420
|
}
|
|
419
421
|
}), _hoisted_1 = { class: "_cppay-dialog" }, _hoisted_2 = { class: "_cppay-header" }, _hoisted_3 = { class: "_cppay-title" }, _hoisted_4 = ["disabled"], PaymentDialog_default = /* @__PURE__ */ defineComponent({
|
|
@@ -423,9 +425,9 @@ var _hoisted_1$1 = { class: "_cppay-content" }, _hoisted_2$1 = {
|
|
|
423
425
|
apikey: {},
|
|
424
426
|
orderId: {},
|
|
425
427
|
amount: {},
|
|
426
|
-
plain: {
|
|
427
|
-
intervalDays: {
|
|
428
|
-
locale: {
|
|
428
|
+
plain: {},
|
|
429
|
+
intervalDays: {},
|
|
430
|
+
locale: {}
|
|
429
431
|
},
|
|
430
432
|
emits: [
|
|
431
433
|
"update:modelValue",
|
|
@@ -434,53 +436,43 @@ var _hoisted_1$1 = { class: "_cppay-content" }, _hoisted_2$1 = {
|
|
|
434
436
|
"failed",
|
|
435
437
|
"error"
|
|
436
438
|
],
|
|
437
|
-
setup(e, { emit:
|
|
438
|
-
let
|
|
439
|
-
watch(() =>
|
|
440
|
-
e
|
|
441
|
-
_();
|
|
442
|
-
}, 1e3);
|
|
443
|
-
}), watch(() => n.modelValue, (e) => {
|
|
444
|
-
e || (s.value = "select", u.value = void 0, c.value = !1, l.value = !1);
|
|
439
|
+
setup(e, { emit: i }) {
|
|
440
|
+
let a = e, s = i, c = computed(() => getLocaleMessages(a.locale)), u = ref("select"), d = computed(() => u.value !== "checking");
|
|
441
|
+
watch(() => a.modelValue, (e) => {
|
|
442
|
+
e || (u.value = "select");
|
|
445
443
|
});
|
|
446
|
-
let
|
|
447
|
-
s.value = e;
|
|
448
|
-
}, p = (e) => {
|
|
449
|
-
c.value = e;
|
|
450
|
-
}, m = (e) => {
|
|
451
|
-
l.value = e;
|
|
452
|
-
}, g = (e) => {
|
|
444
|
+
let f = (e) => {
|
|
453
445
|
u.value = e;
|
|
454
446
|
};
|
|
455
447
|
onMounted(() => {
|
|
456
448
|
let e = (e) => {
|
|
457
|
-
e.key === "Escape" &&
|
|
449
|
+
e.key === "Escape" && a.modelValue && !d.value && p();
|
|
458
450
|
};
|
|
459
451
|
return window.addEventListener("keydown", e), () => {
|
|
460
452
|
window.removeEventListener("keydown", e);
|
|
461
453
|
};
|
|
462
454
|
});
|
|
463
|
-
let
|
|
464
|
-
|
|
465
|
-
},
|
|
466
|
-
switch (
|
|
467
|
-
case "success": return
|
|
468
|
-
case "expired": return
|
|
469
|
-
case "failed": return
|
|
470
|
-
case "error": return
|
|
471
|
-
case "payment": return
|
|
472
|
-
default: return
|
|
455
|
+
let p = () => {
|
|
456
|
+
d.value && s("update:modelValue", !1);
|
|
457
|
+
}, m = () => {
|
|
458
|
+
switch (u.value) {
|
|
459
|
+
case "success": return c.value.paymentResult;
|
|
460
|
+
case "expired": return c.value.paymentExpired;
|
|
461
|
+
case "failed": return c.value.paymentFailed;
|
|
462
|
+
case "error": return c.value.error;
|
|
463
|
+
case "payment": return c.value.completePayment;
|
|
464
|
+
default: return c.value.selectPaymentMethod;
|
|
473
465
|
}
|
|
474
466
|
};
|
|
475
|
-
return (
|
|
467
|
+
return (i, a) => e.modelValue ? (openBlock(), createElementBlock("div", {
|
|
476
468
|
key: 0,
|
|
477
469
|
class: "_cppay-overlay",
|
|
478
|
-
onClick:
|
|
479
|
-
}, [createElementVNode("div", _hoisted_1, [createElementVNode("div", _hoisted_2, [createElementVNode("h2", _hoisted_3, toDisplayString(
|
|
480
|
-
onClick:
|
|
481
|
-
disabled:
|
|
470
|
+
onClick: a[4] ||= (e) => e.target === e.currentTarget && p()
|
|
471
|
+
}, [createElementVNode("div", _hoisted_1, [createElementVNode("div", _hoisted_2, [createElementVNode("h2", _hoisted_3, toDisplayString(m()), 1), createElementVNode("button", {
|
|
472
|
+
onClick: p,
|
|
473
|
+
disabled: !d.value,
|
|
482
474
|
class: "_cppay-close-btn"
|
|
483
|
-
}, [...
|
|
475
|
+
}, [...a[5] ||= [createElementVNode("svg", {
|
|
484
476
|
fill: "none",
|
|
485
477
|
stroke: "currentColor",
|
|
486
478
|
viewBox: "0 0 24 24"
|
|
@@ -489,24 +481,22 @@ var _hoisted_1$1 = { class: "_cppay-content" }, _hoisted_2$1 = {
|
|
|
489
481
|
"stroke-linejoin": "round",
|
|
490
482
|
"stroke-width": "2",
|
|
491
483
|
d: "M6 18L18 6M6 6l12 12"
|
|
492
|
-
})], -1)]], 8, _hoisted_4)]),
|
|
484
|
+
})], -1)]], 8, _hoisted_4)]), e.modelValue ? (openBlock(), createBlock(PaymentContent_default, {
|
|
485
|
+
key: 0,
|
|
493
486
|
apikey: e.apikey,
|
|
494
487
|
orderId: e.orderId,
|
|
495
488
|
amount: e.amount,
|
|
496
489
|
plain: e.plain,
|
|
497
490
|
intervalDays: e.intervalDays,
|
|
498
491
|
locale: e.locale,
|
|
499
|
-
"onUpdate:paymentStep":
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
onExpired: n[1] ||= (e) => i("expired", e),
|
|
505
|
-
onFailed: n[2] ||= (e) => i("failed", e),
|
|
506
|
-
onError: n[3] ||= (e) => i("error", e)
|
|
492
|
+
"onUpdate:paymentStep": f,
|
|
493
|
+
onSuccess: a[0] ||= (e) => s("success", e),
|
|
494
|
+
onExpired: a[1] ||= (e) => s("expired", e),
|
|
495
|
+
onFailed: a[2] ||= (e) => s("failed", e),
|
|
496
|
+
onError: a[3] ||= (e) => s("error", e)
|
|
507
497
|
}, {
|
|
508
|
-
"choose-top": withCtx(() => [renderSlot(
|
|
509
|
-
"choose-bottom": withCtx(() => [renderSlot(
|
|
498
|
+
"choose-top": withCtx(() => [renderSlot(i.$slots, "choose-top")]),
|
|
499
|
+
"choose-bottom": withCtx(() => [renderSlot(i.$slots, "choose-bottom")]),
|
|
510
500
|
_: 3
|
|
511
501
|
}, 8, [
|
|
512
502
|
"apikey",
|
|
@@ -515,7 +505,7 @@ var _hoisted_1$1 = { class: "_cppay-content" }, _hoisted_2$1 = {
|
|
|
515
505
|
"plain",
|
|
516
506
|
"intervalDays",
|
|
517
507
|
"locale"
|
|
518
|
-
])])])) : createCommentVNode("", !0);
|
|
508
|
+
])) : createCommentVNode("", !0)])])) : createCommentVNode("", !0);
|
|
519
509
|
}
|
|
520
510
|
}), cppayState = ref({
|
|
521
511
|
apikey: "",
|
|
@@ -540,13 +530,13 @@ var handleClose = () => {
|
|
|
540
530
|
}, handleError = (e) => {
|
|
541
531
|
cppayState.value.options?.onError?.(e);
|
|
542
532
|
};
|
|
543
|
-
const CppayPlugin = { install(e,
|
|
544
|
-
if (!
|
|
545
|
-
cppayState.value.apikey =
|
|
546
|
-
let
|
|
533
|
+
const CppayPlugin = { install(e, i) {
|
|
534
|
+
if (!i?.apikey) throw Error("Cppay plugin requires an apikey");
|
|
535
|
+
cppayState.value.apikey = i.apikey, e.config.globalProperties.$showPayment = showPayment, e.config.globalProperties.$closePayment = closePayment;
|
|
536
|
+
let a = (e) => {
|
|
547
537
|
e.key === "Escape" && cppayState.value.open && handleClose();
|
|
548
|
-
},
|
|
549
|
-
document.body.appendChild(
|
|
538
|
+
}, o = document.createElement("div");
|
|
539
|
+
document.body.appendChild(o), createApp({ setup() {
|
|
550
540
|
return () => cppayState.value.options ? h(PaymentDialog_default, {
|
|
551
541
|
modelValue: cppayState.value.open,
|
|
552
542
|
"onUpdate:modelValue": (e) => {
|
|
@@ -562,8 +552,8 @@ const CppayPlugin = { install(e, t) {
|
|
|
562
552
|
onFailed: handleFailed,
|
|
563
553
|
onError: handleError
|
|
564
554
|
}) : null;
|
|
565
|
-
} }).mount(
|
|
566
|
-
cppayState.value.open ? document.addEventListener("keydown",
|
|
555
|
+
} }).mount(o), cppayState.value.open && document.addEventListener("keydown", a), e.config.globalProperties.$watchEffect?.(() => {
|
|
556
|
+
cppayState.value.open ? document.addEventListener("keydown", a) : document.removeEventListener("keydown", a);
|
|
567
557
|
});
|
|
568
558
|
} }, useCppayPayment = () => {
|
|
569
559
|
if (!cppayState.value.apikey) throw Error("useCppayPayment must be used after installing CppayPlugin");
|