pay-sdk-react 1.1.5 → 1.1.7

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 (68) 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 +40 -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 +20 -8
  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/PayMask/interface.d.ts +6 -0
  20. package/dist/es/PayMask/pay-mask.js +5 -2
  21. package/dist/es/Paypal/interface.d.ts +23 -1
  22. package/dist/es/Paypal/paypal-button.d.ts +2 -2
  23. package/dist/es/Paypal/paypal-button.js +31 -7
  24. package/dist/es/Payssion/interface.d.ts +12 -1
  25. package/dist/es/Payssion/payssion-button.d.ts +2 -2
  26. package/dist/es/Payssion/payssion-button.js +17 -4
  27. package/dist/es/Stripe/interface.d.ts +22 -1
  28. package/dist/es/Stripe/stripe-button.d.ts +2 -2
  29. package/dist/es/Stripe/stripe-button.js +31 -11
  30. package/dist/es/Stripe/style/index.css +3 -1
  31. package/dist/es/Stripe/style/index.min.css +1 -1
  32. package/dist/es/Wechat/interface.d.ts +13 -2
  33. package/dist/es/Wechat/wechat-button.d.ts +2 -2
  34. package/dist/es/Wechat/wechat-button.js +20 -8
  35. package/dist/es/Wechat/wechat.js +1 -1
  36. package/dist/es/confirm-modal/style/index.css +3 -1
  37. package/dist/es/confirm-modal/style/index.min.css +1 -1
  38. package/dist/es/hooks/usePayWindowOpen.d.ts +6 -0
  39. package/dist/es/hooks/usePayWindowOpen.js +9 -4
  40. package/dist/es/index.d.ts +1 -1
  41. package/dist/es/pay-modal/style/index.css +3 -1
  42. package/dist/es/pay-modal/style/index.min.css +1 -1
  43. package/dist/lib/Airwallex/airwallex-button.js +41 -12
  44. package/dist/lib/Airwallex/style/index.css +3 -1
  45. package/dist/lib/Airwallex/style/index.min.css +1 -1
  46. package/dist/lib/Alipay/alipay-button.js +20 -8
  47. package/dist/lib/MAlipay/style/index.css +3 -1
  48. package/dist/lib/MAlipay/style/index.min.css +1 -1
  49. package/dist/lib/MWeChat/style/index.css +3 -1
  50. package/dist/lib/MWeChat/style/index.min.css +1 -1
  51. package/dist/lib/PayButton/index.js +10 -8
  52. package/dist/lib/PayButton/interface.js +3 -1
  53. package/dist/lib/PayMask/pay-mask.js +2 -0
  54. package/dist/lib/Paypal/paypal-button.js +28 -5
  55. package/dist/lib/Payssion/payssion-button.js +17 -4
  56. package/dist/lib/Stripe/stripe-button.js +32 -12
  57. package/dist/lib/Stripe/style/index.css +3 -1
  58. package/dist/lib/Stripe/style/index.min.css +1 -1
  59. package/dist/lib/Wechat/wechat-button.js +20 -8
  60. package/dist/lib/Wechat/wechat.js +1 -1
  61. package/dist/lib/confirm-modal/style/index.css +3 -1
  62. package/dist/lib/confirm-modal/style/index.min.css +1 -1
  63. package/dist/lib/hooks/usePayWindowOpen.js +8 -4
  64. package/dist/lib/pay-modal/style/index.css +3 -1
  65. package/dist/lib/pay-modal/style/index.min.css +1 -1
  66. package/dist/umd/pay-sdk-react.umd.js +131 -28
  67. package/dist/umd/pay-sdk-react.umd.js.map +1 -1
  68. package/package.json +1 -1
@@ -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}
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}
@@ -22,17 +22,29 @@ const AlipayButton = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
22
22
  modalProps,
23
23
  ...others
24
24
  } = props;
25
- const alipayButtonRef = (0, _react.useRef)({
26
- nativeElement: null
27
- });
25
+ const alipayButtonRef = (0, _react.useRef)(null);
28
26
  const alipayModalRef = (0, _react.useRef)(null);
