@blocklet/payment-react 1.13.113

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.
Files changed (173) hide show
  1. package/LICENSE +13 -0
  2. package/README.md +29 -0
  3. package/babel.config.es.js +8 -0
  4. package/build.config.ts +29 -0
  5. package/es/api.d.ts +2 -0
  6. package/es/api.js +18 -0
  7. package/es/checkout/index.d.ts +15 -0
  8. package/es/checkout/index.js +61 -0
  9. package/es/components/input.d.ts +23 -0
  10. package/es/components/input.js +44 -0
  11. package/es/components/livemode.d.ts +2 -0
  12. package/es/components/livemode.js +24 -0
  13. package/es/components/pricing-table.d.ts +18 -0
  14. package/es/components/pricing-table.js +175 -0
  15. package/es/components/status.d.ts +3 -0
  16. package/es/components/status.js +20 -0
  17. package/es/components/switch.d.ts +6 -0
  18. package/es/components/switch.js +42 -0
  19. package/es/contexts/payment.d.ts +29 -0
  20. package/es/contexts/payment.js +45 -0
  21. package/es/dayjs.d.ts +2 -0
  22. package/es/dayjs.js +14 -0
  23. package/es/index.d.ts +16 -0
  24. package/es/index.js +29 -0
  25. package/es/locales/en.d.ts +2 -0
  26. package/es/locales/en.js +213 -0
  27. package/es/locales/index.d.ts +10 -0
  28. package/es/locales/index.js +20 -0
  29. package/es/locales/zh.d.ts +2 -0
  30. package/es/locales/zh.js +213 -0
  31. package/es/payment/amount.d.ts +12 -0
  32. package/es/payment/amount.js +22 -0
  33. package/es/payment/error.d.ts +13 -0
  34. package/es/payment/error.js +12 -0
  35. package/es/payment/footer.d.ts +4 -0
  36. package/es/payment/footer.js +9 -0
  37. package/es/payment/form/addon.d.ts +2 -0
  38. package/es/payment/form/addon.js +14 -0
  39. package/es/payment/form/address.d.ts +7 -0
  40. package/es/payment/form/address.js +119 -0
  41. package/es/payment/form/index.d.ts +9 -0
  42. package/es/payment/form/index.js +337 -0
  43. package/es/payment/form/phone.d.ts +4 -0
  44. package/es/payment/form/phone.js +97 -0
  45. package/es/payment/form/stripe.d.ts +13 -0
  46. package/es/payment/form/stripe.js +158 -0
  47. package/es/payment/header.d.ts +7 -0
  48. package/es/payment/header.js +29 -0
  49. package/es/payment/index.d.ts +28 -0
  50. package/es/payment/index.js +327 -0
  51. package/es/payment/product-card.d.ts +21 -0
  52. package/es/payment/product-card.js +34 -0
  53. package/es/payment/product-item.d.ts +19 -0
  54. package/es/payment/product-item.js +107 -0
  55. package/es/payment/product-skeleton.d.ts +4 -0
  56. package/es/payment/product-skeleton.js +34 -0
  57. package/es/payment/skeleton/overview.d.ts +2 -0
  58. package/es/payment/skeleton/overview.js +13 -0
  59. package/es/payment/skeleton/payment.d.ts +2 -0
  60. package/es/payment/skeleton/payment.js +19 -0
  61. package/es/payment/success.d.ts +8 -0
  62. package/es/payment/success.js +164 -0
  63. package/es/payment/summary.d.ts +12 -0
  64. package/es/payment/summary.js +178 -0
  65. package/es/theme.d.ts +1 -0
  66. package/es/theme.js +17 -0
  67. package/es/types/index.d.ts +19 -0
  68. package/es/types/index.js +0 -0
  69. package/es/types/shims.d.ts +18 -0
  70. package/es/util.d.ts +52 -0
  71. package/es/util.js +390 -0
  72. package/lib/api.d.ts +2 -0
  73. package/lib/api.js +26 -0
  74. package/lib/checkout/index.d.ts +15 -0
  75. package/lib/checkout/index.js +83 -0
  76. package/lib/components/input.d.ts +23 -0
  77. package/lib/components/input.js +72 -0
  78. package/lib/components/livemode.d.ts +2 -0
  79. package/lib/components/livemode.js +29 -0
  80. package/lib/components/pricing-table.d.ts +18 -0
  81. package/lib/components/pricing-table.js +232 -0
  82. package/lib/components/status.d.ts +3 -0
  83. package/lib/components/status.js +23 -0
  84. package/lib/components/switch.d.ts +6 -0
  85. package/lib/components/switch.js +51 -0
  86. package/lib/contexts/payment.d.ts +29 -0
  87. package/lib/contexts/payment.js +73 -0
  88. package/lib/dayjs.d.ts +2 -0
  89. package/lib/dayjs.js +21 -0
  90. package/lib/index.d.ts +16 -0
  91. package/lib/index.js +143 -0
  92. package/lib/locales/en.d.ts +2 -0
  93. package/lib/locales/en.js +220 -0
  94. package/lib/locales/index.d.ts +10 -0
  95. package/lib/locales/index.js +33 -0
  96. package/lib/locales/zh.d.ts +2 -0
  97. package/lib/locales/zh.js +220 -0
  98. package/lib/payment/amount.d.ts +12 -0
  99. package/lib/payment/amount.js +28 -0
  100. package/lib/payment/error.d.ts +13 -0
  101. package/lib/payment/error.js +52 -0
  102. package/lib/payment/footer.d.ts +4 -0
  103. package/lib/payment/footer.js +25 -0
  104. package/lib/payment/form/addon.d.ts +2 -0
  105. package/lib/payment/form/addon.js +37 -0
  106. package/lib/payment/form/address.d.ts +7 -0
  107. package/lib/payment/form/address.js +152 -0
  108. package/lib/payment/form/index.d.ts +9 -0
  109. package/lib/payment/form/index.js +464 -0
  110. package/lib/payment/form/phone.d.ts +4 -0
  111. package/lib/payment/form/phone.js +133 -0
  112. package/lib/payment/form/stripe.d.ts +13 -0
  113. package/lib/payment/form/stripe.js +213 -0
  114. package/lib/payment/header.d.ts +7 -0
  115. package/lib/payment/header.js +58 -0
  116. package/lib/payment/index.d.ts +28 -0
  117. package/lib/payment/index.js +382 -0
  118. package/lib/payment/product-card.d.ts +21 -0
  119. package/lib/payment/product-card.js +81 -0
  120. package/lib/payment/product-item.d.ts +19 -0
  121. package/lib/payment/product-item.js +160 -0
  122. package/lib/payment/product-skeleton.d.ts +4 -0
  123. package/lib/payment/product-skeleton.js +71 -0
  124. package/lib/payment/skeleton/overview.d.ts +2 -0
  125. package/lib/payment/skeleton/overview.js +48 -0
  126. package/lib/payment/skeleton/payment.d.ts +2 -0
  127. package/lib/payment/skeleton/payment.js +54 -0
  128. package/lib/payment/success.d.ts +8 -0
  129. package/lib/payment/success.js +215 -0
  130. package/lib/payment/summary.d.ts +12 -0
  131. package/lib/payment/summary.js +225 -0
  132. package/lib/theme.d.ts +1 -0
  133. package/lib/theme.js +19 -0
  134. package/lib/types/index.d.ts +19 -0
  135. package/lib/types/index.js +1 -0
  136. package/lib/types/shims.d.ts +18 -0
  137. package/lib/util.d.ts +52 -0
  138. package/lib/util.js +487 -0
  139. package/package.json +104 -0
  140. package/src/api.ts +24 -0
  141. package/src/checkout/index.tsx +74 -0
  142. package/src/components/input.tsx +58 -0
  143. package/src/components/livemode.tsx +23 -0
  144. package/src/components/pricing-table.tsx +207 -0
  145. package/src/components/status.tsx +19 -0
  146. package/src/components/switch.tsx +48 -0
  147. package/src/contexts/payment.tsx +74 -0
  148. package/src/dayjs.ts +17 -0
  149. package/src/index.ts +32 -0
  150. package/src/locales/en.tsx +218 -0
  151. package/src/locales/index.tsx +30 -0
  152. package/src/locales/zh.tsx +214 -0
  153. package/src/payment/amount.tsx +24 -0
  154. package/src/payment/error.tsx +29 -0
  155. package/src/payment/footer.tsx +12 -0
  156. package/src/payment/form/addon.tsx +24 -0
  157. package/src/payment/form/address.tsx +119 -0
  158. package/src/payment/form/index.tsx +401 -0
  159. package/src/payment/form/phone.tsx +103 -0
  160. package/src/payment/form/stripe.tsx +195 -0
  161. package/src/payment/header.tsx +40 -0
  162. package/src/payment/index.tsx +367 -0
  163. package/src/payment/product-card.tsx +55 -0
  164. package/src/payment/product-item.tsx +121 -0
  165. package/src/payment/product-skeleton.tsx +39 -0
  166. package/src/payment/skeleton/overview.tsx +21 -0
  167. package/src/payment/skeleton/payment.tsx +35 -0
  168. package/src/payment/success.tsx +186 -0
  169. package/src/payment/summary.tsx +198 -0
  170. package/src/theme.ts +18 -0
  171. package/src/types/index.ts +29 -0
  172. package/src/types/shims.d.ts +18 -0
  173. package/src/util.ts +543 -0
@@ -0,0 +1,133 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ module.exports = PhoneInput;
7
+ var _jsxRuntime = require("react/jsx-runtime");
8
+ var _material = require("@mui/material");
9
+ var _omit = _interopRequireDefault(require("lodash/omit"));
10
+ var _react = require("react");
11
+ var _reactHookForm = require("react-hook-form");
12
+ var _reactInternationalPhone = require("react-international-phone");
13
+ var _input = _interopRequireDefault(require("../../components/input"));
14
+ var _util = require("../../util");
15
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16
+ function PhoneInput({
17
+ ...props
18
+ }) {
19
+ const countryFieldName = props.countryFieldName || "billing_address.country";
20
+ const {
21
+ control,
22
+ getValues,
23
+ setValue
24
+ } = (0, _reactHookForm.useFormContext)();
25
+ const values = getValues();
26
+ const {
27
+ phone,
28
+ handlePhoneValueChange,
29
+ inputRef,
30
+ country,
31
+ setCountry
32
+ } = (0, _reactInternationalPhone.usePhoneInput)({
33
+ defaultCountry: (0, _util.isValidCountry)(values[countryFieldName]) ? values[countryFieldName] : "us",
34
+ value: values[props.name] || "",
35
+ countries: _reactInternationalPhone.defaultCountries,
36
+ onChange: data => {
37
+ setValue(props.name, data.phone);
38
+ }
39
+ });
40
+ const userCountry = (0, _reactHookForm.useWatch)({
41
+ control,
42
+ name: countryFieldName
43
+ });
44
+ (0, _react.useEffect)(() => {
45
+ if (userCountry !== country) {
46
+ setCountry(userCountry);
47
+ }
48
+ }, [userCountry]);
49
+ const onCountryChange = e => {
50
+ setCountry(e.target.value);
51
+ setValue(countryFieldName, e.target.value);
52
+ };
53
+ return (
54
+ // @ts-ignore
55
+ /* @__PURE__ */
56
+ (0, _jsxRuntime.jsx)(_input.default, {
57
+ value: phone,
58
+ onChange: handlePhoneValueChange,
59
+ type: "tel",
60
+ inputRef,
61
+ InputProps: {
62
+ startAdornment: /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.InputAdornment, {
63
+ position: "start",
64
+ style: {
65
+ marginRight: "2px",
66
+ marginLeft: "-8px"
67
+ },
68
+ children: /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Select, {
69
+ MenuProps: {
70
+ style: {
71
+ height: "300px",
72
+ width: "360px",
73
+ top: "10px",
74
+ left: "-34px"
75
+ },
76
+ transformOrigin: {
77
+ vertical: "top",
78
+ horizontal: "left"
79
+ }
80
+ },
81
+ sx: {
82
+ width: "max-content",
83
+ // Remove default outline (display only on focus)
84
+ fieldset: {
85
+ display: "none"
86
+ },
87
+ '&.Mui-focused:has(div[aria-expanded="false"])': {
88
+ fieldset: {
89
+ display: "block"
90
+ }
91
+ },
92
+ // Update default spacing
93
+ ".MuiSelect-select": {
94
+ padding: "8px",
95
+ paddingRight: "24px !important"
96
+ },
97
+ svg: {
98
+ right: 0
99
+ }
100
+ },
101
+ value: country,
102
+ onChange: onCountryChange,
103
+ renderValue: code => /* @__PURE__ */(0, _jsxRuntime.jsx)(_reactInternationalPhone.FlagEmoji, {
104
+ iso2: code,
105
+ style: {
106
+ display: "flex"
107
+ }
108
+ }),
109
+ children: _reactInternationalPhone.defaultCountries.map(c => {
110
+ const parsed = (0, _reactInternationalPhone.parseCountry)(c);
111
+ return /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.MenuItem, {
112
+ value: parsed.iso2,
113
+ children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_reactInternationalPhone.FlagEmoji, {
114
+ iso2: parsed.iso2,
115
+ style: {
116
+ marginRight: "8px"
117
+ }
118
+ }), /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
119
+ marginRight: "8px",
120
+ children: parsed.name
121
+ }), /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Typography, {
122
+ color: "gray",
123
+ children: ["+", parsed.dialCode]
124
+ })]
125
+ }, parsed.iso2);
126
+ })
127
+ })
128
+ })
129
+ },
130
+ ...(0, _omit.default)(props, ["countryFieldName"])
131
+ })
132
+ );
133
+ }
@@ -0,0 +1,13 @@
1
+ /// <reference types="react" />
2
+ import type { TCustomer } from '@blocklet/payment-types';
3
+ type StripeCheckoutProps = {
4
+ clientSecret: string;
5
+ intentType: string;
6
+ publicKey: string;
7
+ mode: string;
8
+ customer: TCustomer;
9
+ onConfirm: Function;
10
+ onCancel: Function;
11
+ };
12
+ export default function StripeCheckout({ clientSecret, intentType, publicKey, mode, customer, onConfirm, onCancel, }: StripeCheckoutProps): import("react").JSX.Element;
13
+ export {};
@@ -0,0 +1,213 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ module.exports = StripeCheckout;
7
+ var _jsxRuntime = require("react/jsx-runtime");
8
+ var _Center = _interopRequireDefault(require("@arcblock/ux/lib/Center"));
9
+ var _Dialog = _interopRequireDefault(require("@arcblock/ux/lib/Dialog"));
10
+ var _context = require("@arcblock/ux/lib/Locale/context");
11
+ var _lab = require("@mui/lab");
12
+ var _material = require("@mui/material");
13
+ var _system = require("@mui/system");
14
+ var _reactStripeJs = require("@stripe/react-stripe-js");
15
+ var _stripeJs = require("@stripe/stripe-js");
16
+ var _ahooks = require("ahooks");
17
+ var _react = require("react");
18
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
+ function StripeCheckoutForm({
20
+ clientSecret,
21
+ intentType,
22
+ customer,
23
+ mode,
24
+ onConfirm
25
+ }) {
26
+ const stripe = (0, _reactStripeJs.useStripe)();
27
+ const elements = (0, _reactStripeJs.useElements)();
28
+ const {
29
+ t
30
+ } = (0, _context.useLocaleContext)();
31
+ const [state, setState] = (0, _ahooks.useSetState)({
32
+ message: "",
33
+ confirming: false,
34
+ loaded: false
35
+ });
36
+ (0, _react.useEffect)(() => {
37
+ if (!stripe) {
38
+ return;
39
+ }
40
+ if (!clientSecret) {
41
+ return;
42
+ }
43
+ const method = intentType === "payment_intent" ? "retrievePaymentIntent" : "retrieveSetupIntent";
44
+ stripe[method](clientSecret).then(({
45
+ paymentIntent,
46
+ setupIntent
47
+ }) => {
48
+ const intent = paymentIntent || setupIntent;
49
+ switch (intent?.status) {
50
+ case "succeeded":
51
+ setState({
52
+ message: t("paymentCredit.preparePayMessage.succeeded")
53
+ });
54
+ break;
55
+ case "processing":
56
+ setState({
57
+ message: t("paymentCredit.preparePayMessage.processing")
58
+ });
59
+ break;
60
+ case "requires_payment_method":
61
+ default:
62
+ break;
63
+ }
64
+ });
65
+ }, [stripe, clientSecret]);
66
+ const handleSubmit = async e => {
67
+ e.preventDefault();
68
+ if (!stripe || !elements) {
69
+ return;
70
+ }
71
+ try {
72
+ setState({
73
+ confirming: true
74
+ });
75
+ const method = intentType === "payment_intent" ? "confirmPayment" : "confirmSetup";
76
+ const {
77
+ error
78
+ } = await stripe[method]({
79
+ elements,
80
+ redirect: "if_required",
81
+ confirmParams: {
82
+ payment_method_data: {
83
+ billing_details: {
84
+ name: customer.name,
85
+ phone: customer.phone,
86
+ email: customer.email,
87
+ address: customer.address
88
+ }
89
+ }
90
+ }
91
+ });
92
+ setState({
93
+ confirming: false
94
+ });
95
+ if (error) {
96
+ if (error.type === "validation_error") {
97
+ return;
98
+ }
99
+ setState({
100
+ message: error.message
101
+ });
102
+ return;
103
+ }
104
+ onConfirm();
105
+ } catch (err) {
106
+ console.error(err);
107
+ setState({
108
+ confirming: false,
109
+ message: err.message
110
+ });
111
+ }
112
+ };
113
+ return /* @__PURE__ */(0, _jsxRuntime.jsxs)(Content, {
114
+ onSubmit: handleSubmit,
115
+ children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_reactStripeJs.PaymentElement, {
116
+ options: {
117
+ layout: "auto",
118
+ fields: {
119
+ billingDetails: "never"
120
+ },
121
+ readOnly: state.confirming
122
+ },
123
+ onReady: () => setState({
124
+ loaded: true
125
+ })
126
+ }), (!stripe || !elements || !state.loaded) && /* @__PURE__ */(0, _jsxRuntime.jsx)(_Center.default, {
127
+ relative: "parent",
128
+ children: /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.CircularProgress, {})
129
+ }), stripe && elements && state.loaded && /* @__PURE__ */(0, _jsxRuntime.jsx)(_lab.LoadingButton, {
130
+ fullWidth: true,
131
+ sx: {
132
+ mt: 2,
133
+ mb: 1,
134
+ borderRadius: 0,
135
+ fontSize: "1.1rem"
136
+ },
137
+ type: "submit",
138
+ disabled: state.confirming || !state.loaded,
139
+ loading: state.confirming,
140
+ loadingPosition: "end",
141
+ variant: "contained",
142
+ color: "primary",
143
+ size: "large",
144
+ children: t("payment.checkout.continue", {
145
+ action: mode
146
+ })
147
+ }), state.message && /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
148
+ sx: {
149
+ mt: 1,
150
+ color: "error.main"
151
+ },
152
+ children: state.message
153
+ })]
154
+ });
155
+ }
156
+ const Content = (0, _system.styled)("form")`
157
+ display: flex;
158
+ flex-direction: column;
159
+ justify-content: center;
160
+ align-items: center;
161
+ width: 100%;
162
+ height: 100%;
163
+ min-height: 320px;
164
+ `;
165
+ function StripeCheckout({
166
+ clientSecret,
167
+ intentType,
168
+ publicKey,
169
+ mode,
170
+ customer,
171
+ onConfirm,
172
+ onCancel
173
+ }) {
174
+ const stripePromise = (0, _stripeJs.loadStripe)(publicKey);
175
+ const {
176
+ t
177
+ } = (0, _context.useLocaleContext)();
178
+ const [state, setState] = (0, _ahooks.useSetState)({
179
+ open: true,
180
+ closable: true
181
+ });
182
+ const handleClose = (_, reason) => {
183
+ if (reason === "backdropClick") {
184
+ return;
185
+ }
186
+ setState({
187
+ open: false
188
+ });
189
+ onCancel();
190
+ };
191
+ return /* @__PURE__ */(0, _jsxRuntime.jsx)(_Dialog.default, {
192
+ title: t("payment.checkout.cardPay", {
193
+ action: t(`payment.checkout.${mode}`)
194
+ }),
195
+ showCloseButton: state.closable,
196
+ open: state.open,
197
+ onClose: handleClose,
198
+ disableEscapeKeyDown: true,
199
+ children: /* @__PURE__ */(0, _jsxRuntime.jsx)(_reactStripeJs.Elements, {
200
+ options: {
201
+ clientSecret
202
+ },
203
+ stripe: stripePromise,
204
+ children: /* @__PURE__ */(0, _jsxRuntime.jsx)(StripeCheckoutForm, {
205
+ clientSecret,
206
+ intentType,
207
+ mode,
208
+ customer,
209
+ onConfirm
210
+ })
211
+ })
212
+ });
213
+ }
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ import type { TCheckoutSessionExpanded } from '@blocklet/payment-types';
3
+ type Props = {
4
+ checkoutSession: TCheckoutSessionExpanded;
5
+ };
6
+ export default function PaymentHeader({ checkoutSession }: Props): import("react").JSX.Element;
7
+ export {};
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ module.exports = PaymentHeader;
7
+ var _jsxRuntime = require("react/jsx-runtime");
8
+ var _Theme = require("@arcblock/ux/lib/Theme");
9
+ var _material = require("@mui/material");
10
+ var _ahooks = require("ahooks");
11
+ var _livemode = _interopRequireDefault(require("../components/livemode"));
12
+ var _util = require("../util");
13
+ var _addon = _interopRequireDefault(require("./form/addon"));
14
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
+ function PaymentHeader({
16
+ checkoutSession
17
+ }) {
18
+ const [livemode] = (0, _ahooks.useLocalStorageState)("livemode", {
19
+ defaultValue: true
20
+ });
21
+ const brand = (0, _util.getStatementDescriptor)(checkoutSession.line_items);
22
+ const theme = (0, _Theme.useTheme)();
23
+ const domSize = (0, _ahooks.useSize)(document.body);
24
+ const isColumnLayout = (0, _ahooks.useCreation)(() => {
25
+ if (domSize) {
26
+ if (domSize?.width <= theme.breakpoints.values.md) {
27
+ return true;
28
+ }
29
+ }
30
+ return false;
31
+ }, [domSize, theme]);
32
+ return /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Stack, {
33
+ className: "cko-header",
34
+ direction: "row",
35
+ spacing: 1,
36
+ alignItems: "center",
37
+ justifyContent: "space-between",
38
+ children: [/* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Stack, {
39
+ direction: "row",
40
+ spacing: 1,
41
+ alignItems: "center",
42
+ children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Avatar, {
43
+ variant: "square",
44
+ src: window.blocklet.appLogo,
45
+ sx: {
46
+ width: 32,
47
+ height: 32
48
+ }
49
+ }), /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
50
+ sx: {
51
+ color: "text.primary",
52
+ fontWeight: 600
53
+ },
54
+ children: brand
55
+ }), !livemode && /* @__PURE__ */(0, _jsxRuntime.jsx)(_livemode.default, {})]
56
+ }), isColumnLayout ? /* @__PURE__ */(0, _jsxRuntime.jsx)(_addon.default, {}) : null]
57
+ });
58
+ }
@@ -0,0 +1,28 @@
1
+ /// <reference types="react" />
2
+ import { CheckoutCallbacks, CheckoutContext } from '../types';
3
+ type Props = CheckoutContext & CheckoutCallbacks & {
4
+ completed?: boolean;
5
+ error?: any;
6
+ };
7
+ declare function Payment({ checkoutSession, paymentMethods, paymentIntent, paymentLink, customer, completed, error, mode, onPaid, onError, }: Props): import("react").JSX.Element;
8
+ declare namespace Payment {
9
+ var defaultProps: {
10
+ completed: boolean;
11
+ error: null;
12
+ };
13
+ }
14
+ export default Payment;
15
+ type MainProps = CheckoutContext & CheckoutCallbacks & {
16
+ completed?: boolean;
17
+ };
18
+ export declare function PaymentInner({ checkoutSession, paymentMethods, paymentLink, paymentIntent, customer, completed, mode, onPaid, onError, }: MainProps): import("react").JSX.Element;
19
+ export declare namespace PaymentInner {
20
+ var defaultProps: {
21
+ completed: boolean;
22
+ };
23
+ }
24
+ export declare const Root: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
25
+ ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
26
+ }, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/system").Theme> & {
27
+ mode: string;
28
+ }, {}, {}>;