@pisell/private-materials 3.4.35 → 3.4.36
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/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/preview.js +146 -146
- package/build/lowcode/render/default/view.js +7 -7
- package/build/lowcode/view.js +8 -8
- package/es/components/booking/addons/model.d.ts +10 -1
- package/es/components/booking/forms/model.d.ts +10 -1
- package/es/components/booking/info/model.d.ts +10 -1
- package/es/components/booking/info/service/addService/utils.d.ts +1 -1
- package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/es/components/booking/model.d.ts +9 -1
- package/es/components/booking/notes/model.d.ts +10 -1
- package/es/components/booking/payments/model.d.ts +10 -1
- package/es/components/booking/utils.d.ts +2 -2
- package/es/components/eftposPay/amount.d.ts +1 -1
- package/es/components/eftposPay/device.d.ts +1 -1
- package/es/components/eftposPay/hooks.d.ts +1 -1
- package/es/components/eftposPay/linkly/hooks/useTimeQuery.js +35 -13
- package/es/components/eftposPay/payo/config.js +10 -10
- package/es/components/eftposPay/store/index.d.ts +2 -2
- package/es/components/pay/toC/PaymentMethods/ApplePay/index.js +52 -6
- package/es/components/pay/toC/PaymentMethods/BankDeposit/index.js +58 -8
- package/es/components/pay/toC/PaymentMethods/CashManual/index.js +74 -12
- package/es/components/pay/toC/PaymentMethods/CustomPayment/index.js +73 -12
- package/es/components/pay/toC/PaymentMethods/GlobePayAliPayH5/index.js +93 -11
- package/es/components/pay/toC/PaymentMethods/GlobePayPaypalH5/index.js +90 -12
- package/es/components/pay/toC/PaymentMethods/GlobePayQrcode/index.js +46 -7
- package/es/components/pay/toC/PaymentMethods/GlobePayWxH5/index.js +90 -12
- package/es/components/pay/toC/PaymentMethods/GooglePay/index.js +64 -13
- package/es/components/pay/toC/PaymentMethods/OfflinePayment/index.js +73 -8
- package/es/components/pay/toC/PaymentMethods/StripePay/index.js +68 -17
- package/es/components/pay/toC/PaymentMethods/SuperPayAliPayH5/index.js +86 -14
- package/es/components/pay/toC/PaymentMethods/SuperPayWxPayH5/index.js +89 -15
- package/es/components/pay/toC/index.js +278 -118
- package/es/components/pay/toC/model.d.ts +9 -1
- package/es/components/schedules/model.d.ts +9 -1
- package/es/components/wallet/Detail/model.d.ts +13 -1
- package/es/components/wallet/DiscountCard/model.d.ts +14 -1
- package/es/components/wallet/PointCard/model.d.ts +13 -1
- package/es/components/wallet/RechargeableCard/model.d.ts +29 -1
- package/es/components/wallet/Voucher/model.d.ts +13 -1
- package/es/components/wallet/model.d.ts +9 -1
- package/es/hooks/usePaymentLogger.d.ts +22 -0
- package/es/hooks/usePaymentLogger.js +78 -0
- package/lib/components/booking/addons/model.d.ts +10 -1
- package/lib/components/booking/forms/model.d.ts +10 -1
- package/lib/components/booking/info/model.d.ts +10 -1
- package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/model.d.ts +9 -1
- package/lib/components/booking/notes/model.d.ts +10 -1
- package/lib/components/booking/payments/model.d.ts +10 -1
- package/lib/components/booking/utils.d.ts +2 -2
- package/lib/components/eftposPay/amount.d.ts +1 -1
- package/lib/components/eftposPay/device.d.ts +1 -1
- package/lib/components/eftposPay/hooks.d.ts +1 -1
- package/lib/components/eftposPay/linkly/hooks/useTimeQuery.js +43 -11
- package/lib/components/eftposPay/payo/config.js +9 -9
- package/lib/components/eftposPay/store/index.d.ts +2 -2
- package/lib/components/pay/toC/PaymentMethods/ApplePay/index.js +42 -3
- package/lib/components/pay/toC/PaymentMethods/BankDeposit/index.js +52 -15
- package/lib/components/pay/toC/PaymentMethods/CashManual/index.js +60 -2
- package/lib/components/pay/toC/PaymentMethods/CustomPayment/index.js +60 -2
- package/lib/components/pay/toC/PaymentMethods/GlobePayAliPayH5/index.js +66 -2
- package/lib/components/pay/toC/PaymentMethods/GlobePayPaypalH5/index.js +61 -0
- package/lib/components/pay/toC/PaymentMethods/GlobePayQrcode/index.js +29 -0
- package/lib/components/pay/toC/PaymentMethods/GlobePayWxH5/index.js +61 -0
- package/lib/components/pay/toC/PaymentMethods/GooglePay/index.js +50 -6
- package/lib/components/pay/toC/PaymentMethods/OfflinePayment/index.js +72 -10
- package/lib/components/pay/toC/PaymentMethods/StripePay/index.js +47 -5
- package/lib/components/pay/toC/PaymentMethods/SuperPayAliPayH5/index.js +61 -3
- package/lib/components/pay/toC/PaymentMethods/SuperPayWxPayH5/index.js +63 -3
- package/lib/components/pay/toC/index.js +183 -48
- package/lib/components/pay/toC/model.d.ts +9 -1
- package/lib/components/schedules/model.d.ts +9 -1
- package/lib/components/wallet/Detail/model.d.ts +13 -1
- package/lib/components/wallet/DiscountCard/model.d.ts +14 -1
- package/lib/components/wallet/PointCard/model.d.ts +13 -1
- package/lib/components/wallet/RechargeableCard/model.d.ts +29 -1
- package/lib/components/wallet/Voucher/model.d.ts +13 -1
- package/lib/components/wallet/model.d.ts +9 -1
- package/lib/hooks/usePaymentLogger.d.ts +22 -0
- package/lib/hooks/usePaymentLogger.js +69 -0
- package/package.json +4 -4
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
export interface FormState {
|
|
2
3
|
platform: 'pc' | 'h5' | '' | undefined;
|
|
3
4
|
order: any;
|
|
@@ -28,4 +29,11 @@ export interface PayGroup {
|
|
|
28
29
|
pay_number?: string;
|
|
29
30
|
_order: any;
|
|
30
31
|
}
|
|
31
|
-
export declare const Provider: any, Context:
|
|
32
|
+
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
|
33
|
+
state: FormState;
|
|
34
|
+
} & {
|
|
35
|
+
dispatch: (params: {
|
|
36
|
+
type: string;
|
|
37
|
+
payload: any;
|
|
38
|
+
}) => void;
|
|
39
|
+
}>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { CalendarDataItem, ScheduleItem } from "./type";
|
|
2
3
|
import dayjs from "dayjs";
|
|
3
4
|
export interface FormState {
|
|
@@ -68,4 +69,11 @@ export interface FormState {
|
|
|
68
69
|
};
|
|
69
70
|
setGlobalState: Function | null;
|
|
70
71
|
}
|
|
71
|
-
export declare const Provider: any, Context:
|
|
72
|
+
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
|
73
|
+
state: FormState;
|
|
74
|
+
} & {
|
|
75
|
+
dispatch: (params: {
|
|
76
|
+
type: string;
|
|
77
|
+
payload: any;
|
|
78
|
+
}) => void;
|
|
79
|
+
}>;
|
|
@@ -1 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
interface RechargeState {
|
|
3
|
+
addWalletCard: any;
|
|
4
|
+
}
|
|
5
|
+
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
|
6
|
+
walletDetailState: RechargeState;
|
|
7
|
+
} & {
|
|
8
|
+
dispatch: (params: {
|
|
9
|
+
type: string;
|
|
10
|
+
payload: any;
|
|
11
|
+
}) => void;
|
|
12
|
+
}>;
|
|
13
|
+
export {};
|
|
@@ -1 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
interface RechargeState {
|
|
3
|
+
total: number;
|
|
4
|
+
setup?: 'menu' | 'list' | 'detail' | string;
|
|
5
|
+
}
|
|
6
|
+
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
|
7
|
+
state: RechargeState;
|
|
8
|
+
} & {
|
|
9
|
+
dispatch: (params: {
|
|
10
|
+
type: string;
|
|
11
|
+
payload: any;
|
|
12
|
+
}) => void;
|
|
13
|
+
}>;
|
|
14
|
+
export {};
|
|
@@ -1 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
interface RechargeState {
|
|
3
|
+
total: number;
|
|
4
|
+
}
|
|
5
|
+
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
|
6
|
+
state: RechargeState;
|
|
7
|
+
} & {
|
|
8
|
+
dispatch: (params: {
|
|
9
|
+
type: string;
|
|
10
|
+
payload: any;
|
|
11
|
+
}) => void;
|
|
12
|
+
}>;
|
|
13
|
+
export {};
|
|
@@ -1 +1,29 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
interface RechargeState {
|
|
3
|
+
selectedGiftOptionId: string | null;
|
|
4
|
+
cardList: Array<{
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
price: number;
|
|
8
|
+
}>;
|
|
9
|
+
selectedItem: {
|
|
10
|
+
id?: string;
|
|
11
|
+
gift_price?: number;
|
|
12
|
+
price?: number;
|
|
13
|
+
name?: string;
|
|
14
|
+
variant_id?: string;
|
|
15
|
+
};
|
|
16
|
+
productId?: string;
|
|
17
|
+
detailId?: string;
|
|
18
|
+
total: string | number;
|
|
19
|
+
rechargeModalOpen: boolean;
|
|
20
|
+
}
|
|
21
|
+
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
|
22
|
+
state: RechargeState;
|
|
23
|
+
} & {
|
|
24
|
+
dispatch: (params: {
|
|
25
|
+
type: string;
|
|
26
|
+
payload: any;
|
|
27
|
+
}) => void;
|
|
28
|
+
}>;
|
|
29
|
+
export {};
|
|
@@ -1 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
interface RechargeState {
|
|
3
|
+
total: 0;
|
|
4
|
+
}
|
|
5
|
+
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
|
6
|
+
state: RechargeState;
|
|
7
|
+
} & {
|
|
8
|
+
dispatch: (params: {
|
|
9
|
+
type: string;
|
|
10
|
+
payload: any;
|
|
11
|
+
}) => void;
|
|
12
|
+
}>;
|
|
13
|
+
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { IWalletListItemProps } from './serve';
|
|
2
3
|
export interface WalletCardItemProps {
|
|
3
4
|
id: string;
|
|
@@ -26,4 +27,11 @@ export interface WalletListProps {
|
|
|
26
27
|
currentSearchListItemCode?: string;
|
|
27
28
|
[key: string]: any;
|
|
28
29
|
}
|
|
29
|
-
export declare const Provider: any, Context:
|
|
30
|
+
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
|
31
|
+
global_wallet: WalletListProps;
|
|
32
|
+
} & {
|
|
33
|
+
dispatch: (params: {
|
|
34
|
+
type: string;
|
|
35
|
+
payload: any;
|
|
36
|
+
}) => void;
|
|
37
|
+
}>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
interface LogData {
|
|
2
|
+
key: string;
|
|
3
|
+
value: any;
|
|
4
|
+
}
|
|
5
|
+
interface UsePaymentLoggerOptions {
|
|
6
|
+
orderId: string;
|
|
7
|
+
step?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* @title: 支付日志记录器 Hook
|
|
11
|
+
* @description: 用于记录支付过程中的关键信息
|
|
12
|
+
* @param {UsePaymentLoggerOptions} options - 配置选项
|
|
13
|
+
* @return {object} 返回日志记录相关方法
|
|
14
|
+
* @Author: AI Assistant
|
|
15
|
+
*/
|
|
16
|
+
declare const usePaymentLogger: (options: UsePaymentLoggerOptions) => {
|
|
17
|
+
logs: import("react").MutableRefObject<LogData[]>;
|
|
18
|
+
addLog: (logData: LogData) => void;
|
|
19
|
+
sendLogs: (title?: string, err?: any) => void;
|
|
20
|
+
};
|
|
21
|
+
export default usePaymentLogger;
|
|
22
|
+
export type { LogData, UsePaymentLoggerOptions };
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
2
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
5
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
6
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
7
|
+
import { useRef } from 'react';
|
|
8
|
+
import { sendWarningLog } from '@pisell/utils';
|
|
9
|
+
import { useMemoizedFn } from 'ahooks';
|
|
10
|
+
/**
|
|
11
|
+
* @title: 支付日志记录器 Hook
|
|
12
|
+
* @description: 用于记录支付过程中的关键信息
|
|
13
|
+
* @param {UsePaymentLoggerOptions} options - 配置选项
|
|
14
|
+
* @return {object} 返回日志记录相关方法
|
|
15
|
+
* @Author: AI Assistant
|
|
16
|
+
*/
|
|
17
|
+
var usePaymentLogger = function usePaymentLogger(options) {
|
|
18
|
+
var orderId = options.orderId,
|
|
19
|
+
_options$step = options.step,
|
|
20
|
+
step = _options$step === void 0 ? 'unknown' : _options$step;
|
|
21
|
+
var logs = useRef([]);
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* @title: 添加日志条目
|
|
25
|
+
* @description: 向日志列表中添加一条记录
|
|
26
|
+
* @param {LogData} logData - 日志数据 { key: '描述', value: '值' }
|
|
27
|
+
* @return {void}
|
|
28
|
+
*/
|
|
29
|
+
var addLog = useMemoizedFn(function (logData) {
|
|
30
|
+
logs.current.push({
|
|
31
|
+
key: logData.key,
|
|
32
|
+
value: logData.value
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* @title: 发送当前日志
|
|
38
|
+
* @description: 发送当前所有日志到 sendWarningLog
|
|
39
|
+
* @param {string} title - 日志标题
|
|
40
|
+
* @return {void}
|
|
41
|
+
*/
|
|
42
|
+
var sendLogs = useMemoizedFn(function () {
|
|
43
|
+
var title = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '支付日志';
|
|
44
|
+
var err = arguments.length > 1 ? arguments[1] : undefined;
|
|
45
|
+
var content = [{
|
|
46
|
+
key: 'title',
|
|
47
|
+
value: title
|
|
48
|
+
}].concat(_toConsumableArray(logs.current));
|
|
49
|
+
if (err) {
|
|
50
|
+
content.push.apply(content, [{
|
|
51
|
+
key: '错误信息',
|
|
52
|
+
value: (err === null || err === void 0 ? void 0 : err.message) || '未知错误'
|
|
53
|
+
}, {
|
|
54
|
+
key: '错误堆栈',
|
|
55
|
+
value: (err === null || err === void 0 ? void 0 : err.stack) || '无堆栈信息'
|
|
56
|
+
}, {
|
|
57
|
+
key: '错误类型',
|
|
58
|
+
value: (err === null || err === void 0 ? void 0 : err.name) || '未知错误类型'
|
|
59
|
+
}]);
|
|
60
|
+
}
|
|
61
|
+
var formatLogs = content.map(function (item) {
|
|
62
|
+
return {
|
|
63
|
+
key: item.key,
|
|
64
|
+
value: JSON.stringify(item.value)
|
|
65
|
+
};
|
|
66
|
+
});
|
|
67
|
+
sendWarningLog({
|
|
68
|
+
title: "h5\u652F\u4ED8step".concat(step, ":").concat(orderId),
|
|
69
|
+
content: formatLogs
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
return {
|
|
73
|
+
logs: logs,
|
|
74
|
+
addLog: addLog,
|
|
75
|
+
sendLogs: sendLogs
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
export default usePaymentLogger;
|
|
@@ -1 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FormState } from "../model";
|
|
3
|
+
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
|
4
|
+
state: FormState;
|
|
5
|
+
} & {
|
|
6
|
+
dispatch: (params: {
|
|
7
|
+
type: string;
|
|
8
|
+
payload: any;
|
|
9
|
+
}) => void;
|
|
10
|
+
}>;
|
|
@@ -1 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FormState } from "../model";
|
|
3
|
+
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
|
4
|
+
state: FormState;
|
|
5
|
+
} & {
|
|
6
|
+
dispatch: (params: {
|
|
7
|
+
type: string;
|
|
8
|
+
payload: any;
|
|
9
|
+
}) => void;
|
|
10
|
+
}>;
|
|
@@ -1,5 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FormState } from '../model';
|
|
1
3
|
export declare const walkInData: {
|
|
2
4
|
id: number;
|
|
3
5
|
nickname: string;
|
|
4
6
|
};
|
|
5
|
-
export declare const Provider: any, Context:
|
|
7
|
+
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
|
8
|
+
state: FormState;
|
|
9
|
+
} & {
|
|
10
|
+
dispatch: (params: {
|
|
11
|
+
type: string;
|
|
12
|
+
payload: any;
|
|
13
|
+
}) => void;
|
|
14
|
+
}>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
export interface FormState {
|
|
2
3
|
amountSymbol: string;
|
|
3
4
|
apis: {
|
|
@@ -104,4 +105,11 @@ export declare const walkInData: {
|
|
|
104
105
|
id: number;
|
|
105
106
|
nickname: string;
|
|
106
107
|
};
|
|
107
|
-
export declare const Provider: any, Context:
|
|
108
|
+
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
|
109
|
+
state: FormState;
|
|
110
|
+
} & {
|
|
111
|
+
dispatch: (params: {
|
|
112
|
+
type: string;
|
|
113
|
+
payload: any;
|
|
114
|
+
}) => void;
|
|
115
|
+
}>;
|
|
@@ -1 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FormState } from "../model";
|
|
3
|
+
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
|
4
|
+
state: FormState;
|
|
5
|
+
} & {
|
|
6
|
+
dispatch: (params: {
|
|
7
|
+
type: string;
|
|
8
|
+
payload: any;
|
|
9
|
+
}) => void;
|
|
10
|
+
}>;
|
|
@@ -1 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FormState } from "../model";
|
|
3
|
+
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
|
4
|
+
state: FormState;
|
|
5
|
+
} & {
|
|
6
|
+
dispatch: (params: {
|
|
7
|
+
type: string;
|
|
8
|
+
payload: any;
|
|
9
|
+
}) => void;
|
|
10
|
+
}>;
|
|
@@ -165,10 +165,10 @@ export declare const getProductTotalPrice: (item: any) => number;
|
|
|
165
165
|
export declare const getDuration: (duration: number | {
|
|
166
166
|
type: string;
|
|
167
167
|
value: number;
|
|
168
|
-
}) => number | {
|
|
168
|
+
}) => number | "flexible" | {
|
|
169
169
|
type: string;
|
|
170
170
|
value: number;
|
|
171
|
-
}
|
|
171
|
+
};
|
|
172
172
|
export declare const isWalkIn: (customer_id?: number | string) => boolean;
|
|
173
173
|
export declare const getIsEdit: (state: any) => boolean;
|
|
174
174
|
export {};
|
|
@@ -8,7 +8,7 @@ import { PosProps } from './const';
|
|
|
8
8
|
*/
|
|
9
9
|
declare const _default: ({ className, onChange, onClose, formatAmount, isMobile, net, client }: {
|
|
10
10
|
className?: string | undefined;
|
|
11
|
-
onChange?: ((status: "
|
|
11
|
+
onChange?: ((status: "page" | "success" | "print" | "fail" | "mark_tx_processed", params?: string | {
|
|
12
12
|
[keys: string]: unknown;
|
|
13
13
|
} | undefined, other?: any) => void) | undefined;
|
|
14
14
|
onClose: () => void;
|
|
@@ -10,7 +10,7 @@ import './device.less';
|
|
|
10
10
|
declare const _default: ({ api, onChange, onClose, className, device_number, isMobile, net, client, formatAmount, }: {
|
|
11
11
|
api: PayProps['api'];
|
|
12
12
|
className?: string | undefined;
|
|
13
|
-
onChange?: ((status: "
|
|
13
|
+
onChange?: ((status: "page" | "success" | "print" | "fail" | "mark_tx_processed", params?: string | {
|
|
14
14
|
[keys: string]: unknown;
|
|
15
15
|
} | undefined, other?: any) => void) | undefined;
|
|
16
16
|
onClose: () => void;
|
|
@@ -15,7 +15,7 @@ export declare const useStoreRef: <T extends {
|
|
|
15
15
|
readonly numRef: React.MutableRefObject<string | number | undefined>;
|
|
16
16
|
readonly orderIdRef: React.MutableRefObject<string | number>;
|
|
17
17
|
readonly modeRef: React.MutableRefObject<ModeEnum>;
|
|
18
|
-
readonly statusRef: React.MutableRefObject<"loading" | "
|
|
18
|
+
readonly statusRef: React.MutableRefObject<"loading" | "success" | "warn" | "fail" | "pedding" | "resove" | "reject" | "question">;
|
|
19
19
|
readonly netRef: React.MutableRefObject<boolean | undefined>;
|
|
20
20
|
readonly symbolRef: React.MutableRefObject<string>;
|
|
21
21
|
readonly amountRef: React.MutableRefObject<string | number>;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
1
2
|
var __defProp = Object.defineProperty;
|
|
2
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
4
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
7
|
var __export = (target, all) => {
|
|
6
8
|
for (var name in all)
|
|
@@ -14,6 +16,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
14
16
|
}
|
|
15
17
|
return to;
|
|
16
18
|
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
17
27
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
28
|
|
|
19
29
|
// src/components/eftposPay/linkly/hooks/useTimeQuery.ts
|
|
@@ -24,15 +34,16 @@ __export(useTimeQuery_exports, {
|
|
|
24
34
|
module.exports = __toCommonJS(useTimeQuery_exports);
|
|
25
35
|
var import_react = require("react");
|
|
26
36
|
var import_utils = require("@pisell/utils");
|
|
37
|
+
var import_dayjs = __toESM(require("dayjs"));
|
|
27
38
|
var import_store = require("../../store");
|
|
28
39
|
var import_hooks = require("../../hooks");
|
|
29
40
|
var import_const = require("../../const");
|
|
30
41
|
var import_const2 = require("../const");
|
|
31
|
-
var GlobalTimeout = 1e3 * 60;
|
|
42
|
+
var GlobalTimeout = 1e3 * 60 * 2;
|
|
32
43
|
var RequestTimeout = 1e3 * 5;
|
|
33
44
|
var useTimeResultQuery = (api, resultCheck, handleLinklySuccess) => {
|
|
34
45
|
const dispatch = (0, import_store.useDispatch)();
|
|
35
|
-
const { numRef, modeRef, deviceRef } = (0, import_hooks.useStoreRef)();
|
|
46
|
+
const { numRef, modeRef, deviceRef, orderIdRef } = (0, import_hooks.useStoreRef)();
|
|
36
47
|
const fail = (0, import_hooks.useFail)(0);
|
|
37
48
|
const failRef = (0, import_react.useRef)(fail);
|
|
38
49
|
const isPay = modeRef.current === import_const.ModeEnum.Pay || modeRef.current === import_const.ModeEnum.FullPay;
|
|
@@ -80,7 +91,6 @@ var useTimeResultQuery = (api, resultCheck, handleLinklySuccess) => {
|
|
|
80
91
|
console.log("Success: 全局超时或不需要处理结果,终止查询");
|
|
81
92
|
return;
|
|
82
93
|
}
|
|
83
|
-
_log("Success" /* Success */, result);
|
|
84
94
|
isQueryFinishedRef.current = true;
|
|
85
95
|
const data = (result == null ? void 0 : result.data) || {};
|
|
86
96
|
if (data.status == 1) {
|
|
@@ -95,8 +105,11 @@ var useTimeResultQuery = (api, resultCheck, handleLinklySuccess) => {
|
|
|
95
105
|
}
|
|
96
106
|
if ((data == null ? void 0 : data.status) == 0 && (data == null ? void 0 : data.signature_flag) != 1) {
|
|
97
107
|
console.log("交易状态为0需要继续查询");
|
|
108
|
+
_log("Querying" /* Querying */, result);
|
|
98
109
|
isQueryFinishedRef.current = false;
|
|
99
|
-
|
|
110
|
+
setTimeout(() => {
|
|
111
|
+
_resultQuery();
|
|
112
|
+
}, 1500);
|
|
100
113
|
return;
|
|
101
114
|
}
|
|
102
115
|
if (data.status < 0) {
|
|
@@ -132,7 +145,18 @@ var useTimeResultQuery = (api, resultCheck, handleLinklySuccess) => {
|
|
|
132
145
|
_log("AbortError" /* AbortError */);
|
|
133
146
|
console.log("Error: 请求被取消,将继续查询");
|
|
134
147
|
isQueryFinishedRef.current = false;
|
|
135
|
-
|
|
148
|
+
setTimeout(() => {
|
|
149
|
+
_resultQuery();
|
|
150
|
+
}, 1500);
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
if (!(error == null ? void 0 : error.code) || `${error.code}` === import_const.PayStatus.Timeout) {
|
|
154
|
+
_log("NetworkError" /* NetworkError */);
|
|
155
|
+
console.log("Error: 网关类报错,将继续查询");
|
|
156
|
+
isQueryFinishedRef.current = false;
|
|
157
|
+
setTimeout(() => {
|
|
158
|
+
_resultQuery();
|
|
159
|
+
}, 1500);
|
|
136
160
|
return;
|
|
137
161
|
}
|
|
138
162
|
_log("Error" /* Error */, error);
|
|
@@ -197,13 +221,21 @@ var useTimeResultQuery = (api, resultCheck, handleLinklySuccess) => {
|
|
|
197
221
|
session_id: numRef.current
|
|
198
222
|
};
|
|
199
223
|
const content = [
|
|
200
|
-
{
|
|
224
|
+
{
|
|
225
|
+
key: "description",
|
|
226
|
+
value: JSON.stringify({
|
|
227
|
+
queryId: queryIdRef.current,
|
|
228
|
+
orderId: orderIdRef.current,
|
|
229
|
+
type,
|
|
230
|
+
date: (0, import_dayjs.default)().format("YYYY-MM-DD HH:mm:ss")
|
|
231
|
+
})
|
|
232
|
+
},
|
|
201
233
|
{ key: "params", value: JSON.stringify(params) }
|
|
202
234
|
];
|
|
203
|
-
if (type === "
|
|
204
|
-
content.push({ key: "response", value: JSON.stringify(res) });
|
|
205
|
-
} else if (type === "Error" /* Error */) {
|
|
235
|
+
if (type === "Error" /* Error */) {
|
|
206
236
|
content.push({ key: "error", value: JSON.stringify(res) });
|
|
237
|
+
} else {
|
|
238
|
+
content.push({ key: "response", value: JSON.stringify(res) });
|
|
207
239
|
}
|
|
208
240
|
(0, import_utils.sendWarningLog)({
|
|
209
241
|
title: `Linkly-${isPay ? "Pay" : "Refund"}-交易结果轮询`,
|
|
@@ -212,8 +244,6 @@ var useTimeResultQuery = (api, resultCheck, handleLinklySuccess) => {
|
|
|
212
244
|
};
|
|
213
245
|
const run = () => {
|
|
214
246
|
reset();
|
|
215
|
-
console.log("开始查询linkly结果---->>>>>>>");
|
|
216
|
-
_log("Start" /* Start */);
|
|
217
247
|
globalTimeoutIdRef.current = setTimeout(() => {
|
|
218
248
|
var _a;
|
|
219
249
|
console.log("全局超时,终止所有重试");
|
|
@@ -224,6 +254,8 @@ var useTimeResultQuery = (api, resultCheck, handleLinklySuccess) => {
|
|
|
224
254
|
startTimeRef.current = Date.now();
|
|
225
255
|
isQueryFinishedRef.current = false;
|
|
226
256
|
queryIdRef.current = (0, import_utils.getUniqueId)();
|
|
257
|
+
console.log("开始查询linkly结果---->>>>>>>");
|
|
258
|
+
_log("Start" /* Start */);
|
|
227
259
|
return _resultQuery();
|
|
228
260
|
};
|
|
229
261
|
return { run, stop: reset };
|
|
@@ -148,15 +148,15 @@ var POS = ({
|
|
|
148
148
|
const resultPromise = modeRef.current === import_const.ModeEnum.Pay || modeRef.current === import_const.ModeEnum.FullPay ? api.pay(
|
|
149
149
|
{
|
|
150
150
|
...(custom == null ? void 0 : custom.platform) ? {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
151
|
+
operator_id: custom.operator_id,
|
|
152
|
+
operator_type: custom.operator_type,
|
|
153
|
+
platform: custom.platform,
|
|
154
|
+
custom_payment_id: custom.custom_payment_id,
|
|
155
|
+
service_charge: {
|
|
156
|
+
amount: payRef.current.surMoney,
|
|
157
|
+
percentage: payRef.current.surPercentRate
|
|
158
158
|
},
|
|
159
|
-
|
|
159
|
+
original_amount: payRef.current.amount
|
|
160
160
|
} : {},
|
|
161
161
|
order_id: orderIdRef.current,
|
|
162
162
|
amount: payRef.current.total,
|
|
@@ -215,7 +215,7 @@ var POS = ({
|
|
|
215
215
|
if (unloadRef.current || !netRef.current) {
|
|
216
216
|
return;
|
|
217
217
|
}
|
|
218
|
-
if (err
|
|
218
|
+
if (!(err == null ? void 0 : err.code) || `${err.code}` === import_const.PayStatus.Timeout) {
|
|
219
219
|
checkApi();
|
|
220
220
|
return;
|
|
221
221
|
}
|
|
@@ -174,7 +174,7 @@ export declare const updateCustom: (payload: {
|
|
|
174
174
|
export declare const updateStatus: (status: 'loading' | 'warn' | 'fail' | 'success' | 'question') => {
|
|
175
175
|
type: EActionTypes;
|
|
176
176
|
payload: {
|
|
177
|
-
status: "loading" | "
|
|
177
|
+
status: "loading" | "success" | "warn" | "fail" | "question";
|
|
178
178
|
};
|
|
179
179
|
};
|
|
180
180
|
/**
|
|
@@ -308,7 +308,7 @@ export declare const backUpFree: (payload: Partial<State>) => {
|
|
|
308
308
|
net?: boolean | undefined;
|
|
309
309
|
component?: string | undefined;
|
|
310
310
|
form?: string | undefined;
|
|
311
|
-
status?: "loading" | "
|
|
311
|
+
status?: "loading" | "success" | "warn" | "fail" | "pedding" | "resove" | "reject" | "question" | undefined;
|
|
312
312
|
warn?: string | undefined;
|
|
313
313
|
steps?: {
|
|
314
314
|
/** 用于重置当前步骤 */
|
|
@@ -39,24 +39,47 @@ var import_model = require("../../model");
|
|
|
39
39
|
var import_utils = require("@pisell/utils");
|
|
40
40
|
var import_payGroup = require("../../payGroup");
|
|
41
41
|
var import_useEngineContext = __toESM(require("../../../../../hooks/useEngineContext"));
|
|
42
|
+
var import_usePaymentLogger = __toESM(require("../../../../../hooks/usePaymentLogger"));
|
|
42
43
|
var import_index = require("./index.less");
|
|
43
44
|
var import_utils2 = require("../../utils");
|
|
44
45
|
var ApplePay = (props, ref) => {
|
|
45
|
-
var _a;
|
|
46
|
+
var _a, _b;
|
|
46
47
|
const { state } = (0, import_react.useContext)(import_model.Context);
|
|
47
48
|
const [open, setOpen] = (0, import_react.useState)(false);
|
|
48
49
|
const context = (0, import_useEngineContext.default)();
|
|
49
50
|
const { config } = ((_a = context.appHelper) == null ? void 0 : _a.constants) || {};
|
|
51
|
+
const paymentLogger = (0, import_usePaymentLogger.default)({
|
|
52
|
+
orderId: ((_b = state.payGroup) == null ? void 0 : _b.order_id) || "unknown",
|
|
53
|
+
step: "2"
|
|
54
|
+
});
|
|
50
55
|
const init = async ({ payGroup }) => {
|
|
51
|
-
var _a2,
|
|
56
|
+
var _a2, _b2, _c, _d, _e, _f, _g;
|
|
57
|
+
paymentLogger.addLog({
|
|
58
|
+
key: "ApplePay初始化开始",
|
|
59
|
+
value: ""
|
|
60
|
+
});
|
|
52
61
|
setOpen(true);
|
|
53
62
|
const utils = context.appHelper.utils || {};
|
|
54
|
-
const dvaStore = (
|
|
63
|
+
const dvaStore = (_b2 = (_a2 = utils == null ? void 0 : utils.getStore) == null ? void 0 : _a2.call(utils)) == null ? void 0 : _b2.getState();
|
|
55
64
|
const values = (0, import_payGroup.getPayGroupParamsFromStorage)(payGroup.order_id);
|
|
56
65
|
if (!values) {
|
|
66
|
+
paymentLogger.addLog({
|
|
67
|
+
key: "ApplePay获取支付参数失败",
|
|
68
|
+
value: {
|
|
69
|
+
title: `订单${payGroup == null ? void 0 : payGroup.order_id} 未找到存储的支付参数`,
|
|
70
|
+
data: {
|
|
71
|
+
payGroup
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
paymentLogger.sendLogs("ApplePay获取支付参数失败");
|
|
57
76
|
setOpen(false);
|
|
58
77
|
return;
|
|
59
78
|
}
|
|
79
|
+
paymentLogger.addLog({
|
|
80
|
+
key: "ApplePay获取支付参数成功",
|
|
81
|
+
value: ""
|
|
82
|
+
});
|
|
60
83
|
try {
|
|
61
84
|
const locale = ((_c = dvaStore.core) == null ? void 0 : _c.translateLocale) || "en";
|
|
62
85
|
const shopId = (_f = (_e = (_d = dvaStore.core) == null ? void 0 : _d.core) == null ? void 0 : _e.shop) == null ? void 0 : _f.id;
|
|
@@ -68,8 +91,24 @@ var ApplePay = (props, ref) => {
|
|
|
68
91
|
`/apple-pay?order_id=${(_g = state.payGroup) == null ? void 0 : _g.order_id}&shop_id=${shopId}&locale=${locale}&shop_domain=${shop_domain}&total_amount=${values.amount}&payment_group_id=${values.payment_group_id}`,
|
|
69
92
|
state.history
|
|
70
93
|
)}`;
|
|
94
|
+
paymentLogger.addLog({
|
|
95
|
+
key: "ApplePay准备跳转",
|
|
96
|
+
value: ""
|
|
97
|
+
});
|
|
98
|
+
paymentLogger.sendLogs("ApplePay跳转成功");
|
|
71
99
|
window.location.href = _href;
|
|
72
100
|
} catch (err) {
|
|
101
|
+
paymentLogger.addLog({
|
|
102
|
+
key: "ApplePay处理错误",
|
|
103
|
+
value: {
|
|
104
|
+
title: `订单${payGroup == null ? void 0 : payGroup.order_id} ApplePay处理失败: ${(err == null ? void 0 : err.message) || "未知错误"}`,
|
|
105
|
+
data: {
|
|
106
|
+
payGroup,
|
|
107
|
+
values
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
paymentLogger.sendLogs("ApplePay处理失败", err);
|
|
73
112
|
setOpen(false);
|
|
74
113
|
}
|
|
75
114
|
};
|