pay-sdk-react 1.1.0 → 1.1.1
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/airwallex-modal.d.ts +4 -4
- package/dist/es/Airwallex/airwallex-modal.js +6 -6
- package/dist/es/Airwallex/airwallex-popup.d.ts +5 -5
- package/dist/es/Airwallex/airwallex-popup.js +13 -13
- package/dist/es/Airwallex/airwallex.d.ts +5 -5
- package/dist/es/Airwallex/airwallex.js +18 -24
- package/dist/es/Airwallex/interface.d.ts +59 -10
- package/dist/es/Alipay/alipay-button.d.ts +3 -3
- package/dist/es/Alipay/alipay-button.js +2 -2
- package/dist/es/Alipay/alipay-modal.d.ts +5 -5
- package/dist/es/Alipay/alipay-modal.js +5 -5
- package/dist/es/Alipay/alipay.d.ts +2 -2
- package/dist/es/Alipay/alipay.js +11 -9
- package/dist/es/Alipay/interface.d.ts +31 -10
- package/dist/es/Button/button.d.ts +1 -1
- package/dist/es/Button/interface.d.ts +61 -10
- package/dist/es/MAlipay/interface.d.ts +1 -6
- package/dist/es/MAlipay/m-alipay-auto-submit.d.ts +2 -2
- package/dist/es/MAlipay/m-alipay-auto-submit.js +2 -2
- package/dist/es/MAlipay/m-alipay-button.d.ts +3 -3
- package/dist/es/MAlipay/m-alipay-button.js +2 -2
- package/dist/es/MWeChat/interface.d.ts +1 -1
- package/dist/es/MWeChat/m-wechat-button.d.ts +3 -3
- package/dist/es/MWeChat/m-wechat-button.js +2 -2
- package/dist/es/Mask/interface.d.ts +6 -6
- package/dist/es/PayButton/index.d.ts +2 -2
- package/dist/es/PayButton/index.js +2 -2
- package/dist/es/Paypal/interface.d.ts +1 -1
- package/dist/es/Paypal/paypal-button.d.ts +3 -3
- package/dist/es/Paypal/paypal-button.js +2 -2
- package/dist/es/Payssion/interface.d.ts +1 -1
- package/dist/es/Payssion/payssion-button.d.ts +3 -3
- package/dist/es/Payssion/payssion-button.js +2 -2
- package/dist/es/Stripe/interface.d.ts +3 -3
- package/dist/es/Stripe/stripe-modal.d.ts +5 -5
- package/dist/es/Stripe/stripe-modal.js +3 -3
- package/dist/es/Stripe/stripe-popup.d.ts +4 -4
- package/dist/es/Stripe/stripe-popup.js +2 -2
- package/dist/es/Wechat/wechat-button.d.ts +3 -3
- package/dist/es/Wechat/wechat-button.js +2 -2
- package/dist/es/Wechat/wechat-modal.d.ts +6 -6
- package/dist/es/Wechat/wechat-modal.js +6 -6
- package/dist/es/Wechat/wechat.d.ts +2 -2
- package/dist/es/Wechat/wechat.js +2 -2
- package/dist/es/dot-loading/interface.d.ts +6 -2
- package/dist/es/index.d.ts +1 -1
- package/dist/lib/Airwallex/airwallex-modal.js +9 -8
- package/dist/lib/Airwallex/airwallex-popup.js +13 -12
- package/dist/lib/Airwallex/airwallex.js +18 -23
- package/dist/lib/Alipay/alipay-button.js +1 -1
- package/dist/lib/Alipay/alipay-modal.js +2 -2
- package/dist/lib/Alipay/alipay.js +10 -8
- package/dist/lib/MAlipay/m-alipay-auto-submit.js +1 -1
- package/dist/lib/MAlipay/m-alipay-button.js +1 -1
- package/dist/lib/MWeChat/m-wechat-button.js +1 -1
- package/dist/lib/PayButton/index.js +3 -2
- package/dist/lib/Paypal/paypal-button.js +1 -1
- package/dist/lib/Payssion/payssion-button.js +1 -1
- package/dist/lib/Stripe/stripe-modal.js +6 -5
- package/dist/lib/Stripe/stripe-popup.js +5 -4
- package/dist/lib/Wechat/wechat-button.js +1 -1
- package/dist/lib/Wechat/wechat-modal.js +7 -6
- package/dist/lib/Wechat/wechat.js +1 -1
- package/dist/umd/pay-sdk-react.umd.js +65 -58
- package/dist/umd/pay-sdk-react.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@ const _excluded = ["className", "children", "onClick", "formHtml", "createOrder"
|
|
|
4
4
|
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); }
|
|
5
5
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
6
6
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
7
|
-
import React, { forwardRef, useCallback, useImperativeHandle, useMemo, useRef, useState } from 'react';
|
|
7
|
+
import React, { forwardRef, memo, useCallback, useImperativeHandle, useMemo, useRef, useState } from 'react';
|
|
8
8
|
import cs from '../utils/classNames';
|
|
9
9
|
import MAlipayAutoSubmit from './m-alipay-auto-submit';
|
|
10
10
|
import ConfirmModal from '../confirm-modal';
|
|
@@ -124,4 +124,4 @@ const MAlipayButton = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
124
124
|
}, restMaskProps)));
|
|
125
125
|
});
|
|
126
126
|
MAlipayButton.displayName = 'MAlipayButton';
|
|
127
|
-
export default MAlipayButton;
|
|
127
|
+
export default /*#__PURE__*/memo(MAlipayButton);
|
|
@@ -2,7 +2,7 @@ import { ButtonProps, ButtonRef } from '../Button';
|
|
|
2
2
|
import { PayMaskProps } from '../PayMask';
|
|
3
3
|
import { ConfirmModalProps } from '../confirm-modal';
|
|
4
4
|
/**
|
|
5
|
-
* @version 1.
|
|
5
|
+
* @version 1.1.0
|
|
6
6
|
* @description
|
|
7
7
|
* @zh Paypal 组件属性定义
|
|
8
8
|
* @en Props for Paypal component
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { MWeChatButtonProps } from './interface';
|
|
3
|
-
declare const
|
|
3
|
+
declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<MWeChatButtonProps & {
|
|
4
4
|
children?: React.ReactNode;
|
|
5
|
-
} & React.RefAttributes<import("../Button").ButtonRef
|
|
6
|
-
export default
|
|
5
|
+
} & React.RefAttributes<import("../Button").ButtonRef>>>;
|
|
6
|
+
export default _default;
|
|
@@ -4,7 +4,7 @@ const _excluded = ["className", "children", "onClick", "wechatUrl", "createOrder
|
|
|
4
4
|
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); }
|
|
5
5
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
6
6
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
7
|
-
import React, { forwardRef, useCallback, useImperativeHandle, useRef, useState } from 'react';
|
|
7
|
+
import React, { forwardRef, memo, useCallback, useImperativeHandle, useRef, useState } from 'react';
|
|
8
8
|
import cs from '../utils/classNames';
|
|
9
9
|
import PayMask from '../PayMask';
|
|
10
10
|
import ConfirmModal from '../confirm-modal';
|
|
@@ -114,4 +114,4 @@ const MWechatButton = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
114
114
|
}, modalPropsOthers)));
|
|
115
115
|
});
|
|
116
116
|
MWechatButton.displayName = 'MWechatButton';
|
|
117
|
-
export default MWechatButton;
|
|
117
|
+
export default /*#__PURE__*/memo(MWechatButton);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { PropagationEvent } from
|
|
3
|
-
import { GetContainer } from
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PropagationEvent } from '../utils/with-stop-propagation';
|
|
3
|
+
import { GetContainer } from '../utils/render-to-container';
|
|
4
4
|
/**
|
|
5
|
-
* @version 1.
|
|
5
|
+
* @version 1.1.0
|
|
6
6
|
* @description
|
|
7
7
|
* @zh 蒙层组件属性定义
|
|
8
8
|
* @en Props for Mask component
|
|
@@ -52,12 +52,12 @@ export interface MaskProps {
|
|
|
52
52
|
* @zh 蒙层颜色
|
|
53
53
|
* @en Mask color
|
|
54
54
|
*/
|
|
55
|
-
color?:
|
|
55
|
+
color?: 'white' | 'black' | (string & {});
|
|
56
56
|
/**
|
|
57
57
|
* @zh 蒙层透明度
|
|
58
58
|
* @en Mask opacity
|
|
59
59
|
*/
|
|
60
|
-
opacity?:
|
|
60
|
+
opacity?: 'default' | 'thin' | 'thick' | number;
|
|
61
61
|
/**
|
|
62
62
|
* @zh 挂载容器
|
|
63
63
|
* @en Mount container
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { PayButtonProps } from './interface';
|
|
3
|
-
declare const PayButton: React.ForwardRefExoticComponent<React.PropsWithChildren<PayButtonProps> & React.RefAttributes<import("../Button").ButtonRef>>;
|
|
4
3
|
export * from './interface';
|
|
5
|
-
|
|
4
|
+
declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<React.PropsWithChildren<PayButtonProps> & React.RefAttributes<import("../Button").ButtonRef>>>;
|
|
5
|
+
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
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); }
|
|
2
|
-
import React from 'react';
|
|
2
|
+
import React, { memo } from 'react';
|
|
3
3
|
import { PaymentMethod } from '../shared';
|
|
4
4
|
import { PaypalButton } from '../Paypal';
|
|
5
5
|
import Stripe from '../Stripe';
|
|
@@ -54,4 +54,4 @@ const PayButton = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
54
54
|
});
|
|
55
55
|
PayButton.displayName = 'PayButton';
|
|
56
56
|
export * from './interface';
|
|
57
|
-
export default PayButton;
|
|
57
|
+
export default /*#__PURE__*/memo(PayButton);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { PaypalButtonProps } from './interface';
|
|
3
|
-
declare const
|
|
3
|
+
declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<PaypalButtonProps & {
|
|
4
4
|
children?: React.ReactNode;
|
|
5
|
-
} & React.RefAttributes<import("../Button").ButtonRef
|
|
6
|
-
export default
|
|
5
|
+
} & React.RefAttributes<import("../Button").ButtonRef>>>;
|
|
6
|
+
export default _default;
|
|
@@ -3,7 +3,7 @@ const _excluded = ["className", "children", "onClick", "paypalUrl", "createOrder
|
|
|
3
3
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
4
4
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
5
5
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
6
|
-
import React, { forwardRef, useCallback, useImperativeHandle, useRef, useState } from 'react';
|
|
6
|
+
import React, { forwardRef, memo, useCallback, useImperativeHandle, useRef, useState } from 'react';
|
|
7
7
|
import { IconPaypalText, IconPaypalWhite } from '../icons';
|
|
8
8
|
import cs from '../utils/classNames';
|
|
9
9
|
import PayMask from '../PayMask';
|
|
@@ -72,4 +72,4 @@ const PaypalButton = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
72
72
|
}, restMaskProps)));
|
|
73
73
|
});
|
|
74
74
|
PaypalButton.displayName = 'PaypalButton';
|
|
75
|
-
export default PaypalButton;
|
|
75
|
+
export default /*#__PURE__*/memo(PaypalButton);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { PayssionButtonProps } from './interface';
|
|
3
|
-
declare const
|
|
3
|
+
declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<PayssionButtonProps & {
|
|
4
4
|
children?: React.ReactNode;
|
|
5
|
-
} & React.RefAttributes<import("../Button").ButtonRef
|
|
6
|
-
export default
|
|
5
|
+
} & React.RefAttributes<import("../Button").ButtonRef>>>;
|
|
6
|
+
export default _default;
|
|
@@ -3,7 +3,7 @@ const _excluded = ["className", "children", "onClick", "payssionUrl", "createOrd
|
|
|
3
3
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
4
4
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
5
5
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
6
|
-
import React, { forwardRef, useCallback, useImperativeHandle, useRef, useState } from 'react';
|
|
6
|
+
import React, { forwardRef, memo, useCallback, useImperativeHandle, useRef, useState } from 'react';
|
|
7
7
|
import cs from '../utils/classNames';
|
|
8
8
|
import PayMask from '../PayMask';
|
|
9
9
|
import Button from '../Button';
|
|
@@ -72,4 +72,4 @@ const PayssionButton = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
72
72
|
}, restMaskProps)));
|
|
73
73
|
});
|
|
74
74
|
PayssionButton.displayName = 'PayssionButton';
|
|
75
|
-
export default PayssionButton;
|
|
75
|
+
export default /*#__PURE__*/memo(PayssionButton);
|
|
@@ -15,14 +15,14 @@ export interface BasesStripeProps {
|
|
|
15
15
|
stripeKey: string;
|
|
16
16
|
}
|
|
17
17
|
/**
|
|
18
|
-
* @version 1.
|
|
18
|
+
* @version 1.1.0
|
|
19
19
|
* @description
|
|
20
20
|
* @zh Stripe 组件属性定义,包含基础属性和原生 div 属性
|
|
21
21
|
* @en Props for Stripe component, including base props and native div attributes
|
|
22
22
|
*/
|
|
23
23
|
export type StripeProps = BasesStripeProps & HTMLAttributes<HTMLDivElement>;
|
|
24
24
|
/**
|
|
25
|
-
* @version 1.
|
|
25
|
+
* @version 1.1.0
|
|
26
26
|
* @description
|
|
27
27
|
* @zh Stripe 弹窗组件属性定义
|
|
28
28
|
* @en Props for Stripe popup component
|
|
@@ -35,7 +35,7 @@ export interface StripePopupProps extends PayPopupBaseProps {
|
|
|
35
35
|
stripeProps?: BasesStripeProps;
|
|
36
36
|
}
|
|
37
37
|
/**
|
|
38
|
-
* @version 1.
|
|
38
|
+
* @version 1.1.0
|
|
39
39
|
* @description
|
|
40
40
|
* @zh Stripe 弹窗组件 Ref 实例方法
|
|
41
41
|
* @en Ref methods for Stripe popup component
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { StripeModalProps } from './interface';
|
|
3
|
-
declare const
|
|
4
|
-
children?:
|
|
5
|
-
} &
|
|
6
|
-
export default
|
|
3
|
+
declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<StripeModalProps & {
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
} & React.RefAttributes<import("./interface").StripePopupRef>>>;
|
|
6
|
+
export default _default;
|
|
@@ -2,12 +2,12 @@ const _excluded = ["stripeProps", "visible", "onClose", "className"];
|
|
|
2
2
|
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); }
|
|
3
3
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
4
4
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
5
|
-
import {
|
|
5
|
+
import React, { memo, useImperativeHandle, useRef, useState } from 'react';
|
|
6
6
|
import cs from '../utils/classNames';
|
|
7
7
|
import PayModal from '../pay-modal';
|
|
8
8
|
import Stripe from './stripe';
|
|
9
9
|
import { getPrefixCls } from '../utils/getPrefixCls';
|
|
10
|
-
const StripeModal = /*#__PURE__*/forwardRef((props, ref) => {
|
|
10
|
+
const StripeModal = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
11
11
|
const {
|
|
12
12
|
stripeProps: propsStripeProps,
|
|
13
13
|
visible,
|
|
@@ -47,4 +47,4 @@ const StripeModal = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
47
47
|
}, rest), _stripeProps && /*#__PURE__*/React.createElement(Stripe, _stripeProps));
|
|
48
48
|
});
|
|
49
49
|
StripeModal.displayName = 'StripeModal';
|
|
50
|
-
export default StripeModal;
|
|
50
|
+
export default /*#__PURE__*/memo(StripeModal);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { StripePopupProps, StripePopupRef } from './interface';
|
|
3
|
-
declare const _default:
|
|
4
|
-
children?:
|
|
5
|
-
} &
|
|
3
|
+
declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<StripePopupProps & {
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
} & React.RefAttributes<StripePopupRef>>>;
|
|
6
6
|
export default _default;
|
|
@@ -7,12 +7,12 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
7
7
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
8
8
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
9
9
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
10
|
-
import {
|
|
10
|
+
import React, { memo, useImperativeHandle, useRef, useState } from 'react';
|
|
11
11
|
import cs from '../utils/classNames';
|
|
12
12
|
import Stripe from '.';
|
|
13
13
|
import PayPopup from '../pay-popup';
|
|
14
14
|
import { getPrefixCls } from '../utils/getPrefixCls';
|
|
15
|
-
const StripePopup = /*#__PURE__*/forwardRef((props, ref) => {
|
|
15
|
+
const StripePopup = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
16
16
|
const {
|
|
17
17
|
visible: controlledVisible,
|
|
18
18
|
onClose,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { WechatButtonProps } from './interface';
|
|
3
|
-
declare const
|
|
3
|
+
declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<WechatButtonProps & {
|
|
4
4
|
children?: React.ReactNode;
|
|
5
|
-
} & React.RefAttributes<import("../Button").ButtonRef
|
|
6
|
-
export default
|
|
5
|
+
} & React.RefAttributes<import("../Button").ButtonRef>>>;
|
|
6
|
+
export default _default;
|
|
@@ -2,7 +2,7 @@ const _excluded = ["className", "children", "onClick", "createOrder", "modalProp
|
|
|
2
2
|
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); }
|
|
3
3
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
4
4
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
5
|
-
import React, { forwardRef, useCallback, useImperativeHandle, useRef } from 'react';
|
|
5
|
+
import React, { forwardRef, memo, useCallback, useImperativeHandle, useRef } from 'react';
|
|
6
6
|
import cs from '../utils/classNames';
|
|
7
7
|
import WechatModal from './wechat-modal';
|
|
8
8
|
import Button from '../Button';
|
|
@@ -47,4 +47,4 @@ const WechatButton = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
47
47
|
}, modalProps)));
|
|
48
48
|
});
|
|
49
49
|
WechatButton.displayName = 'WechatButton';
|
|
50
|
-
export default WechatButton;
|
|
50
|
+
export default /*#__PURE__*/memo(WechatButton);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
import { WechatModalProps, WechatModalRef } from
|
|
3
|
-
declare const
|
|
4
|
-
children?:
|
|
5
|
-
} &
|
|
6
|
-
export default
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { WechatModalProps, WechatModalRef } from './interface';
|
|
3
|
+
declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<WechatModalProps & {
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
} & React.RefAttributes<WechatModalRef>>>;
|
|
6
|
+
export default _default;
|
|
@@ -2,10 +2,10 @@ const _excluded = ["wechatProps", "visible", "onClose"];
|
|
|
2
2
|
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); }
|
|
3
3
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
4
4
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
5
|
-
import {
|
|
6
|
-
import PayModal from
|
|
7
|
-
import Wechat from
|
|
8
|
-
const WechatModal = /*#__PURE__*/forwardRef((props, ref) => {
|
|
5
|
+
import React, { memo, useImperativeHandle, useRef, useState } from 'react';
|
|
6
|
+
import PayModal from '../pay-modal';
|
|
7
|
+
import Wechat from './wechat';
|
|
8
|
+
const WechatModal = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
9
9
|
const {
|
|
10
10
|
wechatProps: propsWechatProps,
|
|
11
11
|
visible,
|
|
@@ -41,5 +41,5 @@ const WechatModal = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
41
41
|
}
|
|
42
42
|
}, others), (_wechatProps === null || _wechatProps === void 0 ? void 0 : _wechatProps.wechatUrl) && /*#__PURE__*/React.createElement(Wechat, _wechatProps));
|
|
43
43
|
});
|
|
44
|
-
WechatModal.displayName =
|
|
45
|
-
export default WechatModal;
|
|
44
|
+
WechatModal.displayName = 'WechatModal';
|
|
45
|
+
export default /*#__PURE__*/memo(WechatModal);
|
package/dist/es/Wechat/wechat.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useEffect, useState } from 'react';
|
|
1
|
+
import React, { memo, useEffect, useState } from 'react';
|
|
2
2
|
import cs from '../utils/classNames';
|
|
3
3
|
import makeQrcode from '../utils/qrcode';
|
|
4
4
|
import { getPrefixCls } from '../utils/getPrefixCls';
|
|
@@ -37,4 +37,4 @@ const WechatQrCode = _ref => {
|
|
|
37
37
|
className: "".concat(classPrefix, "__tip")
|
|
38
38
|
}, tipText));
|
|
39
39
|
};
|
|
40
|
-
export default WechatQrCode;
|
|
40
|
+
export default /*#__PURE__*/memo(WechatQrCode);
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import type { NativeProps } from
|
|
1
|
+
import type { NativeProps } from '../utils/native-props';
|
|
2
2
|
export type DotLoadingProps = {
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* @zh 颜色
|
|
5
|
+
* @en Color
|
|
6
|
+
*/
|
|
7
|
+
color?: 'default' | 'primary' | 'white' | (string & {});
|
|
4
8
|
} & NativeProps;
|
package/dist/es/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export type { PaypalButtonProps, PaypalButtonRef, CreateOrderPaypalFn, PaypalSec
|
|
|
2
2
|
export { PaypalButton } from './Paypal';
|
|
3
3
|
export type { BasesStripeProps, StripeProps, StripePopupProps, StripePopupRef, StripeButtonProps, StripeButtonRef, CreateOrderStripeFn, StripeModalRef, } from './Stripe/interface';
|
|
4
4
|
export { default as Stripe } from './Stripe';
|
|
5
|
-
export type { AirwallexProps, AirwallexPopupProps, AirwallexPopupRef, AirwallexButtonProps, AirwallexButtonRef,
|
|
5
|
+
export type { AirwallexProps, AirwallexPopupProps, AirwallexPopupRef, AirwallexButtonProps, AirwallexButtonRef, CreateOrderAirwallexEmbeddedFn, CreateOrderAirwallexRedirectFn, AirwallexModalProps, AirwallexModalRef, } from './Airwallex/interface';
|
|
6
6
|
export { default as Airwallex } from './Airwallex';
|
|
7
7
|
export type { PayssionButtonProps, PayssionButtonRef, CreateOrderPayssionFn, PayssionSecretMap, } from './Payssion/interface';
|
|
8
8
|
export { PayssionButton } from './Payssion';
|
|
@@ -4,16 +4,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var _react = require("react");
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _payModal = _interopRequireDefault(require("../pay-modal"));
|
|
9
9
|
var _airwallex = _interopRequireDefault(require("./airwallex"));
|
|
10
10
|
var _omit = _interopRequireDefault(require("../utils/omit"));
|
|
11
11
|
const _excluded = ["airwallexProps", "visible", "onClose", "footer"];
|
|
12
12
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
+
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
14
|
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); }
|
|
14
15
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
15
16
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
16
|
-
const AirwallexModal = /*#__PURE__*/
|
|
17
|
+
const AirwallexModal = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
17
18
|
const {
|
|
18
19
|
airwallexProps: propsAirwallexProps,
|
|
19
20
|
visible,
|
|
@@ -40,7 +41,7 @@ const AirwallexModal = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
|
40
41
|
current: airwallexRef.current
|
|
41
42
|
}));
|
|
42
43
|
const _airwallexProps = propsAirwallexProps !== null && propsAirwallexProps !== void 0 ? propsAirwallexProps : airwallexProps;
|
|
43
|
-
return /*#__PURE__*/
|
|
44
|
+
return /*#__PURE__*/_react.default.createElement(_payModal.default, _extends({
|
|
44
45
|
visible: _visible,
|
|
45
46
|
onClose: () => {
|
|
46
47
|
if (!isControlled) {
|
|
@@ -49,20 +50,20 @@ const AirwallexModal = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
|
49
50
|
onClose === null || onClose === void 0 || onClose();
|
|
50
51
|
},
|
|
51
52
|
footer: footer
|
|
52
|
-
}, rest), _airwallexProps && /*#__PURE__*/
|
|
53
|
-
onSuccess:
|
|
53
|
+
}, rest), _airwallexProps && /*#__PURE__*/_react.default.createElement(_airwallex.default, _extends({
|
|
54
|
+
onSuccess: event => {
|
|
54
55
|
var _airwallexProps$onSuc;
|
|
55
56
|
if (!isControlled) {
|
|
56
57
|
setUncontrolledVisible(false);
|
|
57
58
|
}
|
|
58
|
-
_airwallexProps === null || _airwallexProps === void 0 || (_airwallexProps$onSuc = _airwallexProps.onSuccess) === null || _airwallexProps$onSuc === void 0 || _airwallexProps$onSuc.call(_airwallexProps);
|
|
59
|
+
_airwallexProps === null || _airwallexProps === void 0 || (_airwallexProps$onSuc = _airwallexProps.onSuccess) === null || _airwallexProps$onSuc === void 0 || _airwallexProps$onSuc.call(_airwallexProps, event);
|
|
59
60
|
},
|
|
60
|
-
onError:
|
|
61
|
+
onError: event => {
|
|
61
62
|
var _airwallexProps$onErr;
|
|
62
63
|
if (!isControlled) {
|
|
63
64
|
setUncontrolledVisible(false);
|
|
64
65
|
}
|
|
65
|
-
_airwallexProps === null || _airwallexProps === void 0 || (_airwallexProps$onErr = _airwallexProps.onError) === null || _airwallexProps$onErr === void 0 || _airwallexProps$onErr.call(_airwallexProps);
|
|
66
|
+
_airwallexProps === null || _airwallexProps === void 0 || (_airwallexProps$onErr = _airwallexProps.onError) === null || _airwallexProps$onErr === void 0 || _airwallexProps$onErr.call(_airwallexProps, event);
|
|
66
67
|
}
|
|
67
68
|
}, (0, _omit.default)(_airwallexProps, ['onSuccess', 'onError']))));
|
|
68
69
|
});
|
|
@@ -4,12 +4,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var _react = require("react");
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _airwallex = _interopRequireDefault(require("./airwallex"));
|
|
9
9
|
var _payPopup = _interopRequireDefault(require("../pay-popup"));
|
|
10
10
|
var _omit = _interopRequireDefault(require("../utils/omit"));
|
|
11
11
|
const _excluded = ["visible", "onClose", "closeOnMaskClick", "bodyStyle", "airwallexProps"];
|
|
12
12
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
+
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
14
|
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); }
|
|
14
15
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
15
16
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
@@ -18,7 +19,7 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
18
19
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
19
20
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
20
21
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
21
|
-
const AirwallexPopup = /*#__PURE__*/
|
|
22
|
+
const AirwallexPopup = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
22
23
|
const {
|
|
23
24
|
visible: controlledVisible,
|
|
24
25
|
onClose,
|
|
@@ -46,7 +47,7 @@ const AirwallexPopup = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
|
46
47
|
},
|
|
47
48
|
current: airwallexRef.current
|
|
48
49
|
}));
|
|
49
|
-
return /*#__PURE__*/
|
|
50
|
+
return /*#__PURE__*/_react.default.createElement(_payPopup.default, _extends({
|
|
50
51
|
visible: visible,
|
|
51
52
|
closeOnMaskClick: closeOnMaskClick,
|
|
52
53
|
onClose: () => {
|
|
@@ -57,25 +58,25 @@ const AirwallexPopup = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
|
57
58
|
},
|
|
58
59
|
bodyStyle: _objectSpread({
|
|
59
60
|
padding: 12,
|
|
60
|
-
height:
|
|
61
|
-
overflowY:
|
|
61
|
+
height: '40vh',
|
|
62
|
+
overflowY: 'scroll'
|
|
62
63
|
}, bodyStyle)
|
|
63
|
-
}, others), _airwallexProps && /*#__PURE__*/
|
|
64
|
-
onSuccess:
|
|
64
|
+
}, others), _airwallexProps && /*#__PURE__*/_react.default.createElement(_airwallex.default, _extends({
|
|
65
|
+
onSuccess: event => {
|
|
65
66
|
var _airwallexProps$onSuc;
|
|
66
67
|
if (!isControlled) {
|
|
67
68
|
setUncontrolledVisible(false);
|
|
68
69
|
}
|
|
69
|
-
_airwallexProps === null || _airwallexProps === void 0 || (_airwallexProps$onSuc = _airwallexProps.onSuccess) === null || _airwallexProps$onSuc === void 0 || _airwallexProps$onSuc.call(_airwallexProps);
|
|
70
|
+
_airwallexProps === null || _airwallexProps === void 0 || (_airwallexProps$onSuc = _airwallexProps.onSuccess) === null || _airwallexProps$onSuc === void 0 || _airwallexProps$onSuc.call(_airwallexProps, event);
|
|
70
71
|
},
|
|
71
|
-
onError:
|
|
72
|
+
onError: event => {
|
|
72
73
|
var _airwallexProps$onErr;
|
|
73
74
|
if (!isControlled) {
|
|
74
75
|
setUncontrolledVisible(false);
|
|
75
76
|
}
|
|
76
|
-
_airwallexProps === null || _airwallexProps === void 0 || (_airwallexProps$onErr = _airwallexProps.onError) === null || _airwallexProps$onErr === void 0 || _airwallexProps$onErr.call(_airwallexProps);
|
|
77
|
+
_airwallexProps === null || _airwallexProps === void 0 || (_airwallexProps$onErr = _airwallexProps.onError) === null || _airwallexProps$onErr === void 0 || _airwallexProps$onErr.call(_airwallexProps, event);
|
|
77
78
|
}
|
|
78
|
-
}, (0, _omit.default)(_airwallexProps, [
|
|
79
|
+
}, (0, _omit.default)(_airwallexProps, ['onSuccess', 'onError']))));
|
|
79
80
|
});
|
|
80
|
-
AirwallexPopup.displayName =
|
|
81
|
+
AirwallexPopup.displayName = 'AirwallexPopup';
|
|
81
82
|
var _default = exports.default = AirwallexPopup;
|
|
@@ -4,10 +4,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var _react = require("react");
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _airwallexPaymentElements = require("airwallex-payment-elements");
|
|
9
9
|
var _dom = require("../utils/dom");
|
|
10
10
|
const _excluded = ["type", "options", "initOptions", "style", "onReady", "onSuccess", "onError"];
|
|
11
|
+
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); }
|
|
11
12
|
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); }
|
|
12
13
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
13
14
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
@@ -18,7 +19,7 @@ function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i
|
|
|
18
19
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
19
20
|
const Airwallex = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
20
21
|
const {
|
|
21
|
-
type =
|
|
22
|
+
type = 'fullFeaturedCard',
|
|
22
23
|
options,
|
|
23
24
|
initOptions,
|
|
24
25
|
style,
|
|
@@ -31,12 +32,12 @@ const Airwallex = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
|
31
32
|
(0, _react.useImperativeHandle)(ref, () => airwallexRef.current);
|
|
32
33
|
(0, _react.useEffect)(() => {
|
|
33
34
|
(0, _airwallexPaymentElements.loadAirwallex)(_objectSpread({
|
|
34
|
-
env:
|
|
35
|
+
env: 'demo'
|
|
35
36
|
}, initOptions)).then(airwallex => {
|
|
36
37
|
if (airwallex) {
|
|
37
38
|
const cardElement = airwallex.createElement(type, options);
|
|
38
39
|
if (cardElement) {
|
|
39
|
-
cardElement.mount(type);
|
|
40
|
+
cardElement.mount(type);
|
|
40
41
|
}
|
|
41
42
|
}
|
|
42
43
|
});
|
|
@@ -44,40 +45,34 @@ const Airwallex = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
|
44
45
|
(0, _react.useEffect)(() => {
|
|
45
46
|
const el = _dom.clientDocument === null || _dom.clientDocument === void 0 ? void 0 : _dom.clientDocument.getElementById(type);
|
|
46
47
|
const onReady = event => {
|
|
47
|
-
|
|
48
|
-
console.log("onReady", event);
|
|
49
|
-
propsOnReady === null || propsOnReady === void 0 || propsOnReady();
|
|
48
|
+
propsOnReady === null || propsOnReady === void 0 || propsOnReady(event);
|
|
50
49
|
};
|
|
51
50
|
const onSuccess = event => {
|
|
52
|
-
|
|
53
|
-
console.log("onSuccess", event);
|
|
54
|
-
propsOnSuccess === null || propsOnSuccess === void 0 || propsOnSuccess();
|
|
51
|
+
propsOnSuccess === null || propsOnSuccess === void 0 || propsOnSuccess(event);
|
|
55
52
|
};
|
|
56
53
|
const onError = event => {
|
|
57
|
-
|
|
58
|
-
console.log("onError", event);
|
|
59
|
-
propsOnError === null || propsOnError === void 0 || propsOnError();
|
|
54
|
+
propsOnError === null || propsOnError === void 0 || propsOnError(event);
|
|
60
55
|
};
|
|
61
56
|
if (el) {
|
|
62
|
-
(0, _dom.on)(el,
|
|
63
|
-
(0, _dom.on)(el,
|
|
64
|
-
(0, _dom.on)(el,
|
|
57
|
+
(0, _dom.on)(el, 'onReady', onReady);
|
|
58
|
+
(0, _dom.on)(el, 'onSuccess', onSuccess);
|
|
59
|
+
(0, _dom.on)(el, 'onError', onError);
|
|
65
60
|
}
|
|
66
61
|
return () => {
|
|
67
62
|
if (el) {
|
|
68
|
-
(0, _dom.off)(el,
|
|
69
|
-
(0, _dom.off)(el,
|
|
70
|
-
(0, _dom.off)(el,
|
|
63
|
+
(0, _dom.off)(el, 'onReady', onReady);
|
|
64
|
+
(0, _dom.off)(el, 'onSuccess', onSuccess);
|
|
65
|
+
(0, _dom.off)(el, 'onError', onError);
|
|
71
66
|
}
|
|
72
67
|
};
|
|
73
68
|
}, [type, propsOnReady, propsOnSuccess, propsOnError]);
|
|
74
|
-
return /*#__PURE__*/
|
|
69
|
+
return /*#__PURE__*/_react.default.createElement("div", _extends({
|
|
75
70
|
ref: airwallexRef,
|
|
76
71
|
id: String(type),
|
|
77
72
|
style: _objectSpread({
|
|
78
|
-
width:
|
|
73
|
+
width: '100%'
|
|
79
74
|
}, style)
|
|
80
75
|
}, others));
|
|
81
76
|
});
|
|
82
|
-
Airwallex.displayName =
|
|
83
|
-
var _default = exports.default = /*#__PURE__*/
|
|
77
|
+
Airwallex.displayName = 'Airwallex';
|
|
78
|
+
var _default = exports.default = /*#__PURE__*/_react.default.memo(Airwallex);
|
|
@@ -57,4 +57,4 @@ const AlipayButton = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
|
57
57
|
}, modalProps)));
|
|
58
58
|
});
|
|
59
59
|
AlipayButton.displayName = 'AlipayButton';
|
|
60
|
-
var _default = exports.default = AlipayButton;
|
|
60
|
+
var _default = exports.default = /*#__PURE__*/(0, _react.memo)(AlipayButton);
|