pay-sdk-react 1.1.6 → 1.1.8

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 (60) hide show
  1. package/dist/css/index.css +3 -1
  2. package/dist/css/index.min.css +1 -1
  3. package/dist/es/Airwallex/airwallex-button.d.ts +2 -2
  4. package/dist/es/Airwallex/airwallex-button.js +46 -11
  5. package/dist/es/Airwallex/interface.d.ts +32 -1
  6. package/dist/es/Airwallex/style/index.css +3 -1
  7. package/dist/es/Airwallex/style/index.min.css +1 -1
  8. package/dist/es/Alipay/alipay-button.d.ts +2 -2
  9. package/dist/es/Alipay/alipay-button.js +23 -10
  10. package/dist/es/Alipay/interface.d.ts +13 -2
  11. package/dist/es/MAlipay/style/index.css +3 -1
  12. package/dist/es/MAlipay/style/index.min.css +1 -1
  13. package/dist/es/MWeChat/style/index.css +3 -1
  14. package/dist/es/MWeChat/style/index.min.css +1 -1
  15. package/dist/es/PayButton/index.d.ts +2 -2
  16. package/dist/es/PayButton/index.js +10 -8
  17. package/dist/es/PayButton/interface.d.ts +5 -19
  18. package/dist/es/PayButton/interface.js +1 -93
  19. package/dist/es/Paypal/interface.d.ts +17 -11
  20. package/dist/es/Paypal/paypal-button.d.ts +2 -2
  21. package/dist/es/Paypal/paypal-button.js +35 -97
  22. package/dist/es/Payssion/interface.d.ts +12 -1
  23. package/dist/es/Payssion/payssion-button.d.ts +2 -2
  24. package/dist/es/Payssion/payssion-button.js +17 -4
  25. package/dist/es/Stripe/interface.d.ts +22 -1
  26. package/dist/es/Stripe/stripe-button.d.ts +2 -2
  27. package/dist/es/Stripe/stripe-button.js +42 -12
  28. package/dist/es/Stripe/style/index.css +3 -1
  29. package/dist/es/Stripe/style/index.min.css +1 -1
  30. package/dist/es/Wechat/interface.d.ts +13 -2
  31. package/dist/es/Wechat/wechat-button.d.ts +2 -2
  32. package/dist/es/Wechat/wechat-button.js +23 -10
  33. package/dist/es/confirm-modal/style/index.css +3 -1
  34. package/dist/es/confirm-modal/style/index.min.css +1 -1
  35. package/dist/es/index.d.ts +1 -1
  36. package/dist/es/pay-modal/style/index.css +3 -1
  37. package/dist/es/pay-modal/style/index.min.css +1 -1
  38. package/dist/lib/Airwallex/airwallex-button.js +47 -12
  39. package/dist/lib/Airwallex/style/index.css +3 -1
  40. package/dist/lib/Airwallex/style/index.min.css +1 -1
  41. package/dist/lib/Alipay/alipay-button.js +23 -10
  42. package/dist/lib/MAlipay/style/index.css +3 -1
  43. package/dist/lib/MAlipay/style/index.min.css +1 -1
  44. package/dist/lib/MWeChat/style/index.css +3 -1
  45. package/dist/lib/MWeChat/style/index.min.css +1 -1
  46. package/dist/lib/PayButton/index.js +10 -8
  47. package/dist/lib/PayButton/interface.js +3 -1
  48. package/dist/lib/Paypal/paypal-button.js +23 -63
  49. package/dist/lib/Payssion/payssion-button.js +17 -4
  50. package/dist/lib/Stripe/stripe-button.js +43 -13
  51. package/dist/lib/Stripe/style/index.css +3 -1
  52. package/dist/lib/Stripe/style/index.min.css +1 -1
  53. package/dist/lib/Wechat/wechat-button.js +23 -10
  54. package/dist/lib/confirm-modal/style/index.css +3 -1
  55. package/dist/lib/confirm-modal/style/index.min.css +1 -1
  56. package/dist/lib/pay-modal/style/index.css +3 -1
  57. package/dist/lib/pay-modal/style/index.min.css +1 -1
  58. package/dist/umd/pay-sdk-react.umd.js +149 -88
  59. package/dist/umd/pay-sdk-react.umd.js.map +1 -1
  60. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- var _excluded = ["className", "children", "onClick", "paypalUrl", "createOrder", "maskProps", "checkPaymentStatus", "onPaymentSuccess", "closeWindowOnUnmount"],
1
+ var _excluded = ["className", "children", "onClick", "paypalUrl", "createOrder", "maskProps", "isPayment", "closeWindowOnUnmount"],
2
2
  _excluded2 = ["onClose"];
3
3
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
4
4
  function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i.return) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