29
- (0, _react.useImperativeHandle)(ref, () => alipayButtonRef.current);
27
+ (0, _react.useImperativeHandle)(ref, () => ({
28
+ get nativeElement() {
29
+ var _alipayButtonRef$curr;
30
+ return ((_alipayButtonRef$curr = alipayButtonRef.current) === null || _alipayButtonRef$curr === void 0 ? void 0 : _alipayButtonRef$curr.nativeElement) || null;
31
+ },
32
+ openModal: options => {
33
+ var _alipayModalRef$curre;
34
+ (_alipayModalRef$curre = alipayModalRef.current) === null || _alipayModalRef$curre === void 0 || _alipayModalRef$curre.open(options);
35
+ },
36
+ closeModal: () => {
37
+ var _alipayModalRef$curre2;
38
+ (_alipayModalRef$curre2 = alipayModalRef.current) === null || _alipayModalRef$curre2 === void 0 || _alipayModalRef$curre2.close();
39
+ },
40
+ current: alipayButtonRef.current
41
+ }));
30
42
  const handlePayCreateOrder = (0, _react.useCallback)(async () => {
31
43
  if (createOrder) {
32
44
  const options = await createOrder();
33
45
  if (options) {
34
- var _alipayModalRef$curre;
35
- alipayModalRef === null || alipayModalRef === void 0 || (_alipayModalRef$curre = alipayModalRef.current) === null || _alipayModalRef$curre === void 0 || _alipayModalRef$curre.open(options);
46
+ var _alipayModalRef$curre3;
47
+ alipayModalRef === null || alipayModalRef === void 0 || (_alipayModalRef$curre3 = alipayModalRef.current) === null || _alipayModalRef$curre3 === void 0 || _alipayModalRef$curre3.open(options);
36
48
  }
37
49
  }
38
50
  }, [createOrder]);
@@ -40,8 +52,8 @@ const AlipayButton = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
40
52
  if (createOrder) {
41
53
  handlePayCreateOrder();
42
54
  } else {
43
- var _alipayModalRef$curre2;
44
- alipayModalRef === null || alipayModalRef === void 0 || (_alipayModalRef$curre2 = alipayModalRef.current) === null || _alipayModalRef$curre2 === void 0 || _alipayModalRef$curre2.open();
55
+ var _alipayModalRef$curre4;
56
+ alipayModalRef === null || alipayModalRef === void 0 || (_alipayModalRef$curre4 = alipayModalRef.current) === null || _alipayModalRef$curre4 === void 0 || _alipayModalRef$curre4.open();
45
57
  }
46
58
  onClick === null || onClick === void 0 || onClick(e);
47
59
  }, [onClick, createOrder, handlePayCreateOrder]);
@@ -195,7 +195,9 @@
195
195
  top: 12px;
196
196
  background: none;
197
197
  border: none;
198
- font-size: 28px;
198
+ font-size: 32px;
199
+ font-weight: 500;
200
+ line-height: 32px;
199
201
  cursor: pointer;
200
202
  text-align: left;
201
203
  }
@@ -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-mask{position:fixed;z-index:1000;left:0;top:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center}.pay-mask-content{position:relative;width:100%;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:0 88px}.pay-mask-close{position:absolute;right:12px;top:12px;background:0 0;border:none;font-size:28px;color:#fff;cursor:pointer;z-index:1}.pay-mask-title{display:flex;align-items:center;gap:4px;font-weight:700;font-size:28px;color:#fff;margin-bottom:16px;text-shadow:0 2px 8px #000}.pay-mask-title>.pay-icon-paypal-white{width:36px;height:36px}.pay-mask-desc{color:#fff;text-align:center;margin-bottom:24px;line-height:1.5;white-space:pre-line}.pay-mask-continue{color:#fff;font-weight:700;text-decoration:underline;text-underline-offset:4px;cursor:pointer;text-align:center;font-size:18px}.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-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-mask{position:fixed;z-index:1000;left:0;top:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center}.pay-mask-content{position:relative;width:100%;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:0 88px}.pay-mask-close{position:absolute;right:12px;top:12px;background:0 0;border:none;font-size:28px;color:#fff;cursor:pointer;z-index:1}.pay-mask-title{display:flex;align-items:center;gap:4px;font-weight:700;font-size:28px;color:#fff;margin-bottom:16px;text-shadow:0 2px 8px #000}.pay-mask-title>.pay-icon-paypal-white{width:36px;height:36px}.pay-mask-desc{color:#fff;text-align:center;margin-bottom:24px;line-height:1.5;white-space:pre-line}.pay-mask-continue{color:#fff;font-weight:700;text-decoration:underline;text-underline-offset:4px;cursor:pointer;text-align:center;font-size:18px}.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}
@@ -195,7 +195,9 @@
195
195
  top: 12px;
196
196
  background: none;
197
197
  border: none;
198
- font-size: 28px;
198
+ font-size: 32px;
199
+ font-weight: 500;
200
+ line-height: 32px;
199
201
  cursor: pointer;
200
202
  text-align: left;
201
203
  }
@@ -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-mask{position:fixed;z-index:1000;left:0;top:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center}.pay-mask-content{position:relative;width:100%;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:0 88px}.pay-mask-close{position:absolute;right:12px;top:12px;background:0 0;border:none;font-size:28px;color:#fff;cursor:pointer;z-index:1}.pay-mask-title{display:flex;align-items:center;gap:4px;font-weight:700;font-size:28px;color:#fff;margin-bottom:16px;text-shadow:0 2px 8px #000}.pay-mask-title>.pay-icon-paypal-white{width:36px;height:36px}.pay-mask-desc{color:#fff;text-align:center;margin-bottom:24px;line-height:1.5;white-space:pre-line}.pay-mask-continue{color:#fff;font-weight:700;text-decoration:underline;text-underline-offset:4px;cursor:pointer;text-align:center;font-size:18px}.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-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-mask{position:fixed;z-index:1000;left:0;top:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center}.pay-mask-content{position:relative;width:100%;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:0 88px}.pay-mask-close{position:absolute;right:12px;top:12px;background:0 0;border:none;font-size:28px;color:#fff;cursor:pointer;z-index:1}.pay-mask-title{display:flex;align-items:center;gap:4px;font-weight:700;font-size:28px;color:#fff;margin-bottom:16px;text-shadow:0 2px 8px #000}.pay-mask-title>.pay-icon-paypal-white{width:36px;height:36px}.pay-mask-desc{color:#fff;text-align:center;margin-bottom:24px;line-height:1.5;white-space:pre-line}.pay-mask-continue{color:#fff;font-weight:700;text-decoration:underline;text-underline-offset:4px;cursor:pointer;text-align:center;font-size:18px}.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}
@@ -31,44 +31,46 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
31
31
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
32
32
  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); }
33
33
  const PayButton = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
34
+ // 使用类型断言来确保 ref 类型正确
35
+ const typedRef = ref;
34
36
  if (props.payMethod === _shared.PaymentMethod.PaypalH5 || props.payMethod === _shared.PaymentMethod.PaypalPc) {
35
37
  return /*#__PURE__*/_react.default.createElement(_Paypal.PaypalButton, _extends({
36
- ref: ref
38
+ ref: typedRef
37
39
  }, props));
38
40
  }
39
41
  if (props.payMethod === _shared.PaymentMethod.StripeH5 || props.payMethod === _shared.PaymentMethod.StripePc) {
40
42
  return /*#__PURE__*/_react.default.createElement(_Stripe.default.Button, _extends({
41
- ref: ref
43
+ ref: typedRef
42
44
  }, props));
43
45
  }
44
46
  if (props.payMethod === _shared.PaymentMethod.Airwallex) {
45
47
  return /*#__PURE__*/_react.default.createElement(_Airwallex.default.Button, _extends({
46
- ref: ref
48
+ ref: typedRef
47
49
  }, props));
48
50
  }
49
51
  if (props.payMethod === _shared.PaymentMethod.Payssion) {
50
52
  return /*#__PURE__*/_react.default.createElement(_Payssion.PayssionButton, _extends({
51
- ref: ref
53
+ ref: typedRef
52
54
  }, props));
53
55
  }
54
56
  if (props.payMethod === _shared.PaymentMethod.WechatH5) {
55
57
  return /*#__PURE__*/_react.default.createElement(_MWeChat.MWechatButton, _extends({
56
- ref: ref
58
+ ref: typedRef
57
59
  }, props));
58
60
  }
59
61
  if (props.payMethod === _shared.PaymentMethod.AlipayH5) {
60
62
  return /*#__PURE__*/_react.default.createElement(_MAlipay.default.Button, _extends({
61
- ref: ref
63
+ ref: typedRef
62
64
  }, props));
63
65
  }
64
66
  if (props.payMethod === _shared.PaymentMethod.AlipayPc) {
65
67
  return /*#__PURE__*/_react.default.createElement(_Alipay.default.Button, _extends({
66
- ref: ref
68
+ ref: typedRef
67
69
  }, props));
68
70
  }
69
71
  if (props.payMethod === _shared.PaymentMethod.WechatPc) {
70
72
  return /*#__PURE__*/_react.default.createElement(_Wechat.default.Button, _extends({
71
- ref: ref
73
+ ref: typedRef
72
74
  }, props));
73
75
  }
74
76
  return null;
@@ -1,3 +1,5 @@
1
1
  "use strict";
2
2
 
3
- var _shared = require("../shared");
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -48,6 +48,7 @@ const PayMask = p => {
48
48
  forceNewWindow,
49
49
  className,
50
50
  destroyOnClose = true,
51
+ closeWindowOnUnmount = true,
51
52
  ...rest
52
53
  } = props;
53
54
  const [isWindowMonitoring, setIsWindowMonitoring] = (0, _react.useState)(false);
@@ -62,6 +63,7 @@ const PayMask = p => {
62
63
  },
63
64
  autoOpen: autoOpenWindow,
64
65
  openMode,
66
+ closeWindowOnUnmount,
65
67
  ...(openMode === _enums.OpenPayUrlMode.Window && {
66
68
  forceNewWindow
67
69
  })
@@ -21,18 +21,40 @@ const PaypalButton = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
21
21
  paypalUrl: propsPaypalUrl,
22
22
  createOrder,
23
23
  maskProps,
24
+ isPayment,
25
+ closeWindowOnUnmount = true,
24
26
  ...others
25
27
  } = props;
26
28
  const {
27
29
  onClose: onMaskClose,
28
30
  ...restMaskProps
29
31
  } = maskProps || {};
30
- const paypalButtonRef = (0, _react.useRef)({
31
- nativeElement: null
32
- });
32
+ const paypalButtonRef = (0, _react.useRef)(null);
33
33
  const [showMask, setShowMask] = (0, _react.useState)(false);
34
34
  const [paypalUrl, setPaypalUrl] = (0, _react.useState)();
35
- (0, _react.useImperativeHandle)(ref, () => paypalButtonRef.current);
35
+
36
+ // 监听 isPayment 状态变化,当支付完成时隐藏蒙层
37
+ (0, _react.useEffect)(() => {
38
+ if (createOrder && isPayment) {
39
+ setShowMask(false);
40
+ }
41
+ }, [createOrder, isPayment]);
42
+ (0, _react.useImperativeHandle)(ref, () => ({
43
+ get nativeElement() {
44
+ var _paypalButtonRef$curr;
45
+ return ((_paypalButtonRef$curr = paypalButtonRef.current) === null || _paypalButtonRef$curr === void 0 ? void 0 : _paypalButtonRef$curr.nativeElement) || null;
46
+ },
47
+ openPayment: options => {
48
+ if (options) {
49
+ setPaypalUrl(options.paypalUrl);
50
+ }
51
+ setShowMask(true);
52
+ },
53
+ closePayment: () => {
54
+ setShowMask(false);
55
+ },
56
+ current: paypalButtonRef.current
57
+ }));
36
58
  const handlePayCreateOrder = (0, _react.useCallback)(async () => {
37
59
  if (createOrder) {
38
60
  // 1. 业务侧创建订单,获取参数
@@ -71,7 +93,8 @@ const PaypalButton = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
71
93
  onMaskClose === null || onMaskClose === void 0 || onMaskClose();
72
94
  },
73
95
  payUrl: paypalUrl,
74
- title: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_icons.IconPaypalWhite, null), "PayPal")
96
+ title: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_icons.IconPaypalWhite, null), "PayPal"),
97
+ closeWindowOnUnmount: closeWindowOnUnmount
75
98
  }, restMaskProps)));
76
99
  });
77
100
  PaypalButton.displayName = 'PaypalButton';
@@ -27,12 +27,25 @@ const PayssionButton = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
27
27
  onClose,
28
28
  ...restMaskProps
29
29
  } = maskProps || {};
30
- const payssionButtonRef = (0, _react.useRef)({
31
- nativeElement: null
32
- });
30
+ const payssionButtonRef = (0, _react.useRef)(null);
33
31
  const [showMask, setShowMask] = (0, _react.useState)(false);
34
32
  const [payssionUrl, setPayssionUrl] = (0, _react.useState)();
35
- (0, _react.useImperativeHandle)(ref, () => payssionButtonRef.current);
33
+ (0, _react.useImperativeHandle)(ref, () => ({
34
+ get nativeElement() {
35
+ var _payssionButtonRef$cu;
36
+ return ((_payssionButtonRef$cu = payssionButtonRef.current) === null || _payssionButtonRef$cu === void 0 ? void 0 : _payssionButtonRef$cu.nativeElement) || null;
37
+ },
38
+ openPayment: options => {
39
+ if (options) {
40
+ setPayssionUrl(options.payssionUrl);
41
+ }
42
+ setShowMask(true);
43
+ },
44
+ closePayment: () => {
45
+ setShowMask(false);
46
+ },
47
+ current: payssionButtonRef.current
48
+ }));
36
49
  const handlePayCreateOrder = (0, _react.useCallback)(async () => {
37
50
  if (createOrder) {
38
51
  // 1. 业务侧创建订单,获取参数
@@ -21,12 +21,32 @@ const StripeButton = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
21
21
  createOrder,
22
22
  ...others
23
23
  } = props;
24
- const stripeButtonRef = (0, _react.useRef)({
25
- nativeElement: null
26
- });
24
+ const stripeButtonRef = (0, _react.useRef)(null);
27
25
  const stripePopupRef = (0, _react.useRef)(null);
28
26
  const stripeModalRef = (0, _react.useRef)(null);
29
- (0, _react.useImperativeHandle)(ref, () => stripeButtonRef.current);
27
+ (0, _react.useImperativeHandle)(ref, () => ({
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: options => {
33
+ var _stripePopupRef$curre;
34
+ (_stripePopupRef$curre = stripePopupRef.current) === null || _stripePopupRef$curre === void 0 || _stripePopupRef$curre.open(options);
35
+ },
36
+ closePopup: () => {
37
+ var _stripePopupRef$curre2;
38
+ (_stripePopupRef$curre2 = stripePopupRef.current) === null || _stripePopupRef$curre2 === void 0 || _stripePopupRef$curre2.close();
39
+ },
40
+ openModal: options => {
41
+ var _stripeModalRef$curre;
42
+ (_stripeModalRef$curre = stripeModalRef.current) === null || _stripeModalRef$curre === void 0 || _stripeModalRef$curre.open(options);
43
+ },
44
+ 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
  const handlePayCreateOrder = (0, _react.useCallback)(async () => {
31
51
  if (createOrder) {
32
52
  // 1. 业务侧创建订单,获取参数
@@ -34,11 +54,11 @@ const StripeButton = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
34
54
  if (options !== null && options !== void 0 && options.clientSecret && options !== null && options !== void 0 && options.stripeKey) {
35
55
  // 2. 唤起弹窗
36
56
  if (displayType === 'modal') {
37
- var _stripeModalRef$curre;
38
- (_stripeModalRef$curre = stripeModalRef.current) === null || _stripeModalRef$curre === void 0 || _stripeModalRef$curre.open(options);
57
+ var _stripeModalRef$curre3;
58
+ (_stripeModalRef$curre3 = stripeModalRef.current) === null || _stripeModalRef$curre3 === void 0 || _stripeModalRef$curre3.open(options);
39
59
  } else {
40
- var _stripePopupRef$curre;
41
- (_stripePopupRef$curre = stripePopupRef.current) === null || _stripePopupRef$curre === void 0 || _stripePopupRef$curre.open(options);
60
+ var _stripePopupRef$curre3;
61
+ (_stripePopupRef$curre3 = stripePopupRef.current) === null || _stripePopupRef$curre3 === void 0 || _stripePopupRef$curre3.open(options);
42
62
  }
43
63
  }
44
64
  }
@@ -48,11 +68,11 @@ const StripeButton = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
48
68
  handlePayCreateOrder();
49
69
  } else {
50
70
  if (displayType === 'modal') {
51
- var _stripeModalRef$curre2;
52
- stripeModalRef === null || stripeModalRef === void 0 || (_stripeModalRef$curre2 = stripeModalRef.current) === null || _stripeModalRef$curre2 === void 0 || _stripeModalRef$curre2.open();
71
+ var _stripeModalRef$curre4;
72
+ stripeModalRef === null || stripeModalRef === void 0 || (_stripeModalRef$curre4 = stripeModalRef.current) === null || _stripeModalRef$curre4 === void 0 || _stripeModalRef$curre4.open();
53
73
  } else {
54
- var _stripePopupRef$curre2;
55
- stripePopupRef === null || stripePopupRef === void 0 || (_stripePopupRef$curre2 = stripePopupRef.current) === null || _stripePopupRef$curre2 === void 0 || _stripePopupRef$curre2.open();
74
+ var _stripePopupRef$curre4;
75
+ stripePopupRef === null || stripePopupRef === void 0 || (_stripePopupRef$curre4 = stripePopupRef.current) === null || _stripePopupRef$curre4 === void 0 || _stripePopupRef$curre4.open();
56
76
  }
57
77
  }
58
78
  onClick === null || onClick === void 0 || onClick(e);
@@ -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%}}
@@ -22,24 +22,36 @@ const WechatButton = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
22
22
  modalProps,
23
23
  ...others
24
24
  } = props;
25
- const wechatButtonRef = (0, _react.useRef)({
26
- nativeElement: null
27
- });
25
+ const wechatButtonRef = (0, _react.useRef)(null);
28
26
  const wechatModalRef = (0, _react.useRef)(null);
29
- (0, _react.useImperativeHandle)(ref, () => wechatButtonRef.current);
27
+ (0, _react.useImperativeHandle)(ref, () => ({
28
+ get nativeElement() {
29
+ var _wechatButtonRef$curr;
30
+ return ((_wechatButtonRef$curr = wechatButtonRef.current) === null || _wechatButtonRef$curr === void 0 ? void 0 : _wechatButtonRef$curr.nativeElement) || null;
31
+ },
32
+ openModal: options => {
33
+ var _wechatModalRef$curre;
34
+ (_wechatModalRef$curre = wechatModalRef.current) === null || _wechatModalRef$curre === void 0 || _wechatModalRef$curre.open(options);
35
+ },
36
+ closeModal: () => {
37
+ var _wechatModalRef$curre2;
38
+ (_wechatModalRef$curre2 = wechatModalRef.current) === null || _wechatModalRef$curre2 === void 0 || _wechatModalRef$curre2.close();
39
+ },
40
+ current: wechatButtonRef.current
41
+ }));
30
42
  const handlePayCreateOrder = (0, _react.useCallback)(async () => {
31
43
  if (createOrder) {
32
- var _wechatModalRef$curre;
44
+ var _wechatModalRef$curre3;
33
45
  const options = await createOrder();
34
- (_wechatModalRef$curre = wechatModalRef.current) === null || _wechatModalRef$curre === void 0 || _wechatModalRef$curre.open(options);
46
+ (_wechatModalRef$curre3 = wechatModalRef.current) === null || _wechatModalRef$curre3 === void 0 || _wechatModalRef$curre3.open(options);
35
47
  }
36
48
  }, [createOrder]);
37
49
  const handleClick = (0, _react.useCallback)(e => {
38
50
  if (createOrder) {
39
51
  handlePayCreateOrder();
40
52
  } else {
41
- var _wechatModalRef$curre2;
42
- wechatModalRef === null || wechatModalRef === void 0 || (_wechatModalRef$curre2 = wechatModalRef.current) === null || _wechatModalRef$curre2 === void 0 || _wechatModalRef$curre2.open();
53
+ var _wechatModalRef$curre4;
54
+ wechatModalRef === null || wechatModalRef === void 0 || (_wechatModalRef$curre4 = wechatModalRef.current) === null || _wechatModalRef$curre4 === void 0 || _wechatModalRef$curre4.open();
43
55
  }
44
56
  onClick === null || onClick === void 0 || onClick(e);
45
57
  }, [onClick, createOrder, handlePayCreateOrder]);
@@ -10,7 +10,7 @@ var _qrcode = _interopRequireDefault(require("../utils/qrcode"));
10
10
  var _getPrefixCls = require("../utils/getPrefixCls");
11
11
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
12
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
13
- const classPrefix = (0, _getPrefixCls.getPrefixCls)('wechat');
13
+ const classPrefix = (0, _getPrefixCls.getPrefixCls)('wechat-qrcode');
14
14
  const WechatQrCode = ({
15
15
  wechatType = 'qrcode',
16
16
  wechatUrl,
@@ -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}
@@ -19,7 +19,8 @@ function getScreenWidth() {
19
19
  }
20
20
  const defaultProps = {
21
21
  payUrl: '',
22
- openMode: _enums.OpenPayUrlMode.Window
22
+ openMode: _enums.OpenPayUrlMode.Window,
23
+ closeWindowOnUnmount: true
23
24
  };
24
25
  function usePayWindowOpen(p) {
25
26
  const props = (0, _withDefaultProps.mergeProps)(defaultProps, p);
@@ -27,7 +28,8 @@ function usePayWindowOpen(p) {
27
28
  payUrl,
28
29
  onClose,
29
30
  onSuccess,
30
- autoOpen = true
31
+ autoOpen = true,
32
+ closeWindowOnUnmount = true
31
33
  } = props;
32
34
  const payWindowRef = (0, _react.useRef)(null);
33
35
  const pollTimerRef = (0, _react.useRef)(null);
@@ -120,10 +122,12 @@ function usePayWindowOpen(p) {
120
122
  }
121
123
  window.addEventListener('message', handleMessage);
122
124
  return () => {
123
- var _payWindowRef$current3;
124
125
  clearInterval(pollTimerRef.current);
125
126
  window.removeEventListener('message', handleMessage);
126
- (_payWindowRef$current3 = payWindowRef.current) === null || _payWindowRef$current3 === void 0 || _payWindowRef$current3.close();
127
+ if (closeWindowOnUnmount) {
128
+ var _payWindowRef$current3;
129
+ (_payWindowRef$current3 = payWindowRef.current) === null || _payWindowRef$current3 === void 0 || _payWindowRef$current3.close();
130
+ }
127
131
  };
128
132
  }, [isWindowMonitoring, props, onClose, onSuccess]);
129
133
  return {
@@ -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}