@pisell/private-materials 6.3.14 → 6.3.16

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.
Files changed (83) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/index.js +1 -1
  5. package/build/lowcode/meta.js +1 -1
  6. package/build/lowcode/preview.js +13 -13
  7. package/build/lowcode/render/default/view.js +9 -9
  8. package/build/lowcode/view.js +9 -9
  9. package/es/components/booking/addons/model.d.ts +10 -1
  10. package/es/components/booking/forms/model.d.ts +10 -1
  11. package/es/components/booking/info/model.d.ts +10 -1
  12. package/es/components/booking/model.d.ts +9 -1
  13. package/es/components/booking/notes/model.d.ts +10 -1
  14. package/es/components/booking/payments/model.d.ts +10 -1
  15. package/es/components/eftposPay/hooks.d.ts +1 -1
  16. package/es/components/eftposPay/store/index.d.ts +1 -1
  17. package/es/components/pay/toC/PaymentMethods/ApplePay/index.js +52 -6
  18. package/es/components/pay/toC/PaymentMethods/BankDeposit/index.js +58 -8
  19. package/es/components/pay/toC/PaymentMethods/CashManual/index.js +74 -12
  20. package/es/components/pay/toC/PaymentMethods/CustomPayment/index.js +73 -12
  21. package/es/components/pay/toC/PaymentMethods/GlobePayAliPayH5/index.js +93 -11
  22. package/es/components/pay/toC/PaymentMethods/GlobePayPaypalH5/index.js +90 -12
  23. package/es/components/pay/toC/PaymentMethods/GlobePayQrcode/index.js +46 -7
  24. package/es/components/pay/toC/PaymentMethods/GlobePayWxH5/index.js +90 -12
  25. package/es/components/pay/toC/PaymentMethods/GooglePay/index.js +64 -13
  26. package/es/components/pay/toC/PaymentMethods/OfflinePayment/index.js +73 -8
  27. package/es/components/pay/toC/PaymentMethods/StripePay/index.js +68 -17
  28. package/es/components/pay/toC/PaymentMethods/SuperPayAliPayH5/index.js +86 -14
  29. package/es/components/pay/toC/PaymentMethods/SuperPayWxPayH5/index.js +89 -15
  30. package/es/components/pay/toC/index.js +278 -118
  31. package/es/components/pay/toC/model.d.ts +9 -1
  32. package/es/components/schedules/model.d.ts +9 -1
  33. package/es/components/schedules/utils.d.ts +1 -1
  34. package/es/components/ticketBooking/components/ticketBooking/index.js +2 -0
  35. package/es/components/wallet/Detail/index.js +3 -1
  36. package/es/components/wallet/Detail/model.d.ts +13 -1
  37. package/es/components/wallet/DiscountCard/model.d.ts +14 -1
  38. package/es/components/wallet/PointCard/model.d.ts +13 -1
  39. package/es/components/wallet/RechargeableCard/model.d.ts +29 -1
  40. package/es/components/wallet/Voucher/model.d.ts +13 -1
  41. package/es/components/wallet/components/WalletCard.js +8 -3
  42. package/es/components/wallet/model.d.ts +9 -1
  43. package/es/hooks/usePaymentLogger.d.ts +22 -0
  44. package/es/hooks/usePaymentLogger.js +78 -0
  45. package/es/utils/index.d.ts +1 -1
  46. package/lib/components/booking/addons/model.d.ts +10 -1
  47. package/lib/components/booking/forms/model.d.ts +10 -1
  48. package/lib/components/booking/info/model.d.ts +10 -1
  49. package/lib/components/booking/model.d.ts +9 -1
  50. package/lib/components/booking/notes/model.d.ts +10 -1
  51. package/lib/components/booking/payments/model.d.ts +10 -1
  52. package/lib/components/eftposPay/hooks.d.ts +1 -1
  53. package/lib/components/eftposPay/store/index.d.ts +1 -1
  54. package/lib/components/pay/toC/PaymentMethods/ApplePay/index.js +42 -3
  55. package/lib/components/pay/toC/PaymentMethods/BankDeposit/index.js +52 -15
  56. package/lib/components/pay/toC/PaymentMethods/CashManual/index.js +60 -2
  57. package/lib/components/pay/toC/PaymentMethods/CustomPayment/index.js +60 -2
  58. package/lib/components/pay/toC/PaymentMethods/GlobePayAliPayH5/index.js +66 -2
  59. package/lib/components/pay/toC/PaymentMethods/GlobePayPaypalH5/index.js +61 -0
  60. package/lib/components/pay/toC/PaymentMethods/GlobePayQrcode/index.js +29 -0
  61. package/lib/components/pay/toC/PaymentMethods/GlobePayWxH5/index.js +61 -0
  62. package/lib/components/pay/toC/PaymentMethods/GooglePay/index.js +50 -6
  63. package/lib/components/pay/toC/PaymentMethods/OfflinePayment/index.js +72 -10
  64. package/lib/components/pay/toC/PaymentMethods/StripePay/index.js +47 -5
  65. package/lib/components/pay/toC/PaymentMethods/SuperPayAliPayH5/index.js +61 -3
  66. package/lib/components/pay/toC/PaymentMethods/SuperPayWxPayH5/index.js +63 -3
  67. package/lib/components/pay/toC/index.js +183 -48
  68. package/lib/components/pay/toC/model.d.ts +9 -1
  69. package/lib/components/schedules/model.d.ts +9 -1
  70. package/lib/components/schedules/utils.d.ts +1 -1
  71. package/lib/components/ticketBooking/components/ticketBooking/index.js +1 -0
  72. package/lib/components/wallet/Detail/index.js +18 -5
  73. package/lib/components/wallet/Detail/model.d.ts +13 -1
  74. package/lib/components/wallet/DiscountCard/model.d.ts +14 -1
  75. package/lib/components/wallet/PointCard/model.d.ts +13 -1
  76. package/lib/components/wallet/RechargeableCard/model.d.ts +29 -1
  77. package/lib/components/wallet/Voucher/model.d.ts +13 -1
  78. package/lib/components/wallet/components/WalletCard.js +3 -1
  79. package/lib/components/wallet/model.d.ts +9 -1
  80. package/lib/hooks/usePaymentLogger.d.ts +22 -0
  81. package/lib/hooks/usePaymentLogger.js +69 -0
  82. package/lib/utils/index.d.ts +1 -1
  83. package/package.json +3 -3
@@ -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: any;
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: any;
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
+ }>;
@@ -17,6 +17,6 @@ declare let modal: Omit<ModalStaticFunctions, "warn">;
17
17
  export declare const setModal: (m: Omit<ModalStaticFunctions, "warn">) => void;
18
18
  export declare const saveConfirm: () => Promise<{
19
19
  destroy: () => void;
20
- update: (configUpdate: import("antd/es/modal/interface").ModalFuncProps | ((prevConfig: import("antd/es/modal/interface").ModalFuncProps) => import("antd/es/modal/interface").ModalFuncProps)) => void;
20
+ update: (configUpdate: import("antd").ModalFuncProps | ((prevConfig: import("antd").ModalFuncProps) => import("antd").ModalFuncProps)) => void;
21
21
  }>;
22
22
  export { modal };
@@ -188,6 +188,8 @@ var TicketBooking = function TicketBooking() {
188
188
  var _callbackFnRef = useRef();
189
189
  useEffect(function () {
190
190
  var _interaction$utils, _store$getState, _interaction$utils2, _interaction$utils3;
191
+ // bellaswonderland.mypisell.com localStorage可能满了
192
+ localStorage.removeItem('bookingResourceList');
191
193
  _persistentRef.current = storage.get("drawer-booking") === 'true' ? true : isTerminal();
192
194
  if (lowcodeRef) {
193
195
  lowcodeRef.onReady(_this);
@@ -312,9 +312,11 @@ var Detail = /*#__PURE__*/forwardRef(function (props, ref) {
312
312
  }];
313
313
  //折扣卡显示折扣字段 其他显示余额字段
314
314
  if (tag === 'product_discount_card') {
315
+ var _detail$metadata;
316
+ var isFixedAmount = ((_detail$metadata = detail.metadata) === null || _detail$metadata === void 0 ? void 0 : _detail$metadata.discount_card_type) === 'fixed_amount';
315
317
  data.splice(2, 0, {
316
318
  label: locales.getText('page.wallet.discount'),
317
- value: balance ? "".concat(Number(balance), "%") : ''
319
+ value: balance ? isFixedAmount ? "".concat(symbol).concat(Number(balance)) : "".concat(Number(balance), "%") : ''
318
320
  });
319
321
  } else if (tag === 'point_card') {
320
322
  data.splice(2, 0, {
@@ -1 +1,13 @@
1
- export declare const Provider: any, Context: any;
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
- export declare const Provider: any, Context: any;
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
- export declare const Provider: any, Context: any;
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
- export declare const Provider: any, Context: any;
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
- export declare const Provider: any, Context: any;
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,7 @@
1
+ var _excluded = ["id", "tag", "product_title", "balance", "code", "encoded", "expire_date", "shop", "limit_status", "product_cover", "par_value", "unified_messages"];
2
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
4
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
1
5
  import React, { useMemo } from 'react';
2
6
  import { PisellWalletPassCard } from '@pisell/materials';
3
7
  import { isMobile } from '@pisell/utils';
@@ -35,7 +39,8 @@ var WalletCard = function WalletCard(_ref) {
35
39
  _item$par_value = item.par_value,
36
40
  par_value = _item$par_value === void 0 ? '' : _item$par_value,
37
41
  _item$unified_message = item.unified_messages,
38
- unified_messages = _item$unified_message === void 0 ? {} : _item$unified_message;
42
+ unified_messages = _item$unified_message === void 0 ? {} : _item$unified_message,
43
+ rest = _objectWithoutProperties(item, _excluded);
39
44
 
40
45
  // 获取平台
41
46
  var platform = useMemo(function () {
@@ -52,7 +57,7 @@ var WalletCard = function WalletCard(_ref) {
52
57
  var isActive = id === currentId && platform === 'pc';
53
58
  // 是否禁用
54
59
  var isDisabled = limit_status !== 'enable';
55
- return /*#__PURE__*/React.createElement(PisellWalletPassCard, {
60
+ return /*#__PURE__*/React.createElement(PisellWalletPassCard, _extends({}, rest, {
56
61
  balanceTitle: balanceTitle,
57
62
  showDetail: false,
58
63
  showRedeem: false,
@@ -77,6 +82,6 @@ var WalletCard = function WalletCard(_ref) {
77
82
  code: encoded,
78
83
  validDate: expire_date,
79
84
  onClick: onClick
80
- });
85
+ }));
81
86
  };
82
87
  export default /*#__PURE__*/React.memo(WalletCard);
@@ -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: any;
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;
@@ -18,6 +18,6 @@ declare let modal: Omit<ModalStaticFunctions, 'warn'>;
18
18
  export declare const setModal: (m: Omit<ModalStaticFunctions, 'warn'>) => void;
19
19
  export declare const saveConfirm: () => Promise<{
20
20
  destroy: () => void;
21
- update: (configUpdate: import("antd/es/modal/interface").ModalFuncProps | ((prevConfig: import("antd/es/modal/interface").ModalFuncProps) => import("antd/es/modal/interface").ModalFuncProps)) => void;
21
+ update: (configUpdate: import("antd").ModalFuncProps | ((prevConfig: import("antd").ModalFuncProps) => import("antd").ModalFuncProps)) => void;
22
22
  }>;
23
23
  export { modal };
@@ -1 +1,10 @@
1
- export declare const Provider: any, Context: any;
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
- export declare const Provider: any, Context: any;
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: any;
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: {
@@ -105,4 +106,11 @@ export declare const walkInData: {
105
106
  id: number;
106
107
  nickname: string;
107
108
  };
108
- export declare const Provider: any, Context: any;
109
+ export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
110
+ state: FormState;
111
+ } & {
112
+ dispatch: (params: {
113
+ type: string;
114
+ payload: any;
115
+ }) => void;
116
+ }>;
@@ -1 +1,10 @@
1
- export declare const Provider: any, Context: any;
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
- export declare const Provider: any, Context: any;
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
+ }>;
@@ -19,7 +19,7 @@ export declare const useStoreRef: <T extends {
19
19
  readonly netRef: React.MutableRefObject<boolean | undefined>;
20
20
  readonly symbolRef: React.MutableRefObject<string>;
21
21
  readonly amountRef: React.MutableRefObject<string | number>;
22
- readonly eftposRef: React.MutableRefObject<"stripe" | "payo" | "tyro" | "windcave" | "linkly">;
22
+ readonly eftposRef: React.MutableRefObject<"stripe" | "tyro" | "windcave" | "payo" | "linkly">;
23
23
  readonly clientRef: React.MutableRefObject<ClientEnum>;
24
24
  readonly dataRef: React.MutableRefObject<import("./store").State>;
25
25
  };
@@ -297,7 +297,7 @@ export declare const backUpFree: (payload: Partial<State>) => {
297
297
  amount?: string | number | undefined;
298
298
  mode?: "refund" | "pay" | "fullPay" | "query" | undefined;
299
299
  order_id?: string | number | undefined;
300
- eftpos?: "stripe" | "payo" | "tyro" | "windcave" | "linkly" | undefined;
300
+ eftpos?: "stripe" | "tyro" | "windcave" | "payo" | "linkly" | undefined;
301
301
  action?: "amount" | "pay" | "deviceList" | undefined;
302
302
  key?: number | undefined;
303
303
  step?: number | undefined;
@@ -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, _b, _c, _d, _e, _f, _g;
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 = (_b = (_a2 = utils == null ? void 0 : utils.getStore) == null ? void 0 : _a2.call(utils)) == null ? void 0 : _b.getState();
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
  };
@@ -35,30 +35,67 @@ module.exports = __toCommonJS(BankDeposit_exports);
35
35
  var import_react = require("react");
36
36
  var import_model = require("../../model");
37
37
  var import_useEngineContext = __toESM(require("../../../../../hooks/useEngineContext"));
38
+ var import_usePaymentLogger = __toESM(require("../../../../../hooks/usePaymentLogger"));
38
39
  var import_utils = require("../../utils");
39
40
  var import_index = require("./index.less");
40
41
  var BankDeposit = (props, ref) => {
42
+ var _a;
41
43
  const { state } = (0, import_react.useContext)(import_model.Context);
42
44
  const context = (0, import_useEngineContext.default)();
45
+ const paymentLogger = (0, import_usePaymentLogger.default)({
46
+ orderId: ((_a = state.payGroup) == null ? void 0 : _a.order_id) || "unknown",
47
+ step: "2"
48
+ });
43
49
  const init = async ({ payGroup }) => {
44
- var _a, _b;
45
- const platform = ((_b = (_a = context.appHelper) == null ? void 0 : _a.constants) == null ? void 0 : _b.platform) || "h5";
46
- let _item = payGroup == null ? void 0 : payGroup.otherPayment;
47
- if (platform === "pc") {
48
- state.payCallback({
49
- key: _item.service,
50
- data: {
51
- order_id: payGroup.order_id,
52
- payment_method: _item.title
50
+ var _a2, _b;
51
+ paymentLogger.addLog({
52
+ key: "BankDeposit初始化开始",
53
+ value: ""
54
+ });
55
+ try {
56
+ const platform = ((_b = (_a2 = context.appHelper) == null ? void 0 : _a2.constants) == null ? void 0 : _b.platform) || "h5";
57
+ let _item = payGroup == null ? void 0 : payGroup.otherPayment;
58
+ paymentLogger.addLog({
59
+ key: "BankDeposit平台检测",
60
+ value: ""
61
+ });
62
+ if (platform === "pc") {
63
+ paymentLogger.addLog({
64
+ key: "BankDepositPC处理",
65
+ value: ""
66
+ });
67
+ state.payCallback({
68
+ key: _item.service,
69
+ data: {
70
+ order_id: payGroup.order_id,
71
+ payment_method: _item.title
72
+ }
73
+ });
74
+ paymentLogger.sendLogs("BankDepositPC处理成功");
75
+ return;
76
+ }
77
+ const _href = `${(0, import_utils.formatFranchiseeRoute)(
78
+ `/pay/manual-transfer?id=${(payGroup == null ? void 0 : payGroup.order_id) || (payGroup == null ? void 0 : payGroup.order_id)}`,
79
+ state.history
80
+ )}`;
81
+ paymentLogger.addLog({
82
+ key: "BankDepositH5准备跳转",
83
+ value: ""
84
+ });
85
+ paymentLogger.sendLogs("BankDepositH5跳转成功");
86
+ state.history.push(_href);
87
+ } catch (err) {
88
+ paymentLogger.addLog({
89
+ key: "BankDeposit处理错误",
90
+ value: {
91
+ title: `订单${payGroup == null ? void 0 : payGroup.order_id} BankDeposit处理失败: ${(err == null ? void 0 : err.message) || "未知错误"}`,
92
+ data: {
93
+ payGroup
94
+ }
53
95
  }
54
96
  });
55
- return;
97
+ paymentLogger.sendLogs("BankDeposit处理失败", err);
56
98
  }
57
- const _href = `${(0, import_utils.formatFranchiseeRoute)(
58
- `/pay/manual-transfer?id=${(payGroup == null ? void 0 : payGroup.order_id) || (payGroup == null ? void 0 : payGroup.order_id)}`,
59
- state.history
60
- )}`;
61
- state.history.push(_href);
62
99
  };
63
100
  (0, import_react.useImperativeHandle)(
64
101
  ref,