pay-sdk-react 1.1.7 → 1.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/css/index.css +2 -0
- package/dist/css/index.min.css +1 -1
- package/dist/es/Airwallex/airwallex-button.js +11 -5
- package/dist/es/Airwallex/index.d.ts +3 -0
- package/dist/es/Airwallex/index.js +4 -1
- package/dist/es/Airwallex/style/index.css +2 -0
- package/dist/es/Airwallex/style/index.min.css +1 -1
- package/dist/es/Alipay/alipay-button.js +3 -2
- package/dist/es/Alipay/index.d.ts +2 -0
- package/dist/es/Alipay/index.js +3 -1
- package/dist/es/MAlipay/index.d.ts +1 -0
- package/dist/es/MAlipay/index.js +2 -1
- package/dist/es/MAlipay/style/index.css +2 -0
- package/dist/es/MAlipay/style/index.min.css +1 -1
- package/dist/es/MWeChat/style/index.css +2 -0
- package/dist/es/MWeChat/style/index.min.css +1 -1
- package/dist/es/PayButton/index.js +10 -11
- package/dist/es/Paypal/paypal-button.js +1 -3
- package/dist/es/Payssion/payssion-button.js +1 -1
- package/dist/es/Stripe/index.d.ts +3 -0
- package/dist/es/Stripe/index.js +6 -1
- package/dist/es/Stripe/stripe-button.js +15 -5
- package/dist/es/Stripe/style/index.css +2 -0
- package/dist/es/Stripe/style/index.min.css +1 -1
- package/dist/es/Wechat/index.d.ts +2 -0
- package/dist/es/Wechat/index.js +3 -1
- package/dist/es/Wechat/wechat-button.js +3 -2
- package/dist/es/confirm-modal/style/index.css +2 -0
- package/dist/es/confirm-modal/style/index.min.css +1 -1
- package/dist/es/pay-modal/style/index.css +2 -0
- package/dist/es/pay-modal/style/index.min.css +1 -1
- package/dist/lib/Airwallex/airwallex-button.js +11 -5
- package/dist/lib/Airwallex/index.js +23 -1
- package/dist/lib/Airwallex/style/index.css +2 -0
- package/dist/lib/Airwallex/style/index.min.css +1 -1
- package/dist/lib/Alipay/alipay-button.js +3 -2
- package/dist/lib/Alipay/index.js +16 -1
- package/dist/lib/MAlipay/index.js +9 -1
- package/dist/lib/MAlipay/style/index.css +2 -0
- package/dist/lib/MAlipay/style/index.min.css +1 -1
- package/dist/lib/MWeChat/style/index.css +2 -0
- package/dist/lib/MWeChat/style/index.min.css +1 -1
- package/dist/lib/PayButton/index.js +10 -12
- package/dist/lib/Paypal/paypal-button.js +1 -3
- package/dist/lib/Payssion/payssion-button.js +1 -1
- package/dist/lib/Stripe/index.js +24 -2
- package/dist/lib/Stripe/stripe-button.js +15 -5
- package/dist/lib/Stripe/style/index.css +2 -0
- package/dist/lib/Stripe/style/index.min.css +1 -1
- package/dist/lib/Wechat/index.js +16 -1
- package/dist/lib/Wechat/wechat-button.js +3 -2
- package/dist/lib/confirm-modal/style/index.css +2 -0
- package/dist/lib/confirm-modal/style/index.min.css +1 -1
- package/dist/lib/pay-modal/style/index.css +2 -0
- package/dist/lib/pay-modal/style/index.min.css +1 -1
- package/dist/umd/pay-sdk-react.umd.js +36 -19
- package/dist/umd/pay-sdk-react.umd.js.map +1 -1
- package/package.json +9 -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: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}
|
|
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{display:flex;justify-content:center;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}
|
|
@@ -49,14 +49,15 @@ const AlipayButton = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
|
49
49
|
}
|
|
50
50
|
}, [createOrder]);
|
|
51
51
|
const handleClick = (0, _react.useCallback)(e => {
|
|
52
|
+
var _modalProps$alipayPro;
|
|
52
53
|
if (createOrder) {
|
|
53
54
|
handlePayCreateOrder();
|
|
54
|
-
} else {
|
|
55
|
+
} else if (modalProps !== null && modalProps !== void 0 && (_modalProps$alipayPro = modalProps.alipayProps) !== null && _modalProps$alipayPro !== void 0 && _modalProps$alipayPro.formHtml) {
|
|
55
56
|
var _alipayModalRef$curre4;
|
|
56
57
|
alipayModalRef === null || alipayModalRef === void 0 || (_alipayModalRef$curre4 = alipayModalRef.current) === null || _alipayModalRef$curre4 === void 0 || _alipayModalRef$curre4.open();
|
|
57
58
|
}
|
|
58
59
|
onClick === null || onClick === void 0 || onClick(e);
|
|
59
|
-
}, [onClick, createOrder, handlePayCreateOrder]);
|
|
60
|
+
}, [onClick, createOrder, handlePayCreateOrder, modalProps]);
|
|
60
61
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Button.default, _extends({
|
|
61
62
|
ref: alipayButtonRef,
|
|
62
63
|
className: (0, _classNames.default)((0, _getPrefixCls.getPrefixCls)('alipay-btn'), className),
|
package/dist/lib/Alipay/index.js
CHANGED
|
@@ -3,7 +3,22 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
var _exportNames = {
|
|
6
|
+
var _exportNames = {
|
|
7
|
+
AlipayButton: true,
|
|
8
|
+
AlipayModal: true
|
|
9
|
+
};
|
|
10
|
+
Object.defineProperty(exports, "AlipayButton", {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _alipayButton.default;
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
Object.defineProperty(exports, "AlipayModal", {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: function () {
|
|
19
|
+
return _alipayModal.default;
|
|
20
|
+
}
|
|
21
|
+
});
|
|
7
22
|
exports.default = void 0;
|
|
8
23
|
var _alipay = _interopRequireDefault(require("./alipay"));
|
|
9
24
|
var _alipayButton = _interopRequireDefault(require("./alipay-button"));
|
|
@@ -3,7 +3,15 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
var _exportNames = {
|
|
6
|
+
var _exportNames = {
|
|
7
|
+
MAlipayButton: true
|
|
8
|
+
};
|
|
9
|
+
Object.defineProperty(exports, "MAlipayButton", {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function () {
|
|
12
|
+
return _mAlipayButton.default;
|
|
13
|
+
}
|
|
14
|
+
});
|
|
7
15
|
exports.default = void 0;
|
|
8
16
|
var _mAlipayAutoSubmit = _interopRequireDefault(require("./m-alipay-auto-submit"));
|
|
9
17
|
var _mAlipayButton = _interopRequireDefault(require("./m-alipay-button"));
|
|
@@ -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: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}
|
|
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{display:flex;justify-content:center;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 +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: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}
|
|
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{display:flex;justify-content:center;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}
|
|
@@ -8,13 +8,13 @@ exports.default = void 0;
|
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _shared = require("../shared");
|
|
10
10
|
var _Paypal = require("../Paypal");
|
|
11
|
-
var _Stripe =
|
|
12
|
-
var _Airwallex =
|
|
11
|
+
var _Stripe = require("../Stripe");
|
|
12
|
+
var _Airwallex = require("../Airwallex");
|
|
13
13
|
var _Payssion = require("../Payssion");
|
|
14
14
|
var _MWeChat = require("../MWeChat");
|
|
15
|
-
var _Alipay =
|
|
16
|
-
var _Wechat =
|
|
17
|
-
var _MAlipay =
|
|
15
|
+
var _Alipay = require("../Alipay");
|
|
16
|
+
var _Wechat = require("../Wechat");
|
|
17
|
+
var _MAlipay = require("../MAlipay");
|
|
18
18
|
var _interface = require("./interface");
|
|
19
19
|
Object.keys(_interface).forEach(function (key) {
|
|
20
20
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -27,11 +27,9 @@ Object.keys(_interface).forEach(function (key) {
|
|
|
27
27
|
}
|
|
28
28
|
});
|
|
29
29
|
});
|
|
30
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
31
30
|
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
31
|
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
32
|
const PayButton = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
34
|
-
// 使用类型断言来确保 ref 类型正确
|
|
35
33
|
const typedRef = ref;
|
|
36
34
|
if (props.payMethod === _shared.PaymentMethod.PaypalH5 || props.payMethod === _shared.PaymentMethod.PaypalPc) {
|
|
37
35
|
return /*#__PURE__*/_react.default.createElement(_Paypal.PaypalButton, _extends({
|
|
@@ -39,12 +37,12 @@ const PayButton = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
|
39
37
|
}, props));
|
|
40
38
|
}
|
|
41
39
|
if (props.payMethod === _shared.PaymentMethod.StripeH5 || props.payMethod === _shared.PaymentMethod.StripePc) {
|
|
42
|
-
return /*#__PURE__*/_react.default.createElement(_Stripe.
|
|
40
|
+
return /*#__PURE__*/_react.default.createElement(_Stripe.StripeButton, _extends({
|
|
43
41
|
ref: typedRef
|
|
44
42
|
}, props));
|
|
45
43
|
}
|
|
46
44
|
if (props.payMethod === _shared.PaymentMethod.Airwallex) {
|
|
47
|
-
return /*#__PURE__*/_react.default.createElement(_Airwallex.
|
|
45
|
+
return /*#__PURE__*/_react.default.createElement(_Airwallex.AirwallexButton, _extends({
|
|
48
46
|
ref: typedRef
|
|
49
47
|
}, props));
|
|
50
48
|
}
|
|
@@ -59,17 +57,17 @@ const PayButton = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
|
59
57
|
}, props));
|
|
60
58
|
}
|
|
61
59
|
if (props.payMethod === _shared.PaymentMethod.AlipayH5) {
|
|
62
|
-
return /*#__PURE__*/_react.default.createElement(_MAlipay.
|
|
60
|
+
return /*#__PURE__*/_react.default.createElement(_MAlipay.MAlipayButton, _extends({
|
|
63
61
|
ref: typedRef
|
|
64
62
|
}, props));
|
|
65
63
|
}
|
|
66
64
|
if (props.payMethod === _shared.PaymentMethod.AlipayPc) {
|
|
67
|
-
return /*#__PURE__*/_react.default.createElement(_Alipay.
|
|
65
|
+
return /*#__PURE__*/_react.default.createElement(_Alipay.AlipayButton, _extends({
|
|
68
66
|
ref: typedRef
|
|
69
67
|
}, props));
|
|
70
68
|
}
|
|
71
69
|
if (props.payMethod === _shared.PaymentMethod.WechatPc) {
|
|
72
|
-
return /*#__PURE__*/_react.default.createElement(_Wechat.
|
|
70
|
+
return /*#__PURE__*/_react.default.createElement(_Wechat.WechatButton, _extends({
|
|
73
71
|
ref: typedRef
|
|
74
72
|
}, props));
|
|
75
73
|
}
|
|
@@ -32,8 +32,6 @@ const PaypalButton = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
|
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
|
-
|
|
36
|
-
// 监听 isPayment 状态变化,当支付完成时隐藏蒙层
|
|
37
35
|
(0, _react.useEffect)(() => {
|
|
38
36
|
if (createOrder && isPayment) {
|
|
39
37
|
setShowMask(false);
|
|
@@ -47,8 +45,8 @@ const PaypalButton = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
|
47
45
|
openPayment: options => {
|
|
48
46
|
if (options) {
|
|
49
47
|
setPaypalUrl(options.paypalUrl);
|
|
48
|
+
setShowMask(true);
|
|
50
49
|
}
|
|
51
|
-
setShowMask(true);
|
|
52
50
|
},
|
|
53
51
|
closePayment: () => {
|
|
54
52
|
setShowMask(false);
|
|
@@ -38,8 +38,8 @@ const PayssionButton = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
|
38
38
|
openPayment: options => {
|
|
39
39
|
if (options) {
|
|
40
40
|
setPayssionUrl(options.payssionUrl);
|
|
41
|
+
setShowMask(true);
|
|
41
42
|
}
|
|
42
|
-
setShowMask(true);
|
|
43
43
|
},
|
|
44
44
|
closePayment: () => {
|
|
45
45
|
setShowMask(false);
|
package/dist/lib/Stripe/index.js
CHANGED
|
@@ -3,7 +3,29 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
var _exportNames = {
|
|
6
|
+
var _exportNames = {
|
|
7
|
+
StripePopup: true,
|
|
8
|
+
StripeButton: true,
|
|
9
|
+
StripeModal: true
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "StripeButton", {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
get: function () {
|
|
14
|
+
return _stripeButton.default;
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
Object.defineProperty(exports, "StripeModal", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function () {
|
|
20
|
+
return _stripeModal.default;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
Object.defineProperty(exports, "StripePopup", {
|
|
24
|
+
enumerable: true,
|
|
25
|
+
get: function () {
|
|
26
|
+
return _stripePopup.default;
|
|
27
|
+
}
|
|
28
|
+
});
|
|
7
29
|
exports.default = void 0;
|
|
8
30
|
var _stripe = _interopRequireDefault(require("./stripe"));
|
|
9
31
|
var _stripePopup = _interopRequireDefault(require("./stripe-popup"));
|
|
@@ -26,4 +48,4 @@ const StripeComponent = _stripe.default;
|
|
|
26
48
|
StripeComponent.Button = _stripeButton.default;
|
|
27
49
|
StripeComponent.Popup = _stripePopup.default;
|
|
28
50
|
StripeComponent.Modal = _stripeModal.default;
|
|
29
|
-
var _default = exports.default = StripeComponent;
|
|
51
|
+
var _default = exports.default = StripeComponent; // 兼容:同时提供具名导出,便于内部与严格 ESM 环境避免默认导出初始化顺序问题
|
|
@@ -68,15 +68,25 @@ const StripeButton = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
|
68
68
|
handlePayCreateOrder();
|
|
69
69
|
} else {
|
|
70
70
|
if (displayType === 'modal') {
|
|
71
|
-
var
|
|
72
|
-
|
|
71
|
+
var _stripeModalProps$str, _stripeModalProps$str2;
|
|
72
|
+
const clientSecret = stripeModalProps === null || stripeModalProps === void 0 || (_stripeModalProps$str = stripeModalProps.stripeProps) === null || _stripeModalProps$str === void 0 ? void 0 : _stripeModalProps$str.clientSecret;
|
|
73
|
+
const stripeKey = stripeModalProps === null || stripeModalProps === void 0 || (_stripeModalProps$str2 = stripeModalProps.stripeProps) === null || _stripeModalProps$str2 === void 0 ? void 0 : _stripeModalProps$str2.stripeKey;
|
|
74
|
+
if (clientSecret && stripeKey) {
|
|
75
|
+
var _stripeModalRef$curre4;
|
|
76
|
+
stripeModalRef === null || stripeModalRef === void 0 || (_stripeModalRef$curre4 = stripeModalRef.current) === null || _stripeModalRef$curre4 === void 0 || _stripeModalRef$curre4.open();
|
|
77
|
+
}
|
|
73
78
|
} else {
|
|
74
|
-
var
|
|
75
|
-
|
|
79
|
+
var _stripePopupProps$str, _stripePopupProps$str2;
|
|
80
|
+
const clientSecret = stripePopupProps === null || stripePopupProps === void 0 || (_stripePopupProps$str = stripePopupProps.stripeProps) === null || _stripePopupProps$str === void 0 ? void 0 : _stripePopupProps$str.clientSecret;
|
|
81
|
+
const stripeKey = stripePopupProps === null || stripePopupProps === void 0 || (_stripePopupProps$str2 = stripePopupProps.stripeProps) === null || _stripePopupProps$str2 === void 0 ? void 0 : _stripePopupProps$str2.stripeKey;
|
|
82
|
+
if (clientSecret && stripeKey) {
|
|
83
|
+
var _stripePopupRef$curre4;
|
|
84
|
+
stripePopupRef === null || stripePopupRef === void 0 || (_stripePopupRef$curre4 = stripePopupRef.current) === null || _stripePopupRef$curre4 === void 0 || _stripePopupRef$curre4.open();
|
|
85
|
+
}
|
|
76
86
|
}
|
|
77
87
|
}
|
|
78
88
|
onClick === null || onClick === void 0 || onClick(e);
|
|
79
|
-
}, [onClick, createOrder, handlePayCreateOrder, displayType]);
|
|
89
|
+
}, [onClick, createOrder, handlePayCreateOrder, displayType, stripeModalProps, stripePopupProps]);
|
|
80
90
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Button.default, _extends({
|
|
81
91
|
ref: stripeButtonRef,
|
|
82
92
|
onClick: handleClick
|
|
@@ -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: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%}}
|
|
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{display:flex;justify-content:center;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%}}
|
package/dist/lib/Wechat/index.js
CHANGED
|
@@ -3,7 +3,22 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
var _exportNames = {
|
|
6
|
+
var _exportNames = {
|
|
7
|
+
WechatButton: true,
|
|
8
|
+
WechatModal: true
|
|
9
|
+
};
|
|
10
|
+
Object.defineProperty(exports, "WechatButton", {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _wechatButton.default;
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
Object.defineProperty(exports, "WechatModal", {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: function () {
|
|
19
|
+
return _wechatModal.default;
|
|
20
|
+
}
|
|
21
|
+
});
|
|
7
22
|
exports.default = void 0;
|
|
8
23
|
var _wechat = _interopRequireDefault(require("./wechat"));
|
|
9
24
|
var _wechatButton = _interopRequireDefault(require("./wechat-button"));
|
|
@@ -47,14 +47,15 @@ const WechatButton = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
|
47
47
|
}
|
|
48
48
|
}, [createOrder]);
|
|
49
49
|
const handleClick = (0, _react.useCallback)(e => {
|
|
50
|
+
var _modalProps$wechatPro;
|
|
50
51
|
if (createOrder) {
|
|
51
52
|
handlePayCreateOrder();
|
|
52
|
-
} else {
|
|
53
|
+
} else if (modalProps !== null && modalProps !== void 0 && (_modalProps$wechatPro = modalProps.wechatProps) !== null && _modalProps$wechatPro !== void 0 && _modalProps$wechatPro.wechatUrl) {
|
|
53
54
|
var _wechatModalRef$curre4;
|
|
54
55
|
wechatModalRef === null || wechatModalRef === void 0 || (_wechatModalRef$curre4 = wechatModalRef.current) === null || _wechatModalRef$curre4 === void 0 || _wechatModalRef$curre4.open();
|
|
55
56
|
}
|
|
56
57
|
onClick === null || onClick === void 0 || onClick(e);
|
|
57
|
-
}, [onClick, createOrder, handlePayCreateOrder]);
|
|
58
|
+
}, [onClick, createOrder, handlePayCreateOrder, modalProps]);
|
|
58
59
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Button.default, _extends({
|
|
59
60
|
ref: wechatButtonRef,
|
|
60
61
|
className: (0, _classNames.default)((0, _getPrefixCls.getPrefixCls)('wechat-btn'), className),
|
|
@@ -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: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}
|
|
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{display:flex;justify-content:center;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 +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: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}
|
|
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{display:flex;justify-content:center;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}
|
|
@@ -5529,7 +5529,6 @@
|
|
|
5529
5529
|
const paypalButtonRef = React.useRef(null);
|
|
5530
5530
|
const [showMask, setShowMask] = React.useState(false);
|
|
5531
5531
|
const [paypalUrl, setPaypalUrl] = React.useState();
|
|
5532
|
-
// 监听 isPayment 状态变化,当支付完成时隐藏蒙层
|
|
5533
5532
|
React.useEffect(() => {
|
|
5534
5533
|
if (createOrder && isPayment) {
|
|
5535
5534
|
setShowMask(false);
|
|
@@ -5542,8 +5541,8 @@
|
|
|
5542
5541
|
openPayment: (options) => {
|
|
5543
5542
|
if (options) {
|
|
5544
5543
|
setPaypalUrl(options.paypalUrl);
|
|
5544
|
+
setShowMask(true);
|
|
5545
5545
|
}
|
|
5546
|
-
setShowMask(true);
|
|
5547
5546
|
},
|
|
5548
5547
|
closePayment: () => {
|
|
5549
5548
|
setShowMask(false);
|
|
@@ -9453,14 +9452,29 @@
|
|
|
9453
9452
|
}
|
|
9454
9453
|
else {
|
|
9455
9454
|
if (displayType === 'modal') {
|
|
9456
|
-
|
|
9455
|
+
const clientSecret = stripeModalProps?.stripeProps?.clientSecret;
|
|
9456
|
+
const stripeKey = stripeModalProps?.stripeProps?.stripeKey;
|
|
9457
|
+
if (clientSecret && stripeKey) {
|
|
9458
|
+
stripeModalRef?.current?.open();
|
|
9459
|
+
}
|
|
9457
9460
|
}
|
|
9458
9461
|
else {
|
|
9459
|
-
|
|
9462
|
+
const clientSecret = stripePopupProps?.stripeProps?.clientSecret;
|
|
9463
|
+
const stripeKey = stripePopupProps?.stripeProps?.stripeKey;
|
|
9464
|
+
if (clientSecret && stripeKey) {
|
|
9465
|
+
stripePopupRef?.current?.open();
|
|
9466
|
+
}
|
|
9460
9467
|
}
|
|
9461
9468
|
}
|
|
9462
9469
|
onClick?.(e);
|
|
9463
|
-
}, [
|
|
9470
|
+
}, [
|
|
9471
|
+
onClick,
|
|
9472
|
+
createOrder,
|
|
9473
|
+
handlePayCreateOrder,
|
|
9474
|
+
displayType,
|
|
9475
|
+
stripeModalProps,
|
|
9476
|
+
stripePopupProps,
|
|
9477
|
+
]);
|
|
9464
9478
|
return (jsxRuntimeExports.jsxs(React.Fragment, { children: [jsxRuntimeExports.jsx(Button, { ref: stripeButtonRef, onClick: handleClick, ...others, children: children }), displayType === 'popup' && (jsxRuntimeExports.jsx(StripePopup$1, { ref: stripePopupRef, ...stripePopupProps })), displayType === 'modal' && (jsxRuntimeExports.jsx(StripeModal$1, { ref: stripeModalRef, ...stripeModalProps }))] }));
|
|
9465
9479
|
});
|
|
9466
9480
|
StripeButton.displayName = 'StripeButton';
|
|
@@ -9631,8 +9645,8 @@
|
|
|
9631
9645
|
openPayment: (options) => {
|
|
9632
9646
|
if (options) {
|
|
9633
9647
|
setAirwallexUrl(options.airwallexUrl);
|
|
9648
|
+
setShowMask(true);
|
|
9634
9649
|
}
|
|
9635
|
-
setShowMask(true);
|
|
9636
9650
|
},
|
|
9637
9651
|
closePayment: () => {
|
|
9638
9652
|
setShowMask(false);
|
|
@@ -9667,10 +9681,14 @@
|
|
|
9667
9681
|
}
|
|
9668
9682
|
if (props?.payMode === 'embedded') {
|
|
9669
9683
|
if (props?.displayType === 'modal') {
|
|
9670
|
-
|
|
9684
|
+
if (props?.modalProps?.airwallexProps?.initOptions) {
|
|
9685
|
+
airwallexModalRef?.current?.open();
|
|
9686
|
+
}
|
|
9671
9687
|
}
|
|
9672
9688
|
else {
|
|
9673
|
-
|
|
9689
|
+
if (props?.popupProps?.airwallexProps?.initOptions) {
|
|
9690
|
+
airwallexPopupRef?.current?.open();
|
|
9691
|
+
}
|
|
9674
9692
|
}
|
|
9675
9693
|
return;
|
|
9676
9694
|
}
|
|
@@ -9713,8 +9731,8 @@
|
|
|
9713
9731
|
openPayment: (options) => {
|
|
9714
9732
|
if (options) {
|
|
9715
9733
|
setPayssionUrl(options.payssionUrl);
|
|
9734
|
+
setShowMask(true);
|
|
9716
9735
|
}
|
|
9717
|
-
setShowMask(true);
|
|
9718
9736
|
},
|
|
9719
9737
|
closePayment: () => {
|
|
9720
9738
|
setShowMask(false);
|
|
@@ -10102,11 +10120,11 @@
|
|
|
10102
10120
|
if (createOrder) {
|
|
10103
10121
|
handlePayCreateOrder();
|
|
10104
10122
|
}
|
|
10105
|
-
else {
|
|
10123
|
+
else if (modalProps?.alipayProps?.formHtml) {
|
|
10106
10124
|
alipayModalRef?.current?.open();
|
|
10107
10125
|
}
|
|
10108
10126
|
onClick?.(e);
|
|
10109
|
-
}, [onClick, createOrder, handlePayCreateOrder]);
|
|
10127
|
+
}, [onClick, createOrder, handlePayCreateOrder, modalProps]);
|
|
10110
10128
|
return (jsxRuntimeExports.jsxs(React.Fragment, { children: [jsxRuntimeExports.jsx(Button, { ref: alipayButtonRef, className: cs(getPrefixCls('alipay-btn'), className), onClick: handleClick, ...others, children: children }), jsxRuntimeExports.jsx(AlipayModal$1, { ref: alipayModalRef, ...modalProps })] }));
|
|
10111
10129
|
});
|
|
10112
10130
|
AlipayButton.displayName = 'AlipayButton';
|
|
@@ -16518,11 +16536,11 @@
|
|
|
16518
16536
|
if (createOrder) {
|
|
16519
16537
|
handlePayCreateOrder();
|
|
16520
16538
|
}
|
|
16521
|
-
else {
|
|
16539
|
+
else if (modalProps?.wechatProps?.wechatUrl) {
|
|
16522
16540
|
wechatModalRef?.current?.open();
|
|
16523
16541
|
}
|
|
16524
16542
|
onClick?.(e);
|
|
16525
|
-
}, [onClick, createOrder, handlePayCreateOrder]);
|
|
16543
|
+
}, [onClick, createOrder, handlePayCreateOrder, modalProps]);
|
|
16526
16544
|
return (jsxRuntimeExports.jsxs(React.Fragment, { children: [jsxRuntimeExports.jsx(Button, { ref: wechatButtonRef, className: cs(getPrefixCls('wechat-btn'), className), onClick: handleClick, ...others, children: children }), jsxRuntimeExports.jsx(WechatModal$1, { ref: wechatModalRef, ...modalProps })] }));
|
|
16527
16545
|
});
|
|
16528
16546
|
WechatButton.displayName = 'WechatButton';
|
|
@@ -16533,7 +16551,6 @@
|
|
|
16533
16551
|
WechatComponent.Modal = WechatModal$1;
|
|
16534
16552
|
|
|
16535
16553
|
const PayButton = React.forwardRef((props, ref) => {
|
|
16536
|
-
// 使用类型断言来确保 ref 类型正确
|
|
16537
16554
|
const typedRef = ref;
|
|
16538
16555
|
if (props.payMethod === exports.PaymentMethod.PaypalH5 ||
|
|
16539
16556
|
props.payMethod === exports.PaymentMethod.PaypalPc) {
|
|
@@ -16541,10 +16558,10 @@
|
|
|
16541
16558
|
}
|
|
16542
16559
|
if (props.payMethod === exports.PaymentMethod.StripeH5 ||
|
|
16543
16560
|
props.payMethod === exports.PaymentMethod.StripePc) {
|
|
16544
|
-
return (jsxRuntimeExports.jsx(
|
|
16561
|
+
return (jsxRuntimeExports.jsx(StripeButton$1, { ref: typedRef, ...props }));
|
|
16545
16562
|
}
|
|
16546
16563
|
if (props.payMethod === exports.PaymentMethod.Airwallex) {
|
|
16547
|
-
return (jsxRuntimeExports.jsx(
|
|
16564
|
+
return (jsxRuntimeExports.jsx(AirwallexButton$1, { ref: typedRef, ...props }));
|
|
16548
16565
|
}
|
|
16549
16566
|
if (props.payMethod === exports.PaymentMethod.Payssion) {
|
|
16550
16567
|
return (jsxRuntimeExports.jsx(PayssionButton$1, { ref: typedRef, ...props }));
|
|
@@ -16553,13 +16570,13 @@
|
|
|
16553
16570
|
return (jsxRuntimeExports.jsx(MWechatButton$1, { ref: typedRef, ...props }));
|
|
16554
16571
|
}
|
|
16555
16572
|
if (props.payMethod === exports.PaymentMethod.AlipayH5) {
|
|
16556
|
-
return (jsxRuntimeExports.jsx(
|
|
16573
|
+
return (jsxRuntimeExports.jsx(MAlipayButton$1, { ref: typedRef, ...props }));
|
|
16557
16574
|
}
|
|
16558
16575
|
if (props.payMethod === exports.PaymentMethod.AlipayPc) {
|
|
16559
|
-
return (jsxRuntimeExports.jsx(
|
|
16576
|
+
return (jsxRuntimeExports.jsx(AlipayButton$1, { ref: typedRef, ...props }));
|
|
16560
16577
|
}
|
|
16561
16578
|
if (props.payMethod === exports.PaymentMethod.WechatPc) {
|
|
16562
|
-
return (jsxRuntimeExports.jsx(
|
|
16579
|
+
return (jsxRuntimeExports.jsx(WechatButton$1, { ref: typedRef, ...props }));
|
|
16563
16580
|
}
|
|
16564
16581
|
return null;
|
|
16565
16582
|
});
|