pay-sdk-react 1.1.14 → 1.2.0
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/README.md +241 -78
- package/README.zh-CN.md +243 -79
- package/dist/css/index.css +11 -0
- package/dist/css/index.min.css +1 -1
- package/dist/es/Airwallex/airwallex-button.js +48 -16
- package/dist/es/Airwallex/airwallex-checkout-button.d.ts +4 -0
- package/dist/es/Airwallex/airwallex-checkout-button.js +73 -0
- package/dist/es/Airwallex/airwallex-managed.d.ts +4 -0
- package/dist/es/Airwallex/airwallex-managed.js +87 -0
- package/dist/es/Airwallex/airwallex-modal.js +7 -3
- package/dist/es/Airwallex/airwallex-popup.js +7 -3
- package/dist/es/Airwallex/airwallex.d.ts +1 -3
- package/dist/es/Airwallex/airwallex.js +10 -1
- package/dist/es/Airwallex/hooks/useAirwallexCheckout.d.ts +7 -0
- package/dist/es/Airwallex/hooks/useAirwallexCheckout.js +155 -0
- package/dist/es/Airwallex/index.d.ts +4 -0
- package/dist/es/Airwallex/index.js +5 -1
- package/dist/es/Airwallex/interface.d.ts +146 -0
- package/dist/es/Alipay/alipay-button.js +26 -7
- package/dist/es/Alipay/alipay.js +39 -12
- package/dist/es/Alipay/interface.d.ts +26 -1
- package/dist/es/Paypal/index.d.ts +2 -0
- package/dist/es/Paypal/index.js +3 -1
- package/dist/es/Paypal/interface.d.ts +40 -0
- package/dist/es/Paypal/paypal-button.js +24 -3
- package/dist/es/Paypal/paypal-smart-button.d.ts +4 -0
- package/dist/es/Paypal/paypal-smart-button.js +48 -0
- package/dist/es/Payssion/interface.d.ts +7 -0
- package/dist/es/Payssion/payssion-button.js +25 -4
- package/dist/es/Pix/interface.d.ts +67 -0
- package/dist/es/Pix/pix-button.js +26 -7
- package/dist/es/Pix/pix-enhanced.d.ts +4 -0
- package/dist/es/Pix/pix-enhanced.js +182 -0
- package/dist/es/Pix/pix.d.ts +1 -1
- package/dist/es/Pix/pix.js +6 -1
- package/dist/es/Pix/style/index.css +11 -0
- package/dist/es/Pix/style/index.min.css +1 -1
- package/dist/es/Stripe/hooks/useStripeCheckout.d.ts +7 -0
- package/dist/es/Stripe/hooks/useStripeCheckout.js +86 -0
- package/dist/es/Stripe/index.d.ts +4 -0
- package/dist/es/Stripe/index.js +5 -1
- package/dist/es/Stripe/interface.d.ts +120 -0
- package/dist/es/Stripe/stripe-button.js +32 -10
- package/dist/es/Stripe/stripe-checkout-button.d.ts +4 -0
- package/dist/es/Stripe/stripe-checkout-button.js +70 -0
- package/dist/es/Stripe/stripe-modal.js +19 -2
- package/dist/es/Stripe/stripe-popup.js +13 -2
- package/dist/es/Stripe/stripe.js +38 -4
- package/dist/es/Wechat/interface.d.ts +13 -0
- package/dist/es/Wechat/wechat-button.js +26 -7
- package/dist/es/Wechat/wechat-content.d.ts +4 -0
- package/dist/es/Wechat/wechat-content.js +61 -0
- package/dist/es/Wechat/wechat.d.ts +1 -1
- package/dist/es/Wechat/wechat.js +5 -1
- package/dist/es/hooks/useLatestCallback.d.ts +1 -0
- package/dist/es/hooks/useLatestCallback.js +8 -0
- package/dist/es/hooks/useManagedOrder.d.ts +8 -0
- package/dist/es/hooks/useManagedOrder.js +67 -0
- package/dist/es/hooks/usePaymentExecution.d.ts +13 -0
- package/dist/es/hooks/usePaymentExecution.js +176 -0
- package/dist/es/hooks/usePaymentQr.d.ts +6 -0
- package/dist/es/hooks/usePaymentQr.js +52 -0
- package/dist/es/hooks/usePaymentRedirect.d.ts +5 -0
- package/dist/es/hooks/usePaymentRedirect.js +83 -0
- package/dist/es/index.d.ts +33 -6
- package/dist/es/index.js +19 -1
- package/dist/es/pay-modal/interface.d.ts +22 -2
- package/dist/es/pay-modal/pay-modal.js +36 -16
- package/dist/es/shared/entitys/payment.d.ts +227 -0
- package/dist/es/shared/entitys/payment.js +75 -0
- package/dist/es/shared/enums/index.d.ts +1 -88
- package/dist/es/shared/enums/index.js +1 -91
- package/dist/es/shared/enums/payment.d.ts +162 -0
- package/dist/es/shared/enums/payment.js +168 -0
- package/dist/es/shared/index.d.ts +2 -0
- package/dist/es/shared/index.js +2 -1
- package/dist/lib/Airwallex/airwallex-button.js +31 -10
- package/dist/lib/Airwallex/airwallex-checkout-button.js +52 -0
- package/dist/lib/Airwallex/airwallex-managed.js +86 -0
- package/dist/lib/Airwallex/airwallex-modal.js +4 -2
- package/dist/lib/Airwallex/airwallex-popup.js +4 -2
- package/dist/lib/Airwallex/airwallex.js +9 -1
- package/dist/lib/Airwallex/hooks/useAirwallexCheckout.js +83 -0
- package/dist/lib/Airwallex/index.js +18 -1
- package/dist/lib/Alipay/alipay-button.js +21 -6
- package/dist/lib/Alipay/alipay.js +36 -9
- package/dist/lib/Paypal/index.js +17 -1
- package/dist/lib/Paypal/paypal-button.js +19 -2
- package/dist/lib/Paypal/paypal-smart-button.js +45 -0
- package/dist/lib/Payssion/payssion-button.js +20 -3
- package/dist/lib/Pix/pix-button.js +21 -6
- package/dist/lib/Pix/pix-enhanced.js +143 -0
- package/dist/lib/Pix/pix.js +6 -1
- package/dist/lib/Pix/style/index.css +11 -0
- package/dist/lib/Pix/style/index.min.css +1 -1
- package/dist/lib/Stripe/hooks/useStripeCheckout.js +41 -0
- package/dist/lib/Stripe/index.js +18 -1
- package/dist/lib/Stripe/stripe-button.js +28 -10
- package/dist/lib/Stripe/stripe-checkout-button.js +50 -0
- package/dist/lib/Stripe/stripe-modal.js +12 -1
- package/dist/lib/Stripe/stripe-popup.js +12 -1
- package/dist/lib/Stripe/stripe.js +30 -1
- package/dist/lib/Wechat/wechat-button.js +21 -6
- package/dist/lib/Wechat/wechat-content.js +65 -0
- package/dist/lib/Wechat/wechat.js +3 -1
- package/dist/lib/hooks/useLatestCallback.js +13 -0
- package/dist/lib/hooks/useManagedOrder.js +29 -0
- package/dist/lib/hooks/usePaymentExecution.js +113 -0
- package/dist/lib/hooks/usePaymentQr.js +51 -0
- package/dist/lib/hooks/usePaymentRedirect.js +87 -0
- package/dist/lib/index.js +57 -1
- package/dist/lib/pay-modal/pay-modal.js +33 -16
- package/dist/lib/shared/entitys/payment.js +61 -0
- package/dist/lib/shared/enums/index.js +11 -91
- package/dist/lib/shared/enums/payment.js +172 -0
- package/dist/lib/shared/index.js +12 -1
- package/dist/umd/pay-sdk-react.umd.js +6488 -7731
- package/dist/umd/pay-sdk-react.umd.js.map +1 -1
- package/package.json +17 -3
package/dist/es/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export type { PaypalButtonProps, PaypalButtonRef, CreateOrderPaypalFn, PaypalSec
|
|
|
3
3
|
export { PaypalButton } from './Paypal';
|
|
4
4
|
export type { BasesStripeProps, StripeProps, StripePopupProps, StripePopupRef, StripeButtonProps, StripeButtonRef, CreateOrderStripeFn, StripeModalRef, } from './Stripe/interface';
|
|
5
5
|
import { StripeButton, StripePopup, StripeModal } from './Stripe';
|
|
6
|
+
import { StripeCheckoutButton } from './Stripe';
|
|
6
7
|
declare const Stripe: import("react").NamedExoticComponent<Omit<import("./Stripe").BasesStripeProps & import("react").HTMLAttributes<HTMLDivElement> & {
|
|
7
8
|
children?: import("react").ReactNode;
|
|
8
9
|
} & import("react").RefAttributes<HTMLElement>, "ref"> & {
|
|
@@ -12,6 +13,7 @@ declare const Stripe: import("react").NamedExoticComponent<Omit<import("./Stripe
|
|
|
12
13
|
children?: import("react").ReactNode;
|
|
13
14
|
} & import("react").RefAttributes<HTMLElement>>;
|
|
14
15
|
} & {
|
|
16
|
+
CheckoutButton: import("react").MemoExoticComponent<(props: import("./Stripe").StripeCheckoutButtonProps) => import("react/jsx-runtime").JSX.Element>;
|
|
15
17
|
Button: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<import("./Stripe").StripeButtonProps & {
|
|
16
18
|
children?: import("react").ReactNode;
|
|
17
19
|
} & import("react").RefAttributes<import("./Stripe").StripeButtonRef>>>;
|
|
@@ -22,6 +24,7 @@ declare const Stripe: import("react").NamedExoticComponent<Omit<import("./Stripe
|
|
|
22
24
|
children?: import("react").ReactNode;
|
|
23
25
|
} & import("react").RefAttributes<import("./Stripe").StripePopupRef>>>;
|
|
24
26
|
} & {
|
|
27
|
+
CheckoutButton: typeof StripeCheckoutButton;
|
|
25
28
|
Button: typeof StripeButton;
|
|
26
29
|
Popup: typeof StripePopup;
|
|
27
30
|
Modal: typeof StripeModal;
|
|
@@ -30,15 +33,13 @@ export { Stripe };
|
|
|
30
33
|
export { StripeButton, StripePopup, StripeModal };
|
|
31
34
|
export type { AirwallexProps, AirwallexPopupProps, AirwallexPopupRef, AirwallexButtonProps, AirwallexButtonRef, CreateOrderAirwallexEmbeddedFn, CreateOrderAirwallexRedirectFn, AirwallexModalProps, AirwallexModalRef, } from './Airwallex/interface';
|
|
32
35
|
import { AirwallexButton, AirwallexPopup, AirwallexModal } from './Airwallex';
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
} & import("react").RefAttributes<HTMLElement>, "ref"> & {
|
|
36
|
+
import { AirwallexCheckoutButton } from './Airwallex';
|
|
37
|
+
declare const Airwallex: import("react").NamedExoticComponent<Omit<import("./Airwallex").AirwallexProps & import("react").RefAttributes<HTMLElement>, "ref"> & {
|
|
36
38
|
ref?: import("react").RefObject<HTMLElement> | ((instance: HTMLElement | null) => void) | null | undefined;
|
|
37
39
|
}> & {
|
|
38
|
-
readonly type: import("react").ForwardRefExoticComponent<import("./Airwallex").AirwallexProps &
|
|
39
|
-
children?: import("react").ReactNode;
|
|
40
|
-
} & import("react").RefAttributes<HTMLElement>>;
|
|
40
|
+
readonly type: import("react").ForwardRefExoticComponent<import("./Airwallex").AirwallexProps & import("react").RefAttributes<HTMLElement>>;
|
|
41
41
|
} & {
|
|
42
|
+
CheckoutButton: import("react").MemoExoticComponent<(props: import("./Airwallex").AirwallexCheckoutButtonProps) => import("react/jsx-runtime").JSX.Element>;
|
|
42
43
|
Button: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<import("react").PropsWithChildren<import("./Airwallex").AirwallexButtonProps> & import("react").RefAttributes<import("./Airwallex").AirwallexButtonRef>>>;
|
|
43
44
|
Popup: import("react").ForwardRefExoticComponent<import("./Airwallex").AirwallexPopupProps & {
|
|
44
45
|
children?: import("react").ReactNode;
|
|
@@ -47,6 +48,7 @@ declare const Airwallex: import("react").NamedExoticComponent<Omit<import("./Air
|
|
|
47
48
|
children?: import("react").ReactNode;
|
|
48
49
|
} & import("react").RefAttributes<import("./Airwallex").AirwallexPopupRef>>;
|
|
49
50
|
} & {
|
|
51
|
+
CheckoutButton: typeof AirwallexCheckoutButton;
|
|
50
52
|
Button: typeof AirwallexButton;
|
|
51
53
|
Popup: typeof AirwallexPopup;
|
|
52
54
|
Modal: typeof AirwallexModal;
|
|
@@ -86,6 +88,8 @@ export { AlipayButton, AlipayModal };
|
|
|
86
88
|
export type { WechatProps, WechatModalProps, WechatButtonProps, WechatButtonRef, WechatModalRef, } from './Wechat/interface';
|
|
87
89
|
import { WechatButton, WechatModal } from './Wechat';
|
|
88
90
|
declare const Wechat: import("react").NamedExoticComponent<import("./Wechat").WechatProps> & {
|
|
91
|
+
readonly type: (props: import("./Wechat").WechatProps) => import("react/jsx-runtime").JSX.Element;
|
|
92
|
+
} & {
|
|
89
93
|
Button: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<import("./Wechat").WechatButtonProps & {
|
|
90
94
|
children?: import("react").ReactNode;
|
|
91
95
|
} & import("react").RefAttributes<import("./Wechat").WechatButtonRef>>>;
|
|
@@ -101,6 +105,8 @@ export { WechatButton, WechatModal };
|
|
|
101
105
|
export type { PixProps, PixButtonProps, PixButtonRef, CreateOrderPixFn, PixModalProps, PixModalRef, } from './Pix/interface';
|
|
102
106
|
import { PixButton, PixModal } from './Pix';
|
|
103
107
|
declare const Pix: import("react").NamedExoticComponent<import("./Pix").PixProps> & {
|
|
108
|
+
readonly type: (props: import("./Pix").PixProps) => import("react/jsx-runtime").JSX.Element;
|
|
109
|
+
} & {
|
|
104
110
|
Button: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<import("./Pix").PixButtonProps & {
|
|
105
111
|
children?: import("react").ReactNode;
|
|
106
112
|
} & import("react").RefAttributes<import("./Pix").PixButtonRef>>>;
|
|
@@ -119,3 +125,24 @@ export type { PayButtonProps, GenericPayButtonRef, } from './PayButton/interface
|
|
|
119
125
|
import PayButton from './PayButton';
|
|
120
126
|
export { PayButton };
|
|
121
127
|
export * from './shared';
|
|
128
|
+
export { StripeCheckoutButton, useStripeCheckout } from './Stripe';
|
|
129
|
+
export type { UseStripeCheckoutOptions, UseStripeCheckoutReturn, StripeCheckoutButtonProps, StripeCheckoutTarget, } from './Stripe';
|
|
130
|
+
export { AirwallexCheckoutButton, useAirwallexCheckout } from './Airwallex';
|
|
131
|
+
export type { UseAirwallexCheckoutOptions, UseAirwallexCheckoutReturn, AirwallexCheckoutButtonProps, AirwallexCheckoutTarget, AirwallexHostedOptions, } from './Airwallex';
|
|
132
|
+
import { PaypalSmartButton, PaypalProvider } from './Paypal';
|
|
133
|
+
/**
|
|
134
|
+
* @zh PayPal 独立入口保留原 URL 按钮。
|
|
135
|
+
* @en PayPal namespace keeps the legacy URL button.
|
|
136
|
+
* @since 1.2.0
|
|
137
|
+
*/
|
|
138
|
+
export declare const Paypal: {
|
|
139
|
+
Button: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<import("./Paypal").PaypalButtonProps & {
|
|
140
|
+
children?: import("react").ReactNode;
|
|
141
|
+
} & import("react").RefAttributes<import("./Paypal").PaypalButtonRef>>>;
|
|
142
|
+
SmartButton: import("react").MemoExoticComponent<({ scriptOptions, ...props }: import("./Paypal").PaypalSmartButtonProps) => import("react/jsx-runtime").JSX.Element>;
|
|
143
|
+
Provider: import("react").FC<import("@paypal/react-paypal-js").ScriptProviderProps>;
|
|
144
|
+
};
|
|
145
|
+
export { PaypalSmartButton, PaypalProvider };
|
|
146
|
+
export type { PaypalSmartButtonProps } from './Paypal';
|
|
147
|
+
export type { PayModalProps, PayModalSlot } from './pay-modal';
|
|
148
|
+
export type { StripeCheckoutEvents } from './Stripe';
|
package/dist/es/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
export { PaypalButton } from './Paypal';
|
|
2
2
|
import StripeDefault from './Stripe';
|
|
3
3
|
import { StripeButton, StripePopup, StripeModal } from './Stripe';
|
|
4
|
+
import { StripeCheckoutButton } from './Stripe';
|
|
4
5
|
var Stripe = Object.assign({}, StripeDefault, {
|
|
6
|
+
CheckoutButton: StripeCheckoutButton,
|
|
5
7
|
Button: StripeButton,
|
|
6
8
|
Popup: StripePopup,
|
|
7
9
|
Modal: StripeModal
|
|
@@ -10,7 +12,9 @@ export { Stripe };
|
|
|
10
12
|
export { StripeButton, StripePopup, StripeModal };
|
|
11
13
|
import AirwallexDefault from './Airwallex';
|
|
12
14
|
import { AirwallexButton, AirwallexPopup, AirwallexModal } from './Airwallex';
|
|
15
|
+
import { AirwallexCheckoutButton } from './Airwallex';
|
|
13
16
|
var Airwallex = Object.assign({}, AirwallexDefault, {
|
|
17
|
+
CheckoutButton: AirwallexCheckoutButton,
|
|
14
18
|
Button: AirwallexButton,
|
|
15
19
|
Popup: AirwallexPopup,
|
|
16
20
|
Modal: AirwallexModal
|
|
@@ -53,4 +57,18 @@ export { PixButton, PixModal };
|
|
|
53
57
|
export { MPixButton } from './MPix';
|
|
54
58
|
import PayButton from './PayButton';
|
|
55
59
|
export { PayButton };
|
|
56
|
-
export * from './shared';
|
|
60
|
+
export * from './shared';
|
|
61
|
+
export { StripeCheckoutButton, useStripeCheckout } from './Stripe';
|
|
62
|
+
export { AirwallexCheckoutButton, useAirwallexCheckout } from './Airwallex';
|
|
63
|
+
import { PaypalButton as PaypalLegacyButton, PaypalSmartButton, PaypalProvider } from './Paypal';
|
|
64
|
+
/**
|
|
65
|
+
* @zh PayPal 独立入口保留原 URL 按钮。
|
|
66
|
+
* @en PayPal namespace keeps the legacy URL button.
|
|
67
|
+
* @since 1.2.0
|
|
68
|
+
*/
|
|
69
|
+
export var Paypal = {
|
|
70
|
+
Button: PaypalLegacyButton,
|
|
71
|
+
SmartButton: PaypalSmartButton,
|
|
72
|
+
Provider: PaypalProvider
|
|
73
|
+
};
|
|
74
|
+
export { PaypalSmartButton, PaypalProvider };
|
|
@@ -1,6 +1,13 @@
|
|
|
1
|
+
import type { PaymentAppearance } from '../shared/entitys/payment';
|
|
1
2
|
import React, { ReactNode } from 'react';
|
|
2
3
|
import { ButtonProps } from '../Button';
|
|
3
|
-
|
|
4
|
+
/**
|
|
5
|
+
* @zh 弹窗语义区域。
|
|
6
|
+
* @en Modal semantic slots.
|
|
7
|
+
* @since 1.2.0
|
|
8
|
+
*/
|
|
9
|
+
export type PayModalSlot = 'root' | 'mask' | 'content' | 'close' | 'icon' | 'title' | 'description' | 'body' | 'footer';
|
|
10
|
+
export interface PayModalProps extends PaymentAppearance<PayModalSlot> {
|
|
4
11
|
/**
|
|
5
12
|
* @zh 是否显示弹窗
|
|
6
13
|
* @en Whether to show the modal
|
|
@@ -14,8 +21,9 @@ export interface PayModalProps {
|
|
|
14
21
|
/**
|
|
15
22
|
* @zh 标题
|
|
16
23
|
* @en Title
|
|
24
|
+
* @remarks Unreleased:兼容扩展为 ReactNode / Compatibly expanded to ReactNode.
|
|
17
25
|
*/
|
|
18
|
-
title?:
|
|
26
|
+
title?: React.ReactNode;
|
|
19
27
|
/**
|
|
20
28
|
* @zh 描述
|
|
21
29
|
* @en Description
|
|
@@ -40,6 +48,18 @@ export interface PayModalProps {
|
|
|
40
48
|
* @zh 是否显示右上角关闭按钮,默认 true
|
|
41
49
|
*/
|
|
42
50
|
showClose?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* @zh 自定义关闭图标;未传保留原图标。
|
|
53
|
+
* @en Custom close icon; omitted keeps the original.
|
|
54
|
+
* @since 1.2.0
|
|
55
|
+
*/
|
|
56
|
+
closeIcon?: ReactNode;
|
|
57
|
+
/**
|
|
58
|
+
* @zh 关闭入口无障碍文案。
|
|
59
|
+
* @en Accessible close label.
|
|
60
|
+
* @since 1.2.0
|
|
61
|
+
*/
|
|
62
|
+
closeLabel?: string;
|
|
43
63
|
/**
|
|
44
64
|
* @zh 点击蒙层是否关闭弹窗,默认 false
|
|
45
65
|
* @en Whether to close the modal when clicking the mask, default is false
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
1
2
|
var _excluded = ["className", "children"],
|
|
2
3
|
_excluded2 = ["className", "children"];
|
|
4
|
+
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; }
|
|
5
|
+
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; }
|
|
6
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
7
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
8
|
+
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); }
|
|
3
9
|
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
10
|
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
11
|
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; }
|
|
@@ -30,7 +36,14 @@ var PayModal = function PayModal(props) {
|
|
|
30
36
|
style = props.style,
|
|
31
37
|
contentClassName = props.contentClassName,
|
|
32
38
|
contentStyle = props.contentStyle,
|
|
33
|
-
container = props.container
|
|
39
|
+
container = props.container,
|
|
40
|
+
_props$classNames = props.classNames,
|
|
41
|
+
slots = _props$classNames === void 0 ? {} : _props$classNames,
|
|
42
|
+
_props$styles = props.styles,
|
|
43
|
+
styles = _props$styles === void 0 ? {} : _props$styles,
|
|
44
|
+
closeIcon = props.closeIcon,
|
|
45
|
+
_props$closeLabel = props.closeLabel,
|
|
46
|
+
closeLabel = _props$closeLabel === void 0 ? '关闭' : _props$closeLabel;
|
|
34
47
|
var _ref = retryButtonProps || {},
|
|
35
48
|
retryButtonClassName = _ref.className,
|
|
36
49
|
_ref$children = _ref.children,
|
|
@@ -58,8 +71,8 @@ var PayModal = function PayModal(props) {
|
|
|
58
71
|
};
|
|
59
72
|
}
|
|
60
73
|
}, [visible, container]);
|
|
61
|
-
var classNames = cs(classPrefix, className);
|
|
62
|
-
var contentClassNames = cs("".concat(classPrefix, "__content"), contentClassName);
|
|
74
|
+
var classNames = cs(classPrefix, className, slots.root);
|
|
75
|
+
var contentClassNames = cs("".concat(classPrefix, "__content"), contentClassName, slots.content);
|
|
63
76
|
var handleMaskClose = useCallback(function () {
|
|
64
77
|
if (maskClosable) onClose === null || onClose === void 0 || onClose();
|
|
65
78
|
}, [maskClosable, onClose]);
|
|
@@ -73,31 +86,38 @@ var PayModal = function PayModal(props) {
|
|
|
73
86
|
}, finishButtonPropsRest), finishButtonChildren);
|
|
74
87
|
var footerContent = isFunction(footer) ? footer(retryButtonNode, finishButtonNode) : footer || /*#__PURE__*/React.createElement(React.Fragment, null, retryButtonNode, finishButtonNode);
|
|
75
88
|
return /*#__PURE__*/React.createElement("div", {
|
|
76
|
-
className: "".concat(classPrefix, "__actions")
|
|
89
|
+
className: cs("".concat(classPrefix, "__actions"), slots.footer),
|
|
90
|
+
style: styles.footer
|
|
77
91
|
}, footerContent);
|
|
78
92
|
};
|
|
79
93
|
if (!visible || !el.current) return null;
|
|
80
94
|
var modalContent = /*#__PURE__*/React.createElement("div", {
|
|
81
95
|
className: classNames,
|
|
82
|
-
style: style
|
|
96
|
+
style: _objectSpread(_objectSpread({}, style), styles.root)
|
|
83
97
|
}, /*#__PURE__*/React.createElement("div", {
|
|
84
|
-
className: "".concat(classPrefix, "__mask"),
|
|
98
|
+
className: cs("".concat(classPrefix, "__mask"), slots.mask),
|
|
99
|
+
style: styles.mask,
|
|
85
100
|
onClick: handleMaskClose
|
|
86
101
|
}), /*#__PURE__*/React.createElement("div", {
|
|
87
102
|
className: contentClassNames,
|
|
88
|
-
style: contentStyle
|
|
103
|
+
style: _objectSpread(_objectSpread({}, contentStyle), styles.content)
|
|
89
104
|
}, showClose && /*#__PURE__*/React.createElement("button", {
|
|
90
|
-
className: "".concat(classPrefix, "__close"),
|
|
105
|
+
className: cs("".concat(classPrefix, "__close"), slots.close),
|
|
106
|
+
style: styles.close,
|
|
91
107
|
onClick: onClose,
|
|
92
|
-
"aria-label":
|
|
93
|
-
},
|
|
94
|
-
className: "".concat(classPrefix, "__icon")
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
108
|
+
"aria-label": closeLabel
|
|
109
|
+
}, closeIcon === undefined ? '×' : closeIcon), icon && /*#__PURE__*/React.createElement("div", {
|
|
110
|
+
className: cs("".concat(classPrefix, "__icon"), slots.icon),
|
|
111
|
+
style: styles.icon
|
|
112
|
+
}, icon), title !== undefined && title !== null && title !== false && title !== '' ? /*#__PURE__*/React.createElement("div", {
|
|
113
|
+
className: cs("".concat(classPrefix, "__title"), slots.title),
|
|
114
|
+
style: styles.title
|
|
115
|
+
}, title) : null, desc && /*#__PURE__*/React.createElement("div", {
|
|
116
|
+
className: cs("".concat(classPrefix, "__desc"), slots.description),
|
|
117
|
+
style: styles.description
|
|
99
118
|
}, desc), children && /*#__PURE__*/React.createElement("div", {
|
|
100
|
-
className: "".concat(classPrefix, "__content-wrapper")
|
|
119
|
+
className: cs("".concat(classPrefix, "__content-wrapper"), slots.body),
|
|
120
|
+
style: styles.body
|
|
101
121
|
}, children), renderFooter()));
|
|
102
122
|
return /*#__PURE__*/ReactDOM.createPortal(modalContent, el.current);
|
|
103
123
|
};
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
import type { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
import type { OpenPayUrlMode, PaymentErrorCode, PaymentExecutionStatus } from '../enums';
|
|
3
|
+
/**
|
|
4
|
+
* @zh 分区域样式,不传时保留原样。
|
|
5
|
+
* @en Semantic styles; omitted values preserve defaults.
|
|
6
|
+
* @since 1.2.0
|
|
7
|
+
*/
|
|
8
|
+
export interface PaymentAppearance<Slot extends string> {
|
|
9
|
+
/**
|
|
10
|
+
* @zh 按语义区域追加类名,默认无覆盖。
|
|
11
|
+
* @en Additional classes by semantic slot; no override by default.
|
|
12
|
+
* @since 1.2.0
|
|
13
|
+
*/
|
|
14
|
+
classNames?: Partial<Record<Slot, string>>;
|
|
15
|
+
/**
|
|
16
|
+
* @zh 按语义区域覆盖行内样式,优先于旧样式属性。
|
|
17
|
+
* @en Inline slot styles, overriding legacy style props.
|
|
18
|
+
* @since 1.2.0
|
|
19
|
+
*/
|
|
20
|
+
styles?: Partial<Record<Slot, CSSProperties>>;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* @zh 二维码展示配置。
|
|
24
|
+
* @en QR presentation options.
|
|
25
|
+
* @since 1.2.0
|
|
26
|
+
*/
|
|
27
|
+
export interface PaymentQrAppearance extends PaymentAppearance<'root' | 'container' | 'image' | 'tip' | 'overlay'> {
|
|
28
|
+
/**
|
|
29
|
+
* @zh 可选显示尺寸,未传保留原尺寸。
|
|
30
|
+
* @en Optional display size; omitted preserves defaults.
|
|
31
|
+
* @since 1.2.0
|
|
32
|
+
*/
|
|
33
|
+
size?: number;
|
|
34
|
+
/**
|
|
35
|
+
* @zh 中心覆盖内容,由调用方控制尺寸。
|
|
36
|
+
* @en Center overlay; caller controls its size.
|
|
37
|
+
* @since 1.2.0
|
|
38
|
+
*/
|
|
39
|
+
overlay?: ReactNode;
|
|
40
|
+
/**
|
|
41
|
+
* @zh 生成时内容。
|
|
42
|
+
* @en Content while generating.
|
|
43
|
+
* @since 1.2.0
|
|
44
|
+
*/
|
|
45
|
+
loadingContent?: ReactNode;
|
|
46
|
+
/**
|
|
47
|
+
* @zh 生成失败内容。
|
|
48
|
+
* @en Content on generation error.
|
|
49
|
+
* @since 1.2.0
|
|
50
|
+
*/
|
|
51
|
+
errorContent?: ReactNode;
|
|
52
|
+
/**
|
|
53
|
+
* @zh 生成成功事件。
|
|
54
|
+
* @en Generated image callback.
|
|
55
|
+
* @since 1.2.0
|
|
56
|
+
*/
|
|
57
|
+
onQrReady?: (imageUrl: string) => void;
|
|
58
|
+
/**
|
|
59
|
+
* @zh 生成失败事件。
|
|
60
|
+
* @en Generation error callback.
|
|
61
|
+
* @since 1.2.0
|
|
62
|
+
*/
|
|
63
|
+
onQrError?: () => void;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* @zh 支付执行错误;不包含支付凭证。
|
|
67
|
+
* @en Execution error without credentials.
|
|
68
|
+
* @since 1.2.0
|
|
69
|
+
*/
|
|
70
|
+
export declare class PaymentExecutionError extends Error {
|
|
71
|
+
readonly code: PaymentErrorCode;
|
|
72
|
+
constructor(code: PaymentErrorCode, message: string);
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* @zh 可选的受管理执行配置。
|
|
76
|
+
* @en Optional managed execution options.
|
|
77
|
+
* @since 1.2.0
|
|
78
|
+
*/
|
|
79
|
+
export interface PaymentExecutionOptions {
|
|
80
|
+
/**
|
|
81
|
+
* @zh 返回 false 中止,未配置时继续。
|
|
82
|
+
* @en Return false to stop; otherwise continue.
|
|
83
|
+
* @since 1.2.0
|
|
84
|
+
*/
|
|
85
|
+
beforePay?: () => boolean | Promise<boolean>;
|
|
86
|
+
/**
|
|
87
|
+
* @zh 只包含当前 SDK 执行的加载状态。
|
|
88
|
+
* @en Loading for this SDK execution only.
|
|
89
|
+
* @since 1.2.0
|
|
90
|
+
*/
|
|
91
|
+
onLoadingChange?: (loading: boolean) => void;
|
|
92
|
+
/**
|
|
93
|
+
* @zh 执行失败通知,不表示扣款结果。
|
|
94
|
+
* @en Execution error, not payment outcome.
|
|
95
|
+
* @since 1.2.0
|
|
96
|
+
*/
|
|
97
|
+
onPaymentError?: (error: PaymentExecutionError) => void;
|
|
98
|
+
/**
|
|
99
|
+
* @zh 当前前端执行被取消。
|
|
100
|
+
* @en Current frontend execution was cancelled.
|
|
101
|
+
* @since 1.2.0
|
|
102
|
+
*/
|
|
103
|
+
onCancel?: () => void;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* @zh 每次执行的显式结果。
|
|
107
|
+
* @en Explicit execution result.
|
|
108
|
+
* @since 1.2.0
|
|
109
|
+
*/
|
|
110
|
+
export interface PaymentExecutionResult<T = void> {
|
|
111
|
+
/**
|
|
112
|
+
* @zh 前端执行阶段状态,非业务订单状态。
|
|
113
|
+
* @en Frontend execution state, not order state.
|
|
114
|
+
* @since 1.2.0
|
|
115
|
+
*/
|
|
116
|
+
status: PaymentExecutionStatus;
|
|
117
|
+
/**
|
|
118
|
+
* @zh 当前执行返回值,未提供时为空。
|
|
119
|
+
* @en Execution return value, absent when not provided.
|
|
120
|
+
* @since 1.2.0
|
|
121
|
+
*/
|
|
122
|
+
value?: T;
|
|
123
|
+
/**
|
|
124
|
+
* @zh 安全执行错误;无错误时为空。
|
|
125
|
+
* @en Safe execution error; absent when no error occurred.
|
|
126
|
+
* @since 1.2.0
|
|
127
|
+
*/
|
|
128
|
+
error?: PaymentExecutionError;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* @zh 执行 Hook 的公开状态。
|
|
132
|
+
* @en Public execution state.
|
|
133
|
+
* @since 1.2.0
|
|
134
|
+
*/
|
|
135
|
+
export interface PaymentExecutionReturn {
|
|
136
|
+
/**
|
|
137
|
+
* @zh 当前实例执行是否处理中。
|
|
138
|
+
* @en Whether this instance has a pending execution.
|
|
139
|
+
* @since 1.2.0
|
|
140
|
+
*/
|
|
141
|
+
loading: boolean;
|
|
142
|
+
/**
|
|
143
|
+
* @zh 前端执行阶段状态,非业务订单状态。
|
|
144
|
+
* @en Frontend execution state, not order state.
|
|
145
|
+
* @since 1.2.0
|
|
146
|
+
*/
|
|
147
|
+
status: PaymentExecutionStatus;
|
|
148
|
+
/**
|
|
149
|
+
* @zh 安全执行错误;无错误时为空。
|
|
150
|
+
* @en Safe execution error; absent when no error occurred.
|
|
151
|
+
* @since 1.2.0
|
|
152
|
+
*/
|
|
153
|
+
error: PaymentExecutionError | null;
|
|
154
|
+
/**
|
|
155
|
+
* @zh 停止本次前端执行,不撤销订单。
|
|
156
|
+
* @en Stop frontend execution, not the order.
|
|
157
|
+
* @since 1.2.0
|
|
158
|
+
*/
|
|
159
|
+
cancel: () => void;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* @zh URL 跳转配置,仅用于 URL 分支。
|
|
163
|
+
* @en Redirect options for URL targets only.
|
|
164
|
+
* @since 1.2.0
|
|
165
|
+
*/
|
|
166
|
+
export interface PaymentRedirectOptions {
|
|
167
|
+
/**
|
|
168
|
+
* @zh 默认当前页跳转。
|
|
169
|
+
* @en Defaults to current-page navigation.
|
|
170
|
+
* @since 1.2.0
|
|
171
|
+
*/
|
|
172
|
+
openMode?: OpenPayUrlMode;
|
|
173
|
+
/**
|
|
174
|
+
* @zh 显式窗口名称;默认每个实例独立。
|
|
175
|
+
* @en Optional name; instances are isolated by default.
|
|
176
|
+
* @since 1.2.0
|
|
177
|
+
*/
|
|
178
|
+
windowName?: string;
|
|
179
|
+
/**
|
|
180
|
+
* @zh window.open 的可选特征。
|
|
181
|
+
* @en Optional window.open features.
|
|
182
|
+
* @since 1.2.0
|
|
183
|
+
*/
|
|
184
|
+
windowFeatures?: string;
|
|
185
|
+
/**
|
|
186
|
+
* @zh 卸载时关闭当前实例窗口,默认 true。
|
|
187
|
+
* @en Close owned window on unmount, default true.
|
|
188
|
+
* @since 1.2.0
|
|
189
|
+
*/
|
|
190
|
+
closeWindowOnUnmount?: boolean;
|
|
191
|
+
/**
|
|
192
|
+
* @zh 地址已发起打开,不代表已支付。
|
|
193
|
+
* @en URL opened, not payment success.
|
|
194
|
+
* @since 1.2.0
|
|
195
|
+
*/
|
|
196
|
+
onOpen?: (url: string) => void;
|
|
197
|
+
/**
|
|
198
|
+
* @zh 用户关闭窗口。
|
|
199
|
+
* @en User closed the window.
|
|
200
|
+
* @since 1.2.0
|
|
201
|
+
*/
|
|
202
|
+
onWindowClose?: () => void;
|
|
203
|
+
/**
|
|
204
|
+
* @zh 必须与 messageValidator 同时配置才启用消息监听。
|
|
205
|
+
* @en Required with messageValidator to enable messages.
|
|
206
|
+
* @since 1.2.0
|
|
207
|
+
*/
|
|
208
|
+
allowedMessageOrigins?: string[];
|
|
209
|
+
/**
|
|
210
|
+
* @zh 在来源和窗口验证后校验当前执行消息。
|
|
211
|
+
* @en Validate messages after origin and source checks.
|
|
212
|
+
* @since 1.2.0
|
|
213
|
+
*/
|
|
214
|
+
messageValidator?: (event: MessageEvent) => boolean;
|
|
215
|
+
/**
|
|
216
|
+
* @zh 已通过验证的消息;仍需业务确认订单。
|
|
217
|
+
* @en Verified message; caller still confirms order.
|
|
218
|
+
* @since 1.2.0
|
|
219
|
+
*/
|
|
220
|
+
onMessage?: (event: MessageEvent) => void;
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* @zh 已有目标或获取目标的回调;null 表示中止。
|
|
224
|
+
* @en Target or factory; null stops execution.
|
|
225
|
+
* @since 1.2.0
|
|
226
|
+
*/
|
|
227
|
+
export type CheckoutSource<T> = T | ((signal: AbortSignal) => T | null | Promise<T | null>);
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
3
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
4
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
5
|
+
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); }
|
|
6
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
7
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
8
|
+
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
9
|
+
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
10
|
+
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
11
|
+
function _wrapNativeSuper(t) { var r = "function" == typeof Map ? new Map() : void 0; return _wrapNativeSuper = function _wrapNativeSuper(t) { if (null === t || !_isNativeFunction(t)) return t; if ("function" != typeof t) throw new TypeError("Super expression must either be null or a function"); if (void 0 !== r) { if (r.has(t)) return r.get(t); r.set(t, Wrapper); } function Wrapper() { return _construct(t, arguments, _getPrototypeOf(this).constructor); } return Wrapper.prototype = Object.create(t.prototype, { constructor: { value: Wrapper, enumerable: !1, writable: !0, configurable: !0 } }), _setPrototypeOf(Wrapper, t); }, _wrapNativeSuper(t); }
|
|
12
|
+
function _construct(t, e, r) { if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments); var o = [null]; o.push.apply(o, e); var p = new (t.bind.apply(t, o))(); return r && _setPrototypeOf(p, r.prototype), p; }
|
|
13
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
14
|
+
function _isNativeFunction(t) { try { return -1 !== Function.toString.call(t).indexOf("[native code]"); } catch (n) { return "function" == typeof t; } }
|
|
15
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
16
|
+
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
17
|
+
/**
|
|
18
|
+
* @zh 分区域样式,不传时保留原样。
|
|
19
|
+
* @en Semantic styles; omitted values preserve defaults.
|
|
20
|
+
* @since 1.2.0
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* @zh 二维码展示配置。
|
|
25
|
+
* @en QR presentation options.
|
|
26
|
+
* @since 1.2.0
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* @zh 支付执行错误;不包含支付凭证。
|
|
31
|
+
* @en Execution error without credentials.
|
|
32
|
+
* @since 1.2.0
|
|
33
|
+
*/
|
|
34
|
+
export var PaymentExecutionError = /*#__PURE__*/function (_Error) {
|
|
35
|
+
function PaymentExecutionError(code, message) {
|
|
36
|
+
var _this;
|
|
37
|
+
_classCallCheck(this, PaymentExecutionError);
|
|
38
|
+
_this = _callSuper(this, PaymentExecutionError, [message]);
|
|
39
|
+
_this.code = code;
|
|
40
|
+
_this.name = 'PaymentExecutionError';
|
|
41
|
+
return _this;
|
|
42
|
+
}
|
|
43
|
+
_inherits(PaymentExecutionError, _Error);
|
|
44
|
+
return _createClass(PaymentExecutionError);
|
|
45
|
+
}(/*#__PURE__*/_wrapNativeSuper(Error));
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* @zh 可选的受管理执行配置。
|
|
49
|
+
* @en Optional managed execution options.
|
|
50
|
+
* @since 1.2.0
|
|
51
|
+
*/
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* @zh 每次执行的显式结果。
|
|
55
|
+
* @en Explicit execution result.
|
|
56
|
+
* @since 1.2.0
|
|
57
|
+
*/
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* @zh 执行 Hook 的公开状态。
|
|
61
|
+
* @en Public execution state.
|
|
62
|
+
* @since 1.2.0
|
|
63
|
+
*/
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* @zh URL 跳转配置,仅用于 URL 分支。
|
|
67
|
+
* @en Redirect options for URL targets only.
|
|
68
|
+
* @since 1.2.0
|
|
69
|
+
*/
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* @zh 已有目标或获取目标的回调;null 表示中止。
|
|
73
|
+
* @en Target or factory; null stops execution.
|
|
74
|
+
* @since 1.2.0
|
|
75
|
+
*/
|
|
@@ -1,88 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
/**
|
|
3
|
-
* @zh 微信(pc)
|
|
4
|
-
* @en Wechat(pc)
|
|
5
|
-
*/
|
|
6
|
-
WechatPc = "wechat-pc",
|
|
7
|
-
/**
|
|
8
|
-
* @zh 支付宝(pc)
|
|
9
|
-
* @en Alipay(pc)
|
|
10
|
-
*/
|
|
11
|
-
AlipayPc = "alipay-pc",
|
|
12
|
-
/**
|
|
13
|
-
* @zh paypal(pc)
|
|
14
|
-
* @en Paypal(pc)
|
|
15
|
-
*/
|
|
16
|
-
PaypalPc = "paypal-pc",
|
|
17
|
-
/**
|
|
18
|
-
* @zh stripe(pc)
|
|
19
|
-
* @en Stripe(pc)
|
|
20
|
-
*/
|
|
21
|
-
StripePc = "stripe-pc",
|
|
22
|
-
/**
|
|
23
|
-
* @zh 微信(H5)
|
|
24
|
-
* @en Wechat(H5)
|
|
25
|
-
*/
|
|
26
|
-
WechatH5 = "wechat-h5",
|
|
27
|
-
/**
|
|
28
|
-
* @zh 支付宝(H5)
|
|
29
|
-
* @en Alipay(H5)
|
|
30
|
-
*/
|
|
31
|
-
AlipayH5 = "alipay-h5",
|
|
32
|
-
/**
|
|
33
|
-
* @zh paypal(H5)
|
|
34
|
-
* @en Paypal(H5)
|
|
35
|
-
*/
|
|
36
|
-
PaypalH5 = "paypal-h5",
|
|
37
|
-
/**
|
|
38
|
-
* @zh 微信内部(H5)
|
|
39
|
-
* @en Wechat inside(H5)
|
|
40
|
-
*/
|
|
41
|
-
WechatInsideH5 = "wechat-inside-h5",
|
|
42
|
-
/**
|
|
43
|
-
* @zh stripe(H5)
|
|
44
|
-
* @en Stripe(H5)
|
|
45
|
-
*/
|
|
46
|
-
StripeH5 = "stripe-h5",
|
|
47
|
-
/**
|
|
48
|
-
* @zh payssion支付
|
|
49
|
-
* @en Payssion
|
|
50
|
-
*/
|
|
51
|
-
Payssion = "payssion",
|
|
52
|
-
/**
|
|
53
|
-
* @zh 空中云汇
|
|
54
|
-
* @en Airwallex
|
|
55
|
-
*/
|
|
56
|
-
Airwallex = "airwallex",
|
|
57
|
-
/**
|
|
58
|
-
* @zh PIX(pc)
|
|
59
|
-
* @en PIX(pc)
|
|
60
|
-
*/
|
|
61
|
-
PixPc = "pix-pc",
|
|
62
|
-
/**
|
|
63
|
-
* @zh PIX(H5)
|
|
64
|
-
* @en PIX(H5)
|
|
65
|
-
*/
|
|
66
|
-
PixH5 = "pix-h5"
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* @zh 支付页面打开模式枚举
|
|
70
|
-
* @en Payment page opening mode enum
|
|
71
|
-
*/
|
|
72
|
-
export declare enum OpenPayUrlMode {
|
|
73
|
-
/**
|
|
74
|
-
* @zh 新页面或弹窗模式 - 使用 window.open() 打开新页面或弹窗,支持智能设备检测
|
|
75
|
-
* @en New page or popup mode - Use window.open() to open new page or popup, supports smart device detection
|
|
76
|
-
*/
|
|
77
|
-
Window = "window",
|
|
78
|
-
/**
|
|
79
|
-
* @zh 新页面模式 - 使用 window.location.href 跳转到新页面
|
|
80
|
-
* @en New page mode - Use window.location.href to navigate to new page
|
|
81
|
-
*/
|
|
82
|
-
Href = "href",
|
|
83
|
-
/**
|
|
84
|
-
* @zh 替换页面模式 - 使用 window.location.replace 替换当前页面
|
|
85
|
-
* @en Replace page mode - Use window.location.replace to replace current page
|
|
86
|
-
*/
|
|
87
|
-
Replace = "replace"
|
|
88
|
-
}
|
|
1
|
+
export * from './payment';
|