mainstack-payments 2.0.0 → 2.0.2
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/build/{CashAppPayment-Bwn9ekfb.js → CashAppPayment-ByktxjXA.js} +23 -23
- package/build/{CryptoPayments-DaMt1G8B.js → CryptoPayments-BkqcfMtz.js} +11 -11
- package/build/{index-B_V2025J.js → index-BWm87vgg.js} +1315 -1292
- package/build/index.css +1 -0
- package/build/mainstack-payments.js +1 -1
- package/build/{payments-B3Hm80pK.js → payments-CjiNVkeO.js} +143 -145
- package/build/src/index.d.ts +1 -1
- package/package.json +9 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { u as I, a as A, v as N, C as S } from "./index-
|
|
1
|
+
import { jsxs as m, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { u as I, a as A, v as N, C as S } from "./index-BWm87vgg.js";
|
|
3
3
|
import { toast as z, BodyText as B, ChevronRightIcon as E } from "mainstack-design-system";
|
|
4
|
-
import { u as H } from "./payments-
|
|
4
|
+
import { u as H } from "./payments-CjiNVkeO.js";
|
|
5
5
|
import { memo as $, useState as b, useCallback as P } from "react";
|
|
6
|
-
const j = (i) => /* @__PURE__ */
|
|
6
|
+
const j = (i) => /* @__PURE__ */ m(
|
|
7
7
|
"svg",
|
|
8
8
|
{
|
|
9
9
|
viewBox: "0 0 32 32",
|
|
@@ -11,7 +11,7 @@ const j = (i) => /* @__PURE__ */ c(
|
|
|
11
11
|
xmlns: "http://www.w3.org/2000/svg",
|
|
12
12
|
...i,
|
|
13
13
|
children: [
|
|
14
|
-
/* @__PURE__ */
|
|
14
|
+
/* @__PURE__ */ m("g", { clipPath: "url(#clip0_3703_1664)", children: [
|
|
15
15
|
/* @__PURE__ */ a(
|
|
16
16
|
"path",
|
|
17
17
|
{
|
|
@@ -36,12 +36,12 @@ const j = (i) => /* @__PURE__ */ c(
|
|
|
36
36
|
({
|
|
37
37
|
Request: i,
|
|
38
38
|
metadata: C,
|
|
39
|
-
amount:
|
|
40
|
-
currency:
|
|
39
|
+
amount: c,
|
|
40
|
+
currency: o,
|
|
41
41
|
redirectUrl: l,
|
|
42
42
|
checkForErrors: h
|
|
43
43
|
}) => {
|
|
44
|
-
const
|
|
44
|
+
const p = H(), { mutate: r, isLoading: L } = I(i), { mutate: f, isLoading: _ } = A(i), [v, d] = b(!1), u = L || _ || v, y = P(async () => {
|
|
45
45
|
var w;
|
|
46
46
|
const n = N(), g = {
|
|
47
47
|
...C,
|
|
@@ -50,9 +50,9 @@ const j = (i) => /* @__PURE__ */ c(
|
|
|
50
50
|
try {
|
|
51
51
|
await r(
|
|
52
52
|
{
|
|
53
|
-
amount:
|
|
53
|
+
amount: c,
|
|
54
54
|
reference: n,
|
|
55
|
-
currency:
|
|
55
|
+
currency: o,
|
|
56
56
|
metadata: g,
|
|
57
57
|
is_cashapp_payment: !0
|
|
58
58
|
},
|
|
@@ -67,8 +67,8 @@ const j = (i) => /* @__PURE__ */ c(
|
|
|
67
67
|
);
|
|
68
68
|
const { client_secret: t } = await f(
|
|
69
69
|
{
|
|
70
|
-
amount:
|
|
71
|
-
currency:
|
|
70
|
+
amount: c,
|
|
71
|
+
currency: o,
|
|
72
72
|
metadata: g,
|
|
73
73
|
is_cashapp_payment: !0
|
|
74
74
|
},
|
|
@@ -81,9 +81,9 @@ const j = (i) => /* @__PURE__ */ c(
|
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
);
|
|
84
|
-
if (
|
|
85
|
-
|
|
86
|
-
const { error: e } = await
|
|
84
|
+
if (p) {
|
|
85
|
+
d(!0);
|
|
86
|
+
const { error: e } = await p.confirmPayment({
|
|
87
87
|
clientSecret: t,
|
|
88
88
|
confirmParams: {
|
|
89
89
|
payment_method_data: {
|
|
@@ -99,20 +99,20 @@ const j = (i) => /* @__PURE__ */ c(
|
|
|
99
99
|
);
|
|
100
100
|
}
|
|
101
101
|
} catch (t) {
|
|
102
|
-
|
|
102
|
+
d(!1), console.error(t), z.error({
|
|
103
103
|
title: "",
|
|
104
104
|
description: ((w = t == null ? void 0 : t.raw) == null ? void 0 : w.message) ?? (t == null ? void 0 : t.message) ?? t ?? "We couldn't complete your payment"
|
|
105
105
|
});
|
|
106
106
|
}
|
|
107
107
|
}, [
|
|
108
|
-
|
|
108
|
+
p,
|
|
109
109
|
r,
|
|
110
110
|
f,
|
|
111
|
+
c,
|
|
111
112
|
o,
|
|
112
|
-
m,
|
|
113
113
|
C,
|
|
114
114
|
l,
|
|
115
|
-
|
|
115
|
+
d
|
|
116
116
|
]), x = P(async () => {
|
|
117
117
|
await h() || y();
|
|
118
118
|
}, [h, y]);
|
|
@@ -122,12 +122,12 @@ const j = (i) => /* @__PURE__ */ c(
|
|
|
122
122
|
onClick: x,
|
|
123
123
|
disabled: u,
|
|
124
124
|
isLoading: u,
|
|
125
|
-
children: /* @__PURE__ */
|
|
126
|
-
/* @__PURE__ */
|
|
127
|
-
/* @__PURE__ */ a(j, { className: "size-32" }),
|
|
125
|
+
children: /* @__PURE__ */ m("div", { className: "mpl:flex mpl:justify-between mpl:w-full mpl:items-center", children: [
|
|
126
|
+
/* @__PURE__ */ m("div", { className: "mpl:flex mpl:items-center mpl:gap-12", children: [
|
|
127
|
+
/* @__PURE__ */ a(j, { className: "mpl:size-32" }),
|
|
128
128
|
/* @__PURE__ */ a(B, { size: "extrasmall", weight: "medium", children: "Cash App Pay" })
|
|
129
129
|
] }),
|
|
130
|
-
/* @__PURE__ */ a(E, { className: "size-20" })
|
|
130
|
+
/* @__PURE__ */ a(E, { className: "mpl:size-20" })
|
|
131
131
|
] })
|
|
132
132
|
}
|
|
133
133
|
);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { u as x, a as v, C as I, v as S } from "./index-
|
|
1
|
+
import { jsxs as l, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { u as x, a as v, C as I, v as S } from "./index-BWm87vgg.js";
|
|
3
3
|
import { BodyText as E, ChevronRightIcon as z, toast as N } from "mainstack-design-system";
|
|
4
|
-
import { u as $ } from "./payments-
|
|
4
|
+
import { u as $ } from "./payments-CjiNVkeO.js";
|
|
5
5
|
import { useState as b } from "react";
|
|
6
|
-
const j = (i) => /* @__PURE__ */
|
|
6
|
+
const j = (i) => /* @__PURE__ */ l(
|
|
7
7
|
"svg",
|
|
8
8
|
{
|
|
9
9
|
viewBox: "0 0 32 32",
|
|
@@ -24,7 +24,7 @@ const j = (i) => /* @__PURE__ */ c(
|
|
|
24
24
|
), W = ({
|
|
25
25
|
Request: i,
|
|
26
26
|
metadata: C,
|
|
27
|
-
amount:
|
|
27
|
+
amount: c,
|
|
28
28
|
currency: m,
|
|
29
29
|
redirectUrl: o,
|
|
30
30
|
checkForErrors: f
|
|
@@ -38,7 +38,7 @@ const j = (i) => /* @__PURE__ */ c(
|
|
|
38
38
|
try {
|
|
39
39
|
await u(
|
|
40
40
|
{
|
|
41
|
-
amount:
|
|
41
|
+
amount: c,
|
|
42
42
|
reference: n,
|
|
43
43
|
currency: m,
|
|
44
44
|
metadata: h,
|
|
@@ -55,7 +55,7 @@ const j = (i) => /* @__PURE__ */ c(
|
|
|
55
55
|
);
|
|
56
56
|
const { client_secret: e } = await w(
|
|
57
57
|
{
|
|
58
|
-
amount:
|
|
58
|
+
amount: c,
|
|
59
59
|
currency: m,
|
|
60
60
|
metadata: h,
|
|
61
61
|
is_crypto_payment: !0
|
|
@@ -99,12 +99,12 @@ const j = (i) => /* @__PURE__ */ c(
|
|
|
99
99
|
},
|
|
100
100
|
disabled: p,
|
|
101
101
|
isLoading: p,
|
|
102
|
-
children: /* @__PURE__ */
|
|
103
|
-
/* @__PURE__ */
|
|
104
|
-
/* @__PURE__ */ a(j, { className: "size-32" }),
|
|
102
|
+
children: /* @__PURE__ */ l("div", { className: "mpl:flex mpl:justify-between mpl:w-full mpl:items-center", children: [
|
|
103
|
+
/* @__PURE__ */ l("div", { className: "mpl:flex mpl:items-center mpl:gap-12", children: [
|
|
104
|
+
/* @__PURE__ */ a(j, { className: "mpl:size-32" }),
|
|
105
105
|
/* @__PURE__ */ a(E, { size: "extrasmall", weight: "medium", children: "Stablecoins & Crypto" })
|
|
106
106
|
] }),
|
|
107
|
-
/* @__PURE__ */ a(z, { className: "size-20" }),
|
|
107
|
+
/* @__PURE__ */ a(z, { className: "mpl:size-20" }),
|
|
108
108
|
" "
|
|
109
109
|
] })
|
|
110
110
|
}
|