pay-sdk-react 1.1.9 → 1.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/Airwallex/index.d.ts +1 -3
- package/dist/es/Airwallex/index.js +6 -7
- package/dist/es/Alipay/index.d.ts +1 -2
- package/dist/es/Alipay/index.js +5 -5
- package/dist/es/MAlipay/index.d.ts +1 -1
- package/dist/es/MAlipay/index.js +4 -3
- package/dist/es/MAlipay/m-alipay-auto-submit.d.ts +1 -1
- package/dist/es/Stripe/index.d.ts +1 -3
- package/dist/es/Stripe/index.js +6 -9
- package/dist/es/Wechat/index.d.ts +1 -2
- package/dist/es/Wechat/index.js +5 -5
- package/dist/es/index.d.ts +91 -6
- package/dist/es/index.js +43 -6
- package/dist/lib/Airwallex/index.js +5 -4
- package/dist/lib/Alipay/index.js +4 -3
- package/dist/lib/MAlipay/index.js +3 -2
- package/dist/lib/Stripe/index.js +6 -5
- package/dist/lib/Wechat/index.js +4 -3
- package/dist/lib/index.js +93 -19
- package/dist/umd/pay-sdk-react.umd.js +74 -36
- package/dist/umd/pay-sdk-react.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -7823,7 +7823,7 @@
|
|
|
7823
7823
|
});
|
|
7824
7824
|
};
|
|
7825
7825
|
|
|
7826
|
-
const Stripe = React.forwardRef((props, ref) => {
|
|
7826
|
+
const Stripe$1 = React.forwardRef((props, ref) => {
|
|
7827
7827
|
const { stripeKey, clientSecret, className = '', ...others } = props;
|
|
7828
7828
|
const stripeRef = React.useRef(null);
|
|
7829
7829
|
React.useImperativeHandle(ref, () => stripeRef.current);
|
|
@@ -7836,8 +7836,8 @@
|
|
|
7836
7836
|
const classNames = cs(getPrefixCls('pay-stripe'), className);
|
|
7837
7837
|
return (jsxRuntimeExports.jsx("div", { ref: stripeRef, ...others, className: classNames, children: clientSecret && stripePromise && (jsxRuntimeExports.jsx(EmbeddedCheckoutProvider, { stripe: stripePromise, options: { clientSecret }, children: jsxRuntimeExports.jsx(EmbeddedCheckout, {}) })) }));
|
|
7838
7838
|
});
|
|
7839
|
-
Stripe.displayName = 'Stripe';
|
|
7840
|
-
var Stripe$
|
|
7839
|
+
Stripe$1.displayName = 'Stripe';
|
|
7840
|
+
var Stripe$2 = React.memo(Stripe$1);
|
|
7841
7841
|
|
|
7842
7842
|
function clamp(v, min, max) {
|
|
7843
7843
|
return Math.max(min, Math.min(v, max));
|
|
@@ -9403,7 +9403,7 @@
|
|
|
9403
9403
|
setUncontrolledVisible(false);
|
|
9404
9404
|
}
|
|
9405
9405
|
onClose?.();
|
|
9406
|
-
}, footer: null, ...rest, children: _stripeProps && jsxRuntimeExports.jsx(Stripe$
|
|
9406
|
+
}, footer: null, ...rest, children: _stripeProps && jsxRuntimeExports.jsx(Stripe$2, { ..._stripeProps }) }));
|
|
9407
9407
|
});
|
|
9408
9408
|
StripeModal.displayName = 'StripeModal';
|
|
9409
9409
|
var StripeModal$1 = React.memo(StripeModal);
|
|
@@ -9480,15 +9480,16 @@
|
|
|
9480
9480
|
StripeButton.displayName = 'StripeButton';
|
|
9481
9481
|
var StripeButton$1 = React.memo(StripeButton);
|
|
9482
9482
|
|
|
9483
|
-
const StripeComponent = Stripe$
|
|
9484
|
-
|
|
9485
|
-
|
|
9486
|
-
|
|
9483
|
+
const StripeComponent = Object.assign(Stripe$2, {
|
|
9484
|
+
Button: StripeButton$1,
|
|
9485
|
+
Popup: StripePopup$1,
|
|
9486
|
+
Modal: StripeModal$1,
|
|
9487
|
+
});
|
|
9487
9488
|
|
|
9488
9489
|
/* Airwallex Checkout Component Version [1.122.0] */
|
|
9489
9490
|
const e={prod:"checkout.airwallex.com",demo:"checkout-demo.airwallex.com",staging:"checkout-staging.airwallex.com",dev:"checkout-dev.airwallex.com",local:"localhost:3000"},r=r=>`https://${e[r]||e.prod}`,o="/assets/elements.bundle.min.js?version=1.122.0",n=e=>{const r=document.createElement("script");r.src=`${e}${o}`,r.crossOrigin="anonymous";const n=document.head||document.body;if(!n)throw new Error("Airwallex payment scripts requires a <head> or <body> html element in order to be loaded.");return n.appendChild(r),r},l=async e=>{if("undefined"==typeof window)return null;if(window.Airwallex)return window.Airwallex;let l=0;const t=async()=>{const l=document.querySelector(`script[src="${o}"], script[src="${o}/"]`)||n(r((null==e?void 0:e.env)||"prod"));return new Promise(((r,o)=>{l.addEventListener("load",(()=>{window.Airwallex?(window.Airwallex.init(e),r(window.Airwallex)):o(new Error("Failed to load Airwallex on load event"));})),l.addEventListener("error",(()=>{o(new Error("Failed to load Airwallex scripts")),l.remove&&l.remove();}));}))};for(;l<3;)try{return await t()}catch(e){l++,await new Promise((e=>window.setTimeout(e,500)));}return null};
|
|
9490
9491
|
|
|
9491
|
-
const Airwallex = React.forwardRef((props, ref) => {
|
|
9492
|
+
const Airwallex$1 = React.forwardRef((props, ref) => {
|
|
9492
9493
|
const { type = 'fullFeaturedCard', options, initOptions, style, onReady: propsOnReady, onSuccess: propsOnSuccess, onError: propsOnError, ...others } = props;
|
|
9493
9494
|
const airwallexRef = React.useRef(null);
|
|
9494
9495
|
React.useImperativeHandle(ref, () => airwallexRef.current);
|
|
@@ -9531,8 +9532,8 @@
|
|
|
9531
9532
|
}, [type, propsOnReady, propsOnSuccess, propsOnError]);
|
|
9532
9533
|
return (jsxRuntimeExports.jsx("div", { ref: airwallexRef, id: String(type), style: { width: '100%', ...style }, ...others }));
|
|
9533
9534
|
});
|
|
9534
|
-
Airwallex.displayName = 'Airwallex';
|
|
9535
|
-
var Airwallex$
|
|
9535
|
+
Airwallex$1.displayName = 'Airwallex';
|
|
9536
|
+
var Airwallex$2 = React.memo(Airwallex$1);
|
|
9536
9537
|
|
|
9537
9538
|
const AirwallexPopup = React.forwardRef((props, ref) => {
|
|
9538
9539
|
const { visible: controlledVisible, onClose, closeOnMaskClick = true, bodyStyle, airwallexProps: propsAirwallexProps, ...others } = props;
|
|
@@ -9565,7 +9566,7 @@
|
|
|
9565
9566
|
height: '40vh',
|
|
9566
9567
|
overflowY: 'scroll',
|
|
9567
9568
|
...bodyStyle,
|
|
9568
|
-
}, ...others, children: _airwallexProps && (jsxRuntimeExports.jsx(Airwallex$
|
|
9569
|
+
}, ...others, children: _airwallexProps && (jsxRuntimeExports.jsx(Airwallex$2, { onSuccess: (event) => {
|
|
9569
9570
|
if (!isControlled) {
|
|
9570
9571
|
setUncontrolledVisible(false);
|
|
9571
9572
|
}
|
|
@@ -9605,7 +9606,7 @@
|
|
|
9605
9606
|
setUncontrolledVisible(false);
|
|
9606
9607
|
}
|
|
9607
9608
|
onClose?.();
|
|
9608
|
-
}, footer: footer, ...rest, children: _airwallexProps && (jsxRuntimeExports.jsx(Airwallex$
|
|
9609
|
+
}, footer: footer, ...rest, children: _airwallexProps && (jsxRuntimeExports.jsx(Airwallex$2, { onSuccess: (event) => {
|
|
9609
9610
|
if (!isControlled) {
|
|
9610
9611
|
setUncontrolledVisible(false);
|
|
9611
9612
|
}
|
|
@@ -9713,10 +9714,11 @@
|
|
|
9713
9714
|
AirwallexButton.displayName = 'AirwallexButton';
|
|
9714
9715
|
var AirwallexButton$1 = React.memo(AirwallexButton);
|
|
9715
9716
|
|
|
9716
|
-
const AirwallexComponent = Airwallex$
|
|
9717
|
-
|
|
9718
|
-
|
|
9719
|
-
|
|
9717
|
+
const AirwallexComponent = Object.assign(Airwallex$2, {
|
|
9718
|
+
Button: AirwallexButton$1,
|
|
9719
|
+
Popup: AirwallexPopup,
|
|
9720
|
+
Modal: AirwallexModal,
|
|
9721
|
+
});
|
|
9720
9722
|
|
|
9721
9723
|
const PayssionButton = React.forwardRef((props, ref) => {
|
|
9722
9724
|
const { className, children = (jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsx(IconPayssionPay, {}), "Payssion"] })), onClick, payssionUrl: propsPayssionUrl, createOrder, maskProps, ...others } = props;
|
|
@@ -9902,7 +9904,7 @@
|
|
|
9902
9904
|
}, [formHtml]);
|
|
9903
9905
|
return null; // 这个组件不渲染任何内容
|
|
9904
9906
|
};
|
|
9905
|
-
var MAlipay = React.memo(MAlipayAutoSubmit);
|
|
9907
|
+
var MAlipay$1 = React.memo(MAlipayAutoSubmit);
|
|
9906
9908
|
|
|
9907
9909
|
const MAlipayButton = React.forwardRef((props, ref) => {
|
|
9908
9910
|
const { className, children = (jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsx(IconAlipay, {}), "\u652F\u4ED8\u5B9D\u652F\u4ED8"] })), onClick, formHtml: propsFormHtml, createOrder, displayType = 'modal', modalProps, maskProps, ...others } = props;
|
|
@@ -9969,7 +9971,7 @@
|
|
|
9969
9971
|
}
|
|
9970
9972
|
return showMask;
|
|
9971
9973
|
}, [displayType, showModal, showMask]);
|
|
9972
|
-
return (jsxRuntimeExports.jsxs(React.Fragment, { children: [jsxRuntimeExports.jsx(Button, { ref: mAlipayButtonRef, className: cs(getPrefixCls('m-alipay-btn'), className), onClick: handleClick, ...omit(others, ['displayType', 'displayProps']), children: children }), isShowAutoSubmit && formHtmlString && (jsxRuntimeExports.jsx(MAlipay, { formHtml: formHtmlString })), displayType === 'modal' && formHtmlString && (jsxRuntimeExports.jsx(ConfirmModal, { visible: showModal, retryButtonProps: {
|
|
9974
|
+
return (jsxRuntimeExports.jsxs(React.Fragment, { children: [jsxRuntimeExports.jsx(Button, { ref: mAlipayButtonRef, className: cs(getPrefixCls('m-alipay-btn'), className), onClick: handleClick, ...omit(others, ['displayType', 'displayProps']), children: children }), isShowAutoSubmit && formHtmlString && (jsxRuntimeExports.jsx(MAlipay$1, { formHtml: formHtmlString })), displayType === 'modal' && formHtmlString && (jsxRuntimeExports.jsx(ConfirmModal, { visible: showModal, retryButtonProps: {
|
|
9973
9975
|
onClick: handleRetry,
|
|
9974
9976
|
...omit(retryButtonProps || {}, ['onClick']),
|
|
9975
9977
|
}, finishButtonProps: {
|
|
@@ -9983,8 +9985,9 @@
|
|
|
9983
9985
|
MAlipayButton.displayName = 'MAlipayButton';
|
|
9984
9986
|
var MAlipayButton$1 = React.memo(MAlipayButton);
|
|
9985
9987
|
|
|
9986
|
-
const MAlipayComponent = MAlipay
|
|
9987
|
-
|
|
9988
|
+
const MAlipayComponent = Object.assign(MAlipay$1, {
|
|
9989
|
+
Button: MAlipayButton$1,
|
|
9990
|
+
});
|
|
9988
9991
|
|
|
9989
9992
|
const classPrefix$2 = getPrefixCls('fullscreen-loading');
|
|
9990
9993
|
const FullScreenLoading = ({ loading = false, text = 'Loading...', children, fullscreen = true, className = '', size = 'default', type = 'circle', }) => {
|
|
@@ -10059,7 +10062,7 @@
|
|
|
10059
10062
|
const [loading, setLoading] = React.useState(true);
|
|
10060
10063
|
return (jsxRuntimeExports.jsx(FullScreenLoading, { loading: loading, type: 'spin-dots', text: null, fullscreen: false, children: jsxRuntimeExports.jsxs("div", { className: cs(classPrefix$1, wrapperClassName), style: { position: 'relative', ...wrapperStyle }, children: [jsxRuntimeExports.jsx("iframe", { srcDoc: formHtml, className: cs(`${classPrefix$1}__iframe`, iframeClassName), style: { width: 210, height: 210, border: 'none', ...iframeStyle }, title: "alipay-qrcode", scrolling: "no", onLoad: () => setLoading(false) }), !!tipText && jsxRuntimeExports.jsx("span", { className: `${classPrefix$1}__tip`, children: tipText })] }) }));
|
|
10061
10064
|
};
|
|
10062
|
-
var Alipay = React.memo(AlipayQrIframe);
|
|
10065
|
+
var Alipay$1 = React.memo(AlipayQrIframe);
|
|
10063
10066
|
|
|
10064
10067
|
const AlipayModal = React.forwardRef((props, ref) => {
|
|
10065
10068
|
const { alipayProps: propsAlipayProps, visible, onClose, ...others } = props;
|
|
@@ -10087,7 +10090,7 @@
|
|
|
10087
10090
|
setUncontrolledVisible(false);
|
|
10088
10091
|
}
|
|
10089
10092
|
onClose?.();
|
|
10090
|
-
}, ...others, children: _alipayProps && jsxRuntimeExports.jsx(Alipay, { ..._alipayProps }) }));
|
|
10093
|
+
}, ...others, children: _alipayProps && jsxRuntimeExports.jsx(Alipay$1, { ..._alipayProps }) }));
|
|
10091
10094
|
});
|
|
10092
10095
|
AlipayModal.displayName = 'AlipayModal';
|
|
10093
10096
|
var AlipayModal$1 = React.memo(AlipayModal);
|
|
@@ -10130,9 +10133,10 @@
|
|
|
10130
10133
|
AlipayButton.displayName = 'AlipayButton';
|
|
10131
10134
|
var AlipayButton$1 = React.memo(AlipayButton);
|
|
10132
10135
|
|
|
10133
|
-
const AlipayComponent = Alipay
|
|
10134
|
-
|
|
10135
|
-
|
|
10136
|
+
const AlipayComponent = Object.assign(Alipay$1, {
|
|
10137
|
+
Button: AlipayButton$1,
|
|
10138
|
+
Modal: AlipayModal$1,
|
|
10139
|
+
});
|
|
10136
10140
|
|
|
10137
10141
|
var server = {};
|
|
10138
10142
|
|
|
@@ -16477,7 +16481,7 @@
|
|
|
16477
16481
|
}
|
|
16478
16482
|
return (jsxRuntimeExports.jsxs("div", { className: cs(classPrefix, className), style: style, children: [jsxRuntimeExports.jsx("div", { className: `${classPrefix}__container`, children: jsxRuntimeExports.jsx("img", { className: `${classPrefix}__image`, src: imageUrl, alt: '微信支付二维码' }) }), tipText && jsxRuntimeExports.jsx("span", { className: `${classPrefix}__tip`, children: tipText })] }));
|
|
16479
16483
|
};
|
|
16480
|
-
var Wechat = React.memo(WechatQrCode);
|
|
16484
|
+
var Wechat$1 = React.memo(WechatQrCode);
|
|
16481
16485
|
|
|
16482
16486
|
const WechatModal = React.forwardRef((props, ref) => {
|
|
16483
16487
|
const { wechatProps: propsWechatProps, visible, onClose, ...others } = props;
|
|
@@ -16505,7 +16509,7 @@
|
|
|
16505
16509
|
setUncontrolledVisible(false);
|
|
16506
16510
|
}
|
|
16507
16511
|
onClose?.();
|
|
16508
|
-
}, ...others, children: _wechatProps?.wechatUrl && jsxRuntimeExports.jsx(Wechat, { ..._wechatProps }) }));
|
|
16512
|
+
}, ...others, children: _wechatProps?.wechatUrl && jsxRuntimeExports.jsx(Wechat$1, { ..._wechatProps }) }));
|
|
16509
16513
|
});
|
|
16510
16514
|
WechatModal.displayName = 'WechatModal';
|
|
16511
16515
|
var WechatModal$1 = React.memo(WechatModal);
|
|
@@ -16546,9 +16550,10 @@
|
|
|
16546
16550
|
WechatButton.displayName = 'WechatButton';
|
|
16547
16551
|
var WechatButton$1 = React.memo(WechatButton);
|
|
16548
16552
|
|
|
16549
|
-
const WechatComponent = Wechat
|
|
16550
|
-
|
|
16551
|
-
|
|
16553
|
+
const WechatComponent = Object.assign(Wechat$1, {
|
|
16554
|
+
Button: WechatButton$1,
|
|
16555
|
+
Modal: WechatModal$1,
|
|
16556
|
+
});
|
|
16552
16557
|
|
|
16553
16558
|
const PayButton = React.forwardRef((props, ref) => {
|
|
16554
16559
|
const typedRef = ref;
|
|
@@ -16583,15 +16588,48 @@
|
|
|
16583
16588
|
PayButton.displayName = 'PayButton';
|
|
16584
16589
|
var index = React.memo(PayButton);
|
|
16585
16590
|
|
|
16586
|
-
|
|
16587
|
-
|
|
16588
|
-
|
|
16591
|
+
const Stripe = Object.assign(StripeComponent, {
|
|
16592
|
+
Button: StripeButton$1,
|
|
16593
|
+
Popup: StripePopup$1,
|
|
16594
|
+
Modal: StripeModal$1,
|
|
16595
|
+
});
|
|
16596
|
+
const Airwallex = Object.assign(AirwallexComponent, {
|
|
16597
|
+
Button: AirwallexButton$1,
|
|
16598
|
+
Popup: AirwallexPopup,
|
|
16599
|
+
Modal: AirwallexModal,
|
|
16600
|
+
});
|
|
16601
|
+
const MAlipay = Object.assign(MAlipayComponent, {
|
|
16602
|
+
Button: MAlipayButton$1,
|
|
16603
|
+
});
|
|
16604
|
+
const Alipay = Object.assign(AlipayComponent, {
|
|
16605
|
+
Button: AlipayButton$1,
|
|
16606
|
+
Modal: AlipayModal$1,
|
|
16607
|
+
});
|
|
16608
|
+
const Wechat = Object.assign(WechatComponent, {
|
|
16609
|
+
Button: WechatButton$1,
|
|
16610
|
+
Modal: WechatModal$1,
|
|
16611
|
+
});
|
|
16612
|
+
|
|
16613
|
+
exports.Airwallex = Airwallex;
|
|
16614
|
+
exports.AirwallexButton = AirwallexButton$1;
|
|
16615
|
+
exports.AirwallexModal = AirwallexModal;
|
|
16616
|
+
exports.AirwallexPopup = AirwallexPopup;
|
|
16617
|
+
exports.Alipay = Alipay;
|
|
16618
|
+
exports.AlipayButton = AlipayButton$1;
|
|
16619
|
+
exports.AlipayModal = AlipayModal$1;
|
|
16620
|
+
exports.MAlipay = MAlipay;
|
|
16621
|
+
exports.MAlipayButton = MAlipayButton$1;
|
|
16589
16622
|
exports.MWechatButton = MWechatButton$1;
|
|
16590
16623
|
exports.PayButton = index;
|
|
16591
16624
|
exports.PaypalButton = PaypalButton$1;
|
|
16592
16625
|
exports.PayssionButton = PayssionButton$1;
|
|
16593
|
-
exports.Stripe =
|
|
16594
|
-
exports.
|
|
16626
|
+
exports.Stripe = Stripe;
|
|
16627
|
+
exports.StripeButton = StripeButton$1;
|
|
16628
|
+
exports.StripeModal = StripeModal$1;
|
|
16629
|
+
exports.StripePopup = StripePopup$1;
|
|
16630
|
+
exports.Wechat = Wechat;
|
|
16631
|
+
exports.WechatButton = WechatButton$1;
|
|
16632
|
+
exports.WechatModal = WechatModal$1;
|
|
16595
16633
|
|
|
16596
16634
|
}));
|
|
16597
16635
|
//# sourceMappingURL=pay-sdk-react.umd.js.map
|