@@ -27,17 +27,14 @@ var PaypalButton = /*#__PURE__*/forwardRef(function (props, ref) {
27
27
  propsPaypalUrl = props.paypalUrl,
28
28
  createOrder = props.createOrder,
29
29
  maskProps = props.maskProps,
30
- checkPaymentStatus = props.checkPaymentStatus,
31
- onPaymentSuccess = props.onPaymentSuccess,
30
+ isPayment = props.isPayment,
32
31
  _props$closeWindowOnU = props.closeWindowOnUnmount,
33
32
  closeWindowOnUnmount = _props$closeWindowOnU === void 0 ? true : _props$closeWindowOnU,
34
33
  others = _objectWithoutProperties(props, _excluded);
35
34
  var _ref = maskProps || {},
36
35
  onMaskClose = _ref.onClose,
37
36
  restMaskProps = _objectWithoutProperties(_ref, _excluded2);
38
- var paypalButtonRef = useRef({
39
- nativeElement: null
40
- });
37
+ var paypalButtonRef = useRef(null);
41
38
  var _useState = useState(false),
42
39
  _useState2 = _slicedToArray(_useState, 2),
43
40
  showMask = _useState2[0],
@@ -46,106 +43,55 @@ var PaypalButton = /*#__PURE__*/forwardRef(function (props, ref) {
46
43
  _useState4 = _slicedToArray(_useState3, 2),
47
44
  paypalUrl = _useState4[0],
48
45
  setPaypalUrl = _useState4[1];
49
- var pollingTimerRef = useRef(null);
50
- useImperativeHandle(ref, function () {
51
- return paypalButtonRef.current;
52
- });
53
-
54
- // 支付状态轮询
55
- var startPaymentPolling = useCallback(function () {
56
- if (!checkPaymentStatus) return;
57
46
 
58
- // 先清除之前的定时器
59
- if (pollingTimerRef.current) {
60
- clearTimeout(pollingTimerRef.current);
61
- pollingTimerRef.current = null;
62
- }
63
- var _poll = /*#__PURE__*/function () {
64
- var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
65
- var isSuccess, _t;
66
- return _regenerator().w(function (_context) {
67
- while (1) switch (_context.n) {
68
- case 0:
69
- _context.p = 0;
70
- _context.n = 1;
71
- return checkPaymentStatus();
72
- case 1:
73
- isSuccess = _context.v;
74
- if (!isSuccess) {
75
- _context.n = 2;
76
- break;
77
- }
78
- setShowMask(false);
79
- onPaymentSuccess === null || onPaymentSuccess === void 0 || onPaymentSuccess();
80
- if (pollingTimerRef.current) {
81
- clearTimeout(pollingTimerRef.current);
82
- pollingTimerRef.current = null;
83
- }
84
- return _context.a(2);
85
- case 2:
86
- // 继续轮询
87
- if (pollingTimerRef.current) {
88
- clearTimeout(pollingTimerRef.current);
89
- }
90
- pollingTimerRef.current = setTimeout(_poll, 3000);
91
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
92
- _context.n = 4;
93
- break;
94
- case 3:
95
- _context.p = 3;
96
- _t = _context.v;
97
- // 出错时继续轮询
98
- if (pollingTimerRef.current) {
99
- clearTimeout(pollingTimerRef.current);
100
- }
101
- pollingTimerRef.current = setTimeout(_poll, 3000);
102
- case 4:
103
- return _context.a(2);
104
- }
105
- }, _callee, null, [[0, 3]]);
106
- }));
107
- return function poll() {
108
- return _ref2.apply(this, arguments);
109
- };
110
- }();
111
- _poll();
112
- }, [checkPaymentStatus, onPaymentSuccess]);
113
-
114
- // 停止轮询
115
- var stopPaymentPolling = useCallback(function () {
116
- if (pollingTimerRef.current) {
117
- clearTimeout(pollingTimerRef.current);
118
- pollingTimerRef.current = null;
47
+ // 监听 isPayment 状态变化,当支付完成时隐藏蒙层
48
+ useEffect(function () {
49
+ if (createOrder && isPayment) {
50
+ setShowMask(false);
119
51
  }
120
- }, []);
121
- var handlePayCreateOrder = useCallback(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {
52
+ }, [createOrder, isPayment]);
53
+ useImperativeHandle(ref, function () {
54
+ return {
55
+ get nativeElement() {
56
+ var _paypalButtonRef$curr;
57
+ return ((_paypalButtonRef$curr = paypalButtonRef.current) === null || _paypalButtonRef$curr === void 0 ? void 0 : _paypalButtonRef$curr.nativeElement) || null;
58
+ },
59
+ openPayment: function openPayment(options) {
60
+ if (options) {
61
+ setPaypalUrl(options.paypalUrl);
62
+ setShowMask(true);
63
+ }
64
+ },
65
+ closePayment: function closePayment() {
66
+ setShowMask(false);
67
+ },
68
+ current: paypalButtonRef.current
69
+ };
70
+ });
71
+ var handlePayCreateOrder = useCallback(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
122
72
  var _yield$createOrder, _paypalUrl;
123
- return _regenerator().w(function (_context2) {
124
- while (1) switch (_context2.n) {
73
+ return _regenerator().w(function (_context) {
74
+ while (1) switch (_context.n) {
125
75
  case 0:
126
76
  if (!createOrder) {
127
- _context2.n = 2;
77
+ _context.n = 2;
128
78
  break;
129
79
  }
130
- _context2.n = 1;
80
+ _context.n = 1;
131
81
  return createOrder();
132
82
  case 1:
133
- _yield$createOrder = _context2.v;
83
+ _yield$createOrder = _context.v;
134
84
  _paypalUrl = _yield$createOrder.paypalUrl;
135
85
  if (_paypalUrl) {
136
86
  // 2. 唤起蒙层
137
87
  setShowMask(true);
138
88
  setPaypalUrl(_paypalUrl);
139
- // 3. 开始轮询支付状态
140
- if (checkPaymentStatus) {
141
- startPaymentPolling();
142
- }
143
89
  }
144
90
  case 2:
145
- return _context2.a(2);
91
+ return _context.a(2);
146
92
  }
147
- }, _callee2);
148
- })), [createOrder, checkPaymentStatus, startPaymentPolling]);
93
+ }, _callee);
94
+ })), [createOrder]);
149
95
  var handleOpen = useCallback(function () {
150
96
  if (propsPaypalUrl) {
151
97
  setShowMask(true);
@@ -160,13 +106,6 @@ var PaypalButton = /*#__PURE__*/forwardRef(function (props, ref) {
160
106
  }
161
107
  onClick === null || onClick === void 0 || onClick(e);
162
108
  }, [onClick, createOrder, handlePayCreateOrder, handleOpen]);
163
-
164
- // 组件卸载时清理轮询
165
- useEffect(function () {
166
- return function () {
167
- stopPaymentPolling();
168
- };
169
- }, [stopPaymentPolling]);
170
109
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, _extends({
171
110
  ref: paypalButtonRef,
172
111
  className: cs(getPrefixCls('paypal-btn'), className),
@@ -175,7 +114,6 @@ var PaypalButton = /*#__PURE__*/forwardRef(function (props, ref) {
175
114
  visible: showMask,
176
115
  onClose: function onClose() {
177
116
  setShowMask(false);
178
- stopPaymentPolling();
179
117
  onMaskClose === null || onMaskClose === void 0 || onMaskClose();
180
118
  },
181
119
  payUrl: paypalUrl,
@@ -23,7 +23,18 @@ export interface PayssionButtonProps extends ButtonProps {
23
23
  */
24
24
  createOrder?: CreateOrderPayssionFn;
25
25
  }
26
- export type PayssionButtonRef = ButtonRef;
26
+ export interface PayssionButtonRef extends ButtonRef {
27
+ /**
28
+ * @zh 打开支付页面
29
+ * @en Open payment page
30
+ */
31
+ openPayment: (options?: PayssionSecretMap) => void;
32
+ /**
33
+ * @zh 关闭支付页面
34
+ * @en Close payment page
35
+ */
36
+ closePayment: () => void;
37
+ }
27
38
  export interface PayssionSecretMap {
28
39
  /**
29
40
  * @zh Payssion 支付页面链接
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- import { PayssionButtonProps } from './interface';
2
+ import { PayssionButtonProps, PayssionButtonRef } from './interface';
3
3
  declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<PayssionButtonProps & {
4
4
  children?: React.ReactNode;
5
- } & React.RefAttributes<import("../Button").ButtonRef>>>;
5
+ } & React.RefAttributes<PayssionButtonRef>>>;
6
6
  export default _default;
@@ -31,9 +31,7 @@ var PayssionButton = /*#__PURE__*/forwardRef(function (props, ref) {
31
31
  var _ref = maskProps || {},
32
32
  _onClose = _ref.onClose,
33
33
  restMaskProps = _objectWithoutProperties(_ref, _excluded2);
34
- var payssionButtonRef = useRef({
35
- nativeElement: null
36
- });
34
+ var payssionButtonRef = useRef(null);
37
35
  var _useState = useState(false),
38
36
  _useState2 = _slicedToArray(_useState, 2),
39
37
  showMask = _useState2[0],
@@ -43,7 +41,22 @@ var PayssionButton = /*#__PURE__*/forwardRef(function (props, ref) {
43
41
  payssionUrl = _useState4[0],
44
42
  setPayssionUrl = _useState4[1];
45
43
  useImperativeHandle(ref, function () {
46
- return payssionButtonRef.current;
44
+ return {
45
+ get nativeElement() {
46
+ var _payssionButtonRef$cu;
47
+ return ((_payssionButtonRef$cu = payssionButtonRef.current) === null || _payssionButtonRef$cu === void 0 ? void 0 : _payssionButtonRef$cu.nativeElement) || null;
48
+ },
49
+ openPayment: function openPayment(options) {
50
+ if (options) {
51
+ setPayssionUrl(options.payssionUrl);
52
+ setShowMask(true);
53
+ }
54
+ },
55
+ closePayment: function closePayment() {
56
+ setShowMask(false);
57
+ },
58
+ current: payssionButtonRef.current
59
+ };
47
60
  });
48
61
  var handlePayCreateOrder = useCallback(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
49
62
  var _yield$createOrder, _payssionUrl;
@@ -80,7 +80,28 @@ export interface StripeButtonProps extends ButtonProps {
80
80
  */
81
81
  createOrder?: CreateOrderStripeFn;
82
82
  }
83
- export type StripeButtonRef = ButtonRef;
83
+ export interface StripeButtonRef extends ButtonRef {
84
+ /**
85
+ * @zh 打开弹窗
86
+ * @en Open the popup
87
+ */
88
+ openModal: (options?: BasesStripeProps) => void;
89
+ /**
90
+ * @zh 关闭弹窗
91
+ * @en Close the popup
92
+ */
93
+ closeModal: () => void;
94
+ /**
95
+ * @zh 打开弹窗
96
+ * @en Open the popup
97
+ */
98
+ openPopup: (options?: BasesStripeProps) => void;
99
+ /**
100
+ * @zh 关闭弹窗
101
+ * @en Close the popup
102
+ */
103
+ closePopup: () => void;
104
+ }
84
105
  export interface StripeModalProps extends PayModalProps {
85
106
  /**
86
107
  * @zh Stripe 属性
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- import { StripeButtonProps } from './interface';
2
+ import { StripeButtonProps, StripeButtonRef } from './interface';
3
3
  declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<StripeButtonProps & {
4
4
  children?: React.ReactNode;
5
- } & React.RefAttributes<import("../Button").ButtonRef>>>;
5
+ } & React.RefAttributes<StripeButtonRef>>>;
6
6
  export default _default;
@@ -20,16 +20,36 @@ var StripeButton = /*#__PURE__*/forwardRef(function (props, ref) {
20
20
  stripeModalProps = props.stripeModalProps,
21
21
  createOrder = props.createOrder,
22
22
  others = _objectWithoutProperties(props, _excluded);
23
- var stripeButtonRef = useRef({
24
- nativeElement: null
25
- });
23
+ var stripeButtonRef = useRef(null);
26
24
  var stripePopupRef = useRef(null);
27
25
  var stripeModalRef = useRef(null);
28
26
  useImperativeHandle(ref, function () {
29
- return stripeButtonRef.current;
27
+ return {
28
+ get nativeElement() {
29
+ var _stripeButtonRef$curr;
30
+ return ((_stripeButtonRef$curr = stripeButtonRef.current) === null || _stripeButtonRef$curr === void 0 ? void 0 : _stripeButtonRef$curr.nativeElement) || null;
31
+ },
32
+ openPopup: function openPopup(options) {
33
+ var _stripePopupRef$curre;
34
+ (_stripePopupRef$curre = stripePopupRef.current) === null || _stripePopupRef$curre === void 0 || _stripePopupRef$curre.open(options);
35
+ },
36
+ closePopup: function closePopup() {
37
+ var _stripePopupRef$curre2;
38
+ (_stripePopupRef$curre2 = stripePopupRef.current) === null || _stripePopupRef$curre2 === void 0 || _stripePopupRef$curre2.close();
39
+ },
40
+ openModal: function openModal(options) {
41
+ var _stripeModalRef$curre;
42
+ (_stripeModalRef$curre = stripeModalRef.current) === null || _stripeModalRef$curre === void 0 || _stripeModalRef$curre.open(options);
43
+ },
44
+ closeModal: function closeModal() {
45
+ var _stripeModalRef$curre2;
46
+ (_stripeModalRef$curre2 = stripeModalRef.current) === null || _stripeModalRef$curre2 === void 0 || _stripeModalRef$curre2.close();
47
+ },
48
+ current: stripeButtonRef.current
49
+ };
30
50
  });
31
51
  var handlePayCreateOrder = useCallback(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
32
- var options, _stripeModalRef$curre, _stripePopupRef$curre;
52
+ var options, _stripeModalRef$curre3, _stripePopupRef$curre3;
33
53
  return _regenerator().w(function (_context) {
34
54
  while (1) switch (_context.n) {
35
55
  case 0:
@@ -44,9 +64,9 @@ var StripeButton = /*#__PURE__*/forwardRef(function (props, ref) {
44
64
  if (options !== null && options !== void 0 && options.clientSecret && options !== null && options !== void 0 && options.stripeKey) {
45
65
  // 2. 唤起弹窗
46
66
  if (displayType === 'modal') {
47
- (_stripeModalRef$curre = stripeModalRef.current) === null || _stripeModalRef$curre === void 0 || _stripeModalRef$curre.open(options);
67
+ (_stripeModalRef$curre3 = stripeModalRef.current) === null || _stripeModalRef$curre3 === void 0 || _stripeModalRef$curre3.open(options);
48
68
  } else {
49
- (_stripePopupRef$curre = stripePopupRef.current) === null || _stripePopupRef$curre === void 0 || _stripePopupRef$curre.open(options);
69
+ (_stripePopupRef$curre3 = stripePopupRef.current) === null || _stripePopupRef$curre3 === void 0 || _stripePopupRef$curre3.open(options);
50
70
  }
51
71
  }
52
72
  case 2:
@@ -59,15 +79,25 @@ var StripeButton = /*#__PURE__*/forwardRef(function (props, ref) {
59
79
  handlePayCreateOrder();
60
80
  } else {
61
81
  if (displayType === 'modal') {
62
- var _stripeModalRef$curre2;
63
- stripeModalRef === null || stripeModalRef === void 0 || (_stripeModalRef$curre2 = stripeModalRef.current) === null || _stripeModalRef$curre2 === void 0 || _stripeModalRef$curre2.open();
82
+ var _stripeModalProps$str, _stripeModalProps$str2;
83
+ var clientSecret = stripeModalProps === null || stripeModalProps === void 0 || (_stripeModalProps$str = stripeModalProps.stripeProps) === null || _stripeModalProps$str === void 0 ? void 0 : _stripeModalProps$str.clientSecret;
84
+ var stripeKey = stripeModalProps === null || stripeModalProps === void 0 || (_stripeModalProps$str2 = stripeModalProps.stripeProps) === null || _stripeModalProps$str2 === void 0 ? void 0 : _stripeModalProps$str2.stripeKey;
85
+ if (clientSecret && stripeKey) {
86
+ var _stripeModalRef$curre4;
87
+ stripeModalRef === null || stripeModalRef === void 0 || (_stripeModalRef$curre4 = stripeModalRef.current) === null || _stripeModalRef$curre4 === void 0 || _stripeModalRef$curre4.open();
88
+ }
64
89
  } else {
65
- var _stripePopupRef$curre2;
66
- stripePopupRef === null || stripePopupRef === void 0 || (_stripePopupRef$curre2 = stripePopupRef.current) === null || _stripePopupRef$curre2 === void 0 || _stripePopupRef$curre2.open();
90
+ var _stripePopupProps$str, _stripePopupProps$str2;
91
+ var _clientSecret = stripePopupProps === null || stripePopupProps === void 0 || (_stripePopupProps$str = stripePopupProps.stripeProps) === null || _stripePopupProps$str === void 0 ? void 0 : _stripePopupProps$str.clientSecret;
92
+ var _stripeKey = stripePopupProps === null || stripePopupProps === void 0 || (_stripePopupProps$str2 = stripePopupProps.stripeProps) === null || _stripePopupProps$str2 === void 0 ? void 0 : _stripePopupProps$str2.stripeKey;
93
+ if (_clientSecret && _stripeKey) {
94
+ var _stripePopupRef$curre4;
95
+ stripePopupRef === null || stripePopupRef === void 0 || (_stripePopupRef$curre4 = stripePopupRef.current) === null || _stripePopupRef$curre4 === void 0 || _stripePopupRef$curre4.open();
96
+ }
67
97
  }
68
98
  }
69
99
  onClick === null || onClick === void 0 || onClick(e);
70
- }, [onClick, createOrder, handlePayCreateOrder, displayType]);
100
+ }, [onClick, createOrder, handlePayCreateOrder, displayType, stripeModalProps, stripePopupProps]);
71
101
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, _extends({
72
102
  ref: stripeButtonRef,
73
103
  onClick: handleClick
@@ -133,7 +133,9 @@
133
133
  top: 12px;
134
134
  background: none;
135
135
  border: none;
136
- font-size: 28px;
136
+ font-size: 32px;
137
+ font-weight: 500;
138
+ line-height: 32px;
137
139
  cursor: pointer;
138
140
  text-align: left;
139
141
  }
@@ -1 +1 @@
1
- .pay-dot-loading{display:inline-block}.pay-button{display:inline-block;padding:7px 12px;font-size:16px;border-radius:4px;border:1px solid #eee;background:#fff;color:#333;cursor:pointer;transition:.2s;user-select:none;position:relative;text-align:center}.pay-button-content{display:flex;align-items:center;justify-content:center;gap:6px}.pay-button-block{display:block;width:100%}.pay-button-disabled{opacity:.4;cursor:not-allowed}.pay-button-loading{cursor:wait}.pay-button-loading-wrapper{display:flex;align-items:center;justify-content:center;gap:6px}.pay-button-primary{background:#1677ff;border-color:#1677ff;color:#fff}.pay-button-primary:hover{background:#409eff}.pay-button-success{background:#00b578;border-color:#00b578;color:#fff}.pay-button-danger{background:#ff3141;border-color:#ff3141;color:#fff}.pay-button-warning{background:#ff8f1f;border-color:#ff8f1f;color:#fff}.pay-button-default{background:#fff;border-color:#eee;color:#333}.pay-button-fill-outline{background:0 0;color:inherit}.pay-button-fill-none{background:0 0;border:none;color:inherit}.pay-button-mini{font-size:12px;padding:2px 8px}.pay-button-small{font-size:14px;padding:4px 10px}.pay-button-large{font-size:18px;padding:10px 18px}.pay-button-shape-rounded{border-radius:1000px}.pay-button-shape-rectangular{border-radius:0}.pay-modal{position:fixed;z-index:9999;left:0;top:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center}.pay-modal__mask{position:absolute;left:0;top:0;right:0;bottom:0;background:rgba(0,0,0,.55);z-index:0}.pay-modal__content{position:relative;z-index:1;background:#fff;border-radius:16px;padding:42px 20px 20px;min-width:280px;max-width:80vw;box-shadow:0 4px 24px #0001;text-align:center;max-height:60vh;display:flex;flex-direction:column}.pay-modal__close{position:absolute;right:12px;top:12px;background:0 0;border:none;font-size:28px;cursor:pointer;text-align:left}.pay-modal__icon{margin-bottom:8px;font-size:40px}.pay-modal__title{font-size:20px;font-weight:700;color:#222;margin-bottom:12px}.pay-modal__desc{color:#222;font-size:15px;margin-bottom:24px;line-height:1.7;text-align:left}.pay-modal__content-wrapper{position:relative;z-index:1;text-align:center;overflow-y:auto;flex:1;min-height:0}.pay-modal__actions{display:flex;justify-content:center;gap:16px;margin-top:16px}.pay-modal__btn{min-width:96px;padding:8px 0;border-radius:24px;border:none;font-size:15px;font-weight:600;cursor:pointer;transition:background .2s}.pay-modal__btn--retry{background:#fff;color:#f25a5a;border:1.5px solid #f25a5a}.pay-modal__btn--finish{background:#f25a5a;color:#fff;border:none}.pay-mask{position:fixed;z-index:1000;left:0;top:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center}.pay-icon{display:inline-block;color:inherit;width:16px;vertical-align:-2px;stroke:currentColor}.pay-icon[fill=currentColor]{fill:currentColor;stroke:none}.pay-icon[stroke=currentColor]{stroke:currentColor;fill:none}.pay-icon[fill=currentColor][stroke=currentColor]{fill:currentColor;stroke:currentColor}.pay-icon-paypal-text{width:64px;height:26px;max-width:72px;max-height:32px}.pay-icon-close{width:18px;height:18px}.pay-icon-stripe-text{width:24px;height:24px}.pay-icon-alipay{width:20px;height:20px}.pay-icon-wechat-pay{width:20px;height:20px}.pay-icon-payssion-pay{width:36px;height:20px}.pay-popup{position:fixed;z-index:1001}.pay-popup-body{position:fixed;display:flex;flex-direction:column;background-color:#fff;z-index:1010;box-sizing:border-box}.pay-popup-body.pay-popup-body-position-bottom{width:100%;left:0;bottom:0}.pay-popup-body.pay-popup-body-position-top{width:100%;left:0;top:0}.pay-popup-body.pay-popup-body-position-left{height:100%;width:80vw;left:0;top:0}.pay-popup-body.pay-popup-body-position-right{height:100%;width:80vw;right:0;top:0}.pay-popup-body.pay-popup-body-round.pay-popup-body-position-bottom{border-radius:16px 16px 0 0}.pay-popup-body.pay-popup-body-round.pay-popup-body-position-top{border-radius:0 0 16px 16px}.pay-popup-body.pay-popup-body-round.pay-popup-body-position-left{border-radius:0 16px 16px 0}.pay-popup-body.pay-popup-body-round.pay-popup-body-position-right{border-radius:16px 0 0 16px}.pay-popup-close-icon{position:absolute;z-index:1;cursor:pointer;padding:4px;font-size:18px;line-height:1;color:#999}.pay-popup-body.pay-popup-body-position-bottom .pay-popup-close-icon,.pay-popup-body.pay-popup-body-position-left .pay-popup-close-icon{top:8px;right:8px}.pay-popup-body.pay-popup-body-position-top .pay-popup-close-icon{bottom:8px;right:8px}.pay-popup-body.pay-popup-body-position-right .pay-popup-close-icon{top:8px;left:8px}.pay-popup-content{flex:1;overflow-y:auto;-webkit-overflow-scrolling:touch}.pay-popup-body.pay-popup-body-with-close.pay-popup-body-position-bottom .pay-popup-content,.pay-popup-body.pay-popup-body-with-close.pay-popup-body-position-left .pay-popup-content{padding-top:40px}.pay-popup-body.pay-popup-body-with-close.pay-popup-body-position-right .pay-popup-content{padding-top:40px}.pay-popup-body.pay-popup-body-with-close.pay-popup-body-position-top .pay-popup-content{padding-bottom:40px}@media (min-width:576px){.pay-stripe-modal.pay-modal .pay-modal__content{width:72%}}@media (min-width:768px){.pay-stripe-modal.pay-modal .pay-modal__content{width:50%}}@media (min-width:992px){.pay-stripe-modal.pay-modal .pay-modal__content{width:40%}}@media (min-width:1200px){.pay-stripe-modal.pay-modal .pay-modal__content{width:27%}}@media (min-width:1600px){.pay-stripe-modal.pay-modal .pay-modal__content{width:26%}}@media (min-width:2000px){.pay-stripe-modal.pay-modal .pay-modal__content{width:20%}}
1
+ .pay-dot-loading{display:inline-block}.pay-button{display:inline-block;padding:7px 12px;font-size:16px;border-radius:4px;border:1px solid #eee;background:#fff;color:#333;cursor:pointer;transition:.2s;user-select:none;position:relative;text-align:center}.pay-button-content{display:flex;align-items:center;justify-content:center;gap:6px}.pay-button-block{display:block;width:100%}.pay-button-disabled{opacity:.4;cursor:not-allowed}.pay-button-loading{cursor:wait}.pay-button-loading-wrapper{display:flex;align-items:center;justify-content:center;gap:6px}.pay-button-primary{background:#1677ff;border-color:#1677ff;color:#fff}.pay-button-primary:hover{background:#409eff}.pay-button-success{background:#00b578;border-color:#00b578;color:#fff}.pay-button-danger{background:#ff3141;border-color:#ff3141;color:#fff}.pay-button-warning{background:#ff8f1f;border-color:#ff8f1f;color:#fff}.pay-button-default{background:#fff;border-color:#eee;color:#333}.pay-button-fill-outline{background:0 0;color:inherit}.pay-button-fill-none{background:0 0;border:none;color:inherit}.pay-button-mini{font-size:12px;padding:2px 8px}.pay-button-small{font-size:14px;padding:4px 10px}.pay-button-large{font-size:18px;padding:10px 18px}.pay-button-shape-rounded{border-radius:1000px}.pay-button-shape-rectangular{border-radius:0}.pay-modal{position:fixed;z-index:9999;left:0;top:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center}.pay-modal__mask{position:absolute;left:0;top:0;right:0;bottom:0;background:rgba(0,0,0,.55);z-index:0}.pay-modal__content{position:relative;z-index:1;background:#fff;border-radius:16px;padding:42px 20px 20px;min-width:280px;max-width:80vw;box-shadow:0 4px 24px #0001;text-align:center;max-height:60vh;display:flex;flex-direction:column}.pay-modal__close{position:absolute;right:12px;top:12px;background:0 0;border:none;font-size:32px;font-weight:500;line-height:32px;cursor:pointer;text-align:left}.pay-modal__icon{margin-bottom:8px;font-size:40px}.pay-modal__title{font-size:20px;font-weight:700;color:#222;margin-bottom:12px}.pay-modal__desc{color:#222;font-size:15px;margin-bottom:24px;line-height:1.7;text-align:left}.pay-modal__content-wrapper{position:relative;z-index:1;text-align:center;overflow-y:auto;flex:1;min-height:0}.pay-modal__actions{display:flex;justify-content:center;gap:16px;margin-top:16px}.pay-modal__btn{min-width:96px;padding:8px 0;border-radius:24px;border:none;font-size:15px;font-weight:600;cursor:pointer;transition:background .2s}.pay-modal__btn--retry{background:#fff;color:#f25a5a;border:1.5px solid #f25a5a}.pay-modal__btn--finish{background:#f25a5a;color:#fff;border:none}.pay-mask{position:fixed;z-index:1000;left:0;top:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center}.pay-icon{display:inline-block;color:inherit;width:16px;vertical-align:-2px;stroke:currentColor}.pay-icon[fill=currentColor]{fill:currentColor;stroke:none}.pay-icon[stroke=currentColor]{stroke:currentColor;fill:none}.pay-icon[fill=currentColor][stroke=currentColor]{fill:currentColor;stroke:currentColor}.pay-icon-paypal-text{width:64px;height:26px;max-width:72px;max-height:32px}.pay-icon-close{width:18px;height:18px}.pay-icon-stripe-text{width:24px;height:24px}.pay-icon-alipay{width:20px;height:20px}.pay-icon-wechat-pay{width:20px;height:20px}.pay-icon-payssion-pay{width:36px;height:20px}.pay-popup{position:fixed;z-index:1001}.pay-popup-body{position:fixed;display:flex;flex-direction:column;background-color:#fff;z-index:1010;box-sizing:border-box}.pay-popup-body.pay-popup-body-position-bottom{width:100%;left:0;bottom:0}.pay-popup-body.pay-popup-body-position-top{width:100%;left:0;top:0}.pay-popup-body.pay-popup-body-position-left{height:100%;width:80vw;left:0;top:0}.pay-popup-body.pay-popup-body-position-right{height:100%;width:80vw;right:0;top:0}.pay-popup-body.pay-popup-body-round.pay-popup-body-position-bottom{border-radius:16px 16px 0 0}.pay-popup-body.pay-popup-body-round.pay-popup-body-position-top{border-radius:0 0 16px 16px}.pay-popup-body.pay-popup-body-round.pay-popup-body-position-left{border-radius:0 16px 16px 0}.pay-popup-body.pay-popup-body-round.pay-popup-body-position-right{border-radius:16px 0 0 16px}.pay-popup-close-icon{position:absolute;z-index:1;cursor:pointer;padding:4px;font-size:18px;line-height:1;color:#999}.pay-popup-body.pay-popup-body-position-bottom .pay-popup-close-icon,.pay-popup-body.pay-popup-body-position-left .pay-popup-close-icon{top:8px;right:8px}.pay-popup-body.pay-popup-body-position-top .pay-popup-close-icon{bottom:8px;right:8px}.pay-popup-body.pay-popup-body-position-right .pay-popup-close-icon{top:8px;left:8px}.pay-popup-content{flex:1;overflow-y:auto;-webkit-overflow-scrolling:touch}.pay-popup-body.pay-popup-body-with-close.pay-popup-body-position-bottom .pay-popup-content,.pay-popup-body.pay-popup-body-with-close.pay-popup-body-position-left .pay-popup-content{padding-top:40px}.pay-popup-body.pay-popup-body-with-close.pay-popup-body-position-right .pay-popup-content{padding-top:40px}.pay-popup-body.pay-popup-body-with-close.pay-popup-body-position-top .pay-popup-content{padding-bottom:40px}@media (min-width:576px){.pay-stripe-modal.pay-modal .pay-modal__content{width:72%}}@media (min-width:768px){.pay-stripe-modal.pay-modal .pay-modal__content{width:50%}}@media (min-width:992px){.pay-stripe-modal.pay-modal .pay-modal__content{width:40%}}@media (min-width:1200px){.pay-stripe-modal.pay-modal .pay-modal__content{width:27%}}@media (min-width:1600px){.pay-stripe-modal.pay-modal .pay-modal__content{width:26%}}@media (min-width:2000px){.pay-stripe-modal.pay-modal .pay-modal__content{width:20%}}
@@ -40,9 +40,20 @@ export interface WechatButtonProps extends ButtonProps {
40
40
  * @zh 弹窗属性
41
41
  * @en Modal props
42
42
  */
43
- modalProps?: Omit<WechatModalProps, 'visible'>;
43
+ modalProps?: WechatModalProps;
44
+ }
45
+ export interface WechatButtonRef extends ButtonRef {
46
+ /**
47
+ * @zh 打开弹窗
48
+ * @en Open the popup
49
+ */
50
+ openModal: (options?: WechatProps) => void;
51
+ /**
52
+ * @zh 关闭弹窗
53
+ * @en Close the popup
54
+ */
55
+ closeModal: () => void;
44
56
  }
45
- export type WechatButtonRef = ButtonRef;
46
57
  /**
47
58
  * @zh 创建订单函数,返回 Paypal 所需参数
48
59
  * @en Function to create order, returns Paypal required params
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- import { WechatButtonProps } from './interface';
2
+ import { WechatButtonProps, WechatButtonRef } from './interface';
3
3
  declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<WechatButtonProps & {
4
4
  children?: React.ReactNode;
5
- } & React.RefAttributes<import("../Button").ButtonRef>>>;
5
+ } & React.RefAttributes<WechatButtonRef>>>;
6
6
  export default _default;
@@ -20,15 +20,27 @@ var WechatButton = /*#__PURE__*/forwardRef(function (props, ref) {
20
20
  createOrder = props.createOrder,
21
21
  modalProps = props.modalProps,
22
22
  others = _objectWithoutProperties(props, _excluded);
23
- var wechatButtonRef = useRef({
24
- nativeElement: null
25
- });
23
+ var wechatButtonRef = useRef(null);
26
24
  var wechatModalRef = useRef(null);
27
25
  useImperativeHandle(ref, function () {
28
- return wechatButtonRef.current;
26
+ return {
27
+ get nativeElement() {
28
+ var _wechatButtonRef$curr;
29
+ return ((_wechatButtonRef$curr = wechatButtonRef.current) === null || _wechatButtonRef$curr === void 0 ? void 0 : _wechatButtonRef$curr.nativeElement) || null;
30
+ },
31
+ openModal: function openModal(options) {
32
+ var _wechatModalRef$curre;
33
+ (_wechatModalRef$curre = wechatModalRef.current) === null || _wechatModalRef$curre === void 0 || _wechatModalRef$curre.open(options);
34
+ },
35
+ closeModal: function closeModal() {
36
+ var _wechatModalRef$curre2;
37
+ (_wechatModalRef$curre2 = wechatModalRef.current) === null || _wechatModalRef$curre2 === void 0 || _wechatModalRef$curre2.close();
38
+ },
39
+ current: wechatButtonRef.current
40
+ };
29
41
  });
30
42
  var handlePayCreateOrder = useCallback(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
31
- var _wechatModalRef$curre, options;
43
+ var _wechatModalRef$curre3, options;
32
44
  return _regenerator().w(function (_context) {
33
45
  while (1) switch (_context.n) {
34
46
  case 0:
@@ -40,21 +52,22 @@ var WechatButton = /*#__PURE__*/forwardRef(function (props, ref) {
40
52
  return createOrder();
41
53
  case 1:
42
54
  options = _context.v;
43
- (_wechatModalRef$curre = wechatModalRef.current) === null || _wechatModalRef$curre === void 0 || _wechatModalRef$curre.open(options);
55
+ (_wechatModalRef$curre3 = wechatModalRef.current) === null || _wechatModalRef$curre3 === void 0 || _wechatModalRef$curre3.open(options);
44
56
  case 2:
45
57
  return _context.a(2);
46
58
  }
47
59
  }, _callee);
48
60
  })), [createOrder]);
49
61
  var handleClick = useCallback(function (e) {
62
+ var _modalProps$wechatPro;
50
63
  if (createOrder) {
51
64
  handlePayCreateOrder();
52
- } else {
53
- var _wechatModalRef$curre2;
54
- wechatModalRef === null || wechatModalRef === void 0 || (_wechatModalRef$curre2 = wechatModalRef.current) === null || _wechatModalRef$curre2 === void 0 || _wechatModalRef$curre2.open();
65
+ } else if (modalProps !== null && modalProps !== void 0 && (_modalProps$wechatPro = modalProps.wechatProps) !== null && _modalProps$wechatPro !== void 0 && _modalProps$wechatPro.wechatUrl) {
66
+ var _wechatModalRef$curre4;
67
+ wechatModalRef === null || wechatModalRef === void 0 || (_wechatModalRef$curre4 = wechatModalRef.current) === null || _wechatModalRef$curre4 === void 0 || _wechatModalRef$curre4.open();
55
68
  }
56
69
  onClick === null || onClick === void 0 || onClick(e);
57
- }, [onClick, createOrder, handlePayCreateOrder]);
70
+ }, [onClick, createOrder, handlePayCreateOrder, modalProps]);
58
71
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, _extends({
59
72
  ref: wechatButtonRef,
60
73
  className: cs(getPrefixCls('wechat-btn'), className),
@@ -38,7 +38,9 @@
38
38
  top: 12px;
39
39
  background: none;
40
40
  border: none;
41
- font-size: 28px;
41
+ font-size: 32px;
42
+ font-weight: 500;
43
+ line-height: 32px;
42
44
  cursor: pointer;
43
45
  text-align: left;
44
46
  }
@@ -1 +1 @@
1
- .pay-modal{position:fixed;z-index:9999;left:0;top:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center}.pay-modal__mask{position:absolute;left:0;top:0;right:0;bottom:0;background:rgba(0,0,0,.55);z-index:0}.pay-modal__content{position:relative;z-index:1;background:#fff;border-radius:16px;padding:42px 20px 20px;min-width:280px;max-width:80vw;box-shadow:0 4px 24px #0001;text-align:center;max-height:60vh;display:flex;flex-direction:column}.pay-modal__close{position:absolute;right:12px;top:12px;background:0 0;border:none;font-size:28px;cursor:pointer;text-align:left}.pay-modal__icon{margin-bottom:8px;font-size:40px}.pay-modal__title{font-size:20px;font-weight:700;color:#222;margin-bottom:12px}.pay-modal__desc{color:#222;font-size:15px;margin-bottom:24px;line-height:1.7;text-align:left}.pay-modal__content-wrapper{position:relative;z-index:1;text-align:center;overflow-y:auto;flex:1;min-height:0}.pay-modal__actions{display:flex;justify-content:center;gap:16px;margin-top:16px}.pay-modal__btn{min-width:96px;padding:8px 0;border-radius:24px;border:none;font-size:15px;font-weight:600;cursor:pointer;transition:background .2s}.pay-modal__btn--retry{background:#fff;color:#f25a5a;border:1.5px solid #f25a5a}.pay-modal__btn--finish{background:#f25a5a;color:#fff;border:none}
1
+ .pay-modal{position:fixed;z-index:9999;left:0;top:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center}.pay-modal__mask{position:absolute;left:0;top:0;right:0;bottom:0;background:rgba(0,0,0,.55);z-index:0}.pay-modal__content{position:relative;z-index:1;background:#fff;border-radius:16px;padding:42px 20px 20px;min-width:280px;max-width:80vw;box-shadow:0 4px 24px #0001;text-align:center;max-height:60vh;display:flex;flex-direction:column}.pay-modal__close{position:absolute;right:12px;top:12px;background:0 0;border:none;font-size:32px;font-weight:500;line-height:32px;cursor:pointer;text-align:left}.pay-modal__icon{margin-bottom:8px;font-size:40px}.pay-modal__title{font-size:20px;font-weight:700;color:#222;margin-bottom:12px}.pay-modal__desc{color:#222;font-size:15px;margin-bottom:24px;line-height:1.7;text-align:left}.pay-modal__content-wrapper{position:relative;z-index:1;text-align:center;overflow-y:auto;flex:1;min-height:0}.pay-modal__actions{display:flex;justify-content:center;gap:16px;margin-top:16px}.pay-modal__btn{min-width:96px;padding:8px 0;border-radius:24px;border:none;font-size:15px;font-weight:600;cursor:pointer;transition:background .2s}.pay-modal__btn--retry{background:#fff;color:#f25a5a;border:1.5px solid #f25a5a}.pay-modal__btn--finish{background:#f25a5a;color:#fff;border:none}
@@ -14,6 +14,6 @@ export type { AlipayProps, AlipayModalProps, AlipayButtonProps, AlipayButtonRef,
14
14
  export { default as Alipay } from './Alipay';
15
15
  export type { WechatProps, WechatModalProps, WechatButtonProps, WechatButtonRef, WechatModalRef, } from './Wechat/interface';
16
16
  export { default as Wechat } from './Wechat';
17
- export type { PayButtonProps, PayButtonRef } from './PayButton/interface';
17
+ export type { PayButtonProps, GenericPayButtonRef, } from './PayButton/interface';
18
18
  export { default as PayButton } from './PayButton';
19
19
  export * from './shared';
@@ -38,7 +38,9 @@
38
38
  top: 12px;
39
39
  background: none;
40
40
  border: none;
41
- font-size: 28px;
41
+ font-size: 32px;
42
+ font-weight: 500;
43
+ line-height: 32px;
42
44
  cursor: pointer;
43
45
  text-align: left;
44
46
  }
@@ -1 +1 @@
1
- .pay-modal{position:fixed;z-index:9999;left:0;top:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center}.pay-modal__mask{position:absolute;left:0;top:0;right:0;bottom:0;background:rgba(0,0,0,.55);z-index:0}.pay-modal__content{position:relative;z-index:1;background:#fff;border-radius:16px;padding:42px 20px 20px;min-width:280px;max-width:80vw;box-shadow:0 4px 24px #0001;text-align:center;max-height:60vh;display:flex;flex-direction:column}.pay-modal__close{position:absolute;right:12px;top:12px;background:0 0;border:none;font-size:28px;cursor:pointer;text-align:left}.pay-modal__icon{margin-bottom:8px;font-size:40px}.pay-modal__title{font-size:20px;font-weight:700;color:#222;margin-bottom:12px}.pay-modal__desc{color:#222;font-size:15px;margin-bottom:24px;line-height:1.7;text-align:left}.pay-modal__content-wrapper{position:relative;z-index:1;text-align:center;overflow-y:auto;flex:1;min-height:0}.pay-modal__actions{display:flex;justify-content:center;gap:16px;margin-top:16px}.pay-modal__btn{min-width:96px;padding:8px 0;border-radius:24px;border:none;font-size:15px;font-weight:600;cursor:pointer;transition:background .2s}.pay-modal__btn--retry{background:#fff;color:#f25a5a;border:1.5px solid #f25a5a}.pay-modal__btn--finish{background:#f25a5a;color:#fff;border:none}
1
+ .pay-modal{position:fixed;z-index:9999;left:0;top:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center}.pay-modal__mask{position:absolute;left:0;top:0;right:0;bottom:0;background:rgba(0,0,0,.55);z-index:0}.pay-modal__content{position:relative;z-index:1;background:#fff;border-radius:16px;padding:42px 20px 20px;min-width:280px;max-width:80vw;box-shadow:0 4px 24px #0001;text-align:center;max-height:60vh;display:flex;flex-direction:column}.pay-modal__close{position:absolute;right:12px;top:12px;background:0 0;border:none;font-size:32px;font-weight:500;line-height:32px;cursor:pointer;text-align:left}.pay-modal__icon{margin-bottom:8px;font-size:40px}.pay-modal__title{font-size:20px;font-weight:700;color:#222;margin-bottom:12px}.pay-modal__desc{color:#222;font-size:15px;margin-bottom:24px;line-height:1.7;text-align:left}.pay-modal__content-wrapper{position:relative;z-index:1;text-align:center;overflow-y:auto;flex:1;min-height:0}.pay-modal__actions{display:flex;justify-content:center;gap:16px;margin-top:16px}.pay-modal__btn{min-width:96px;padding:8px 0;border-radius:24px;border:none;font-size:15px;font-weight:600;cursor:pointer;transition:background .2s}.pay-modal__btn--retry{background:#fff;color:#f25a5a;border:1.5px solid #f25a5a}.pay-modal__btn--finish{background:#f25a5a;color:#fff;border:none}