mainstack-payments 2.1.10 → 2.2.11

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.
@@ -1,9 +1,9 @@
1
1
  import { jsxs as i, jsx as a } from "react/jsx-runtime";
2
- import { u as z, a as H, v as M, b as N, c as B, E as R, C as $ } from "./index-B9lq_YSV.js";
3
- import { toast as w, BodyText as j, ChevronRightIcon as k } from "mainstack-design-system";
4
- import { u as V } from "./payments-B3Hm80pK.js";
5
- import { memo as Z, useState as D, useCallback as L } from "react";
6
- const T = (s) => /* @__PURE__ */ i(
2
+ import { u as H, a as M, v as N, b as B, c as R, E as $, C as j } from "./index-o_oVnQSk.js";
3
+ import { toast as w, BodyText as k, ChevronRightIcon as V } from "mainstack-design-system";
4
+ import { u as Z } from "./payments-B3Hm80pK.js";
5
+ import { memo as D, useState as T, useCallback as L } from "react";
6
+ const W = (s) => /* @__PURE__ */ i(
7
7
  "svg",
8
8
  {
9
9
  viewBox: "0 0 32 32",
@@ -32,7 +32,7 @@ const T = (s) => /* @__PURE__ */ i(
32
32
  /* @__PURE__ */ a("defs", { children: /* @__PURE__ */ a("clipPath", { id: "clip0_3703_1664", children: /* @__PURE__ */ a("rect", { width: "32", height: "32", rx: "16", fill: "white" }) }) })
33
33
  ]
34
34
  }
35
- ), W = Z(
35
+ ), q = D(
36
36
  ({
37
37
  ProductRequest: s,
38
38
  PaymentRequest: v,
@@ -43,16 +43,17 @@ const T = (s) => /* @__PURE__ */ i(
43
43
  redirectUrl: n,
44
44
  checkForErrors: p,
45
45
  feesResponse: C,
46
- ip: I
46
+ ip: I,
47
+ businessId: _
47
48
  }) => {
48
- const o = V(), { mutate: h, isLoading: _ } = z(s), { mutate: u, isLoading: A } = H(v), [b, m] = D(!1), f = _ || A || b, y = L(async () => {
49
- const P = M(), g = {
49
+ const o = Z(), { mutate: h, isLoading: A } = H(s), { mutate: u, isLoading: b } = M(v), [E, m] = T(!1), f = A || b || E, y = L(async () => {
50
+ const P = N(), g = {
50
51
  ...c,
51
52
  reference: P
52
53
  };
53
54
  try {
54
55
  const t = await h(
55
- N({
56
+ B({
56
57
  metadata: g,
57
58
  amount: x,
58
59
  totalAmount: d,
@@ -66,13 +67,14 @@ const T = (s) => /* @__PURE__ */ i(
66
67
  }
67
68
  );
68
69
  let r = null;
69
- if (C && (r = B({
70
+ if (C && (r = R({
70
71
  initResponse: t,
71
72
  feesResponse: C,
72
73
  metadata: g,
73
74
  currency: l,
74
75
  ip: I,
75
- paymentMethod: R.CASHAPP
76
+ paymentMethod: $.CASHAPP,
77
+ businessId: _
76
78
  })), !r) {
77
79
  w.error({
78
80
  title: "",
@@ -80,7 +82,7 @@ const T = (s) => /* @__PURE__ */ i(
80
82
  });
81
83
  return;
82
84
  }
83
- const { client_secret: S } = await u(
85
+ const { client_secret: z } = await u(
84
86
  r,
85
87
  {
86
88
  onSuccess: () => {
@@ -94,7 +96,7 @@ const T = (s) => /* @__PURE__ */ i(
94
96
  m(!0);
95
97
  const { error: e } = await o.confirmPayment({
96
98
  // @ts-ignore
97
- clientSecret: S,
99
+ clientSecret: z,
98
100
  confirmParams: {
99
101
  payment_method_data: {
100
102
  // @ts-ignore
@@ -123,27 +125,27 @@ const T = (s) => /* @__PURE__ */ i(
123
125
  c,
124
126
  n,
125
127
  m
126
- ]), E = L(async () => {
128
+ ]), S = L(async () => {
127
129
  await p() || y();
128
130
  }, [p, y]);
129
131
  return /* @__PURE__ */ a(
130
- $,
132
+ j,
131
133
  {
132
- onClick: E,
134
+ onClick: S,
133
135
  disabled: f,
134
136
  isLoading: f,
135
137
  children: /* @__PURE__ */ i("div", { className: "mpl:flex mpl:justify-between mpl:w-full mpl:items-center", children: [
136
138
  /* @__PURE__ */ i("div", { className: "mpl:flex mpl:items-center mpl:gap-12", children: [
137
- /* @__PURE__ */ a(T, { className: "mpl:size-32" }),
138
- /* @__PURE__ */ a(j, { size: "extrasmall", weight: "medium", children: "Cash App Pay" })
139
+ /* @__PURE__ */ a(W, { className: "mpl:size-32" }),
140
+ /* @__PURE__ */ a(k, { size: "extrasmall", weight: "medium", children: "Cash App Pay" })
139
141
  ] }),
140
- /* @__PURE__ */ a(k, { className: "mpl:size-20" })
142
+ /* @__PURE__ */ a(V, { className: "mpl:size-20" })
141
143
  ] })
142
144
  }
143
145
  );
144
146
  }
145
147
  );
146
- W.displayName = "CashAppPayment";
148
+ q.displayName = "CashAppPayment";
147
149
  export {
148
- W as default
150
+ q as default
149
151
  };
@@ -1,9 +1,9 @@
1
1
  import { jsxs as r, jsx as t } from "react/jsx-runtime";
2
- import { u as S, a as z, C as M, v as N, b as $, c as j, E as B } from "./index-B9lq_YSV.js";
3
- import { BodyText as R, ChevronRightIcon as T, toast as h } from "mainstack-design-system";
4
- import { u as Z } from "./payments-B3Hm80pK.js";
5
- import { useState as k } from "react";
6
- const O = (a) => /* @__PURE__ */ r(
2
+ import { u as z, a as M, C as N, v as $, b as j, c as B, E as R } from "./index-o_oVnQSk.js";
3
+ import { BodyText as T, ChevronRightIcon as Z, toast as h } from "mainstack-design-system";
4
+ import { u as k } from "./payments-B3Hm80pK.js";
5
+ import { useState as O } from "react";
6
+ const W = (a) => /* @__PURE__ */ r(
7
7
  "svg",
8
8
  {
9
9
  viewBox: "0 0 32 32",
@@ -21,7 +21,7 @@ const O = (a) => /* @__PURE__ */ r(
21
21
  /* @__PURE__ */ t("defs", { children: /* @__PURE__ */ t("clipPath", { id: "clip0_2605_970", children: /* @__PURE__ */ t("rect", { width: "32", height: "32", fill: "white" }) }) })
22
22
  ]
23
23
  }
24
- ), F = ({
24
+ ), G = ({
25
25
  ProductRequest: a,
26
26
  PaymentRequest: u,
27
27
  metadata: C,
@@ -31,16 +31,17 @@ const O = (a) => /* @__PURE__ */ r(
31
31
  redirectUrl: i,
32
32
  checkForErrors: P,
33
33
  feesResponse: l,
34
- ip: L
34
+ ip: L,
35
+ businessId: w
35
36
  }) => {
36
- const c = Z(), { mutate: w, isLoading: x } = S(a), { mutate: I, isLoading: v } = z(u), [_, m] = k(!1), d = x || v || _, E = async () => {
37
- const p = N(), y = {
37
+ const c = k(), { mutate: x, isLoading: I } = z(a), { mutate: v, isLoading: _ } = M(u), [E, m] = O(!1), d = I || _ || E, b = async () => {
38
+ const p = $(), y = {
38
39
  ...C,
39
40
  reference: p
40
41
  };
41
42
  try {
42
- const e = await w(
43
- $({
43
+ const e = await x(
44
+ j({
44
45
  metadata: y,
45
46
  amount: f,
46
47
  totalAmount: g,
@@ -54,13 +55,14 @@ const O = (a) => /* @__PURE__ */ r(
54
55
  }
55
56
  );
56
57
  let s = null;
57
- if (l && (s = j({
58
+ if (l && (s = B({
58
59
  initResponse: e,
59
60
  feesResponse: l,
60
61
  metadata: y,
61
62
  currency: o,
62
63
  ip: L,
63
- paymentMethod: B.CRYPTO
64
+ paymentMethod: R.CRYPTO,
65
+ businessId: w
64
66
  })), !s) {
65
67
  h.error({
66
68
  title: "",
@@ -68,7 +70,7 @@ const O = (a) => /* @__PURE__ */ r(
68
70
  });
69
71
  return;
70
72
  }
71
- const { client_secret: b } = await I(
73
+ const { client_secret: S } = await v(
72
74
  s,
73
75
  {
74
76
  onSuccess: () => {
@@ -82,7 +84,7 @@ const O = (a) => /* @__PURE__ */ r(
82
84
  m(!0);
83
85
  const { error: n } = await c.confirmPayment({
84
86
  // @ts-ignore
85
- clientSecret: b,
87
+ clientSecret: S,
86
88
  confirmParams: {
87
89
  payment_method_data: {
88
90
  // @ts-ignore
@@ -102,24 +104,24 @@ const O = (a) => /* @__PURE__ */ r(
102
104
  }
103
105
  };
104
106
  return /* @__PURE__ */ t(
105
- M,
107
+ N,
106
108
  {
107
109
  onClick: async () => {
108
- await P() || E();
110
+ await P() || b();
109
111
  },
110
112
  disabled: d,
111
113
  isLoading: d,
112
114
  children: /* @__PURE__ */ r("div", { className: "mpl:flex mpl:justify-between mpl:w-full mpl:items-center", children: [
113
115
  /* @__PURE__ */ r("div", { className: "mpl:flex mpl:items-center mpl:gap-12", children: [
114
- /* @__PURE__ */ t(O, { className: "mpl:size-32" }),
115
- /* @__PURE__ */ t(R, { size: "extrasmall", weight: "medium", children: "Stablecoins & Crypto" })
116
+ /* @__PURE__ */ t(W, { className: "mpl:size-32" }),
117
+ /* @__PURE__ */ t(T, { size: "extrasmall", weight: "medium", children: "Stablecoins & Crypto" })
116
118
  ] }),
117
- /* @__PURE__ */ t(T, { className: "mpl:size-20" }),
119
+ /* @__PURE__ */ t(Z, { className: "mpl:size-20" }),
118
120
  " "
119
121
  ] })
120
122
  }
121
123
  );
122
124
  };
123
125
  export {
124
- F as default
126
+ G as default
125
127
  };