@pisell/private-materials 3.4.34 → 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/meta.js +1 -1
- package/build/lowcode/render/default/view.js +7 -7
- package/build/lowcode/view.js +7 -7
- package/es/components/appointmentBooking/components/Cart/Item/index.d.ts +0 -1
- package/es/components/appointmentBooking/components/Services/index.js +37 -20
- package/es/components/appointmentBooking/hooks.js +6 -0
- package/es/components/booking/components/TabProduct/index.d.ts +0 -1
- package/es/components/booking/components/TabProduct/productItem/index.d.ts +0 -1
- package/es/components/booking/components/TabProduct/selectProductItem/index.d.ts +0 -1
- package/es/components/booking/components/collapsibleList/utils.d.ts +0 -1
- package/es/components/booking/components/emptyBooking/index.d.ts +0 -1
- package/es/components/booking/components/footer/FooterMenus/index.d.ts +0 -1
- package/es/components/booking/components/formItemChildrenWrap/index.d.ts +0 -1
- package/es/components/booking/forms/single/index.d.ts +0 -1
- package/es/components/booking/forms/table/index.d.ts +0 -1
- package/es/components/booking/info/clientVariant/hooks/useClientFn.d.ts +0 -1
- package/es/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
- package/es/components/booking/info/date/index.d.ts +0 -1
- package/es/components/booking/info/notes/index.d.ts +0 -1
- package/es/components/booking/info/service/actions/index.d.ts +0 -1
- package/es/components/booking/info/service/like/index.d.ts +0 -1
- package/es/components/booking/info2/service/actions/index.d.ts +0 -1
- package/es/components/booking/locales.d.ts +6 -0
- package/es/components/booking/locales.js +12 -0
- package/es/components/booking/materiels/contacts/index.d.ts +0 -1
- package/es/components/booking/materiels/duration/index.d.ts +0 -1
- package/es/components/booking/materiels/holder/index.d.ts +0 -1
- package/es/components/booking/materiels/startTime/index.d.ts +0 -1
- package/es/components/booking/notes/NoteBlock/NoteItem/index.d.ts +0 -1
- package/es/components/booking/notes/NoteBlock/index.d.ts +0 -1
- package/es/components/eftpos/deviceList/index.d.ts +0 -1
- package/es/components/eftpos/form/index.d.ts +0 -1
- package/es/components/eftpos/group/index.d.ts +0 -1
- package/es/components/eftpos/hooks.d.ts +0 -1
- package/es/components/eftpos/icon/apiKey.d.ts +0 -1
- package/es/components/eftpos/icon/device.d.ts +0 -1
- package/es/components/eftpos/index.d.ts +0 -1
- package/es/components/eftpos/pos.d.ts +0 -1
- package/es/components/eftpos/receipt/index.d.ts +0 -1
- package/es/components/eftposPay/amount.d.ts +0 -1
- package/es/components/eftposPay/component/alert/warn.d.ts +0 -1
- package/es/components/eftposPay/component/fail/failCustom.d.ts +0 -1
- package/es/components/eftposPay/component/fail/index.d.ts +0 -1
- package/es/components/eftposPay/component/fail/network.d.ts +0 -1
- package/es/components/eftposPay/component/fail/unknow.d.ts +0 -1
- package/es/components/eftposPay/component/header/titlebar.d.ts +0 -1
- package/es/components/eftposPay/component/manual/index.d.ts +0 -1
- package/es/components/eftposPay/component/signature/index.d.ts +0 -1
- package/es/components/eftposPay/component/step/index.d.ts +0 -1
- package/es/components/eftposPay/component/step/step.d.ts +0 -1
- package/es/components/eftposPay/hooks.d.ts +1 -1
- package/es/components/eftposPay/linkly/hooks/useTimeQuery.js +35 -13
- package/es/components/eftposPay/pay.d.ts +0 -1
- package/es/components/eftposPay/payo/config.d.ts +0 -1
- package/es/components/eftposPay/payo/config.js +10 -10
- package/es/components/eftposPay/store/index.d.ts +1 -1
- package/es/components/eftposPay/tip.d.ts +0 -1
- package/es/components/eftposPay/tyro/hooks.d.ts +0 -1
- package/es/components/eftposPay/windcave/receiptAction.d.ts +0 -1
- package/es/components/eftposPay/windcave/windcave.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/Content/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/Header/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/SelectHolderModal.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +0 -1
- package/es/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +0 -1
- package/es/components/eventBooking/components/scheduleCalendar/ProductItem/index.d.ts +0 -1
- package/es/components/login/index.d.ts +0 -1
- 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/MWCreditCard/tds2.js +6 -3
- package/es/components/pay/toC/PaymentMethods/OfflinePayment/index.js +73 -8
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +0 -1
- 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/pisellSelectCustomerModal/RightPanel/Add/BirthdayField/index.d.ts +0 -1
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/GenderField/index.d.ts +0 -1
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/index.d.ts +0 -1
- package/es/components/productExtension/fields/Actor/index.d.ts +0 -1
- package/es/components/productExtension/fields/Forms/index.d.ts +0 -1
- package/es/components/productExtension/fields/SelectProducts/ProductItem/index.d.ts +0 -1
- package/es/components/productExtension/fields/SelectProducts/ProductItemPreview/index.d.ts +0 -1
- package/es/components/productExtension/fields/SelectProducts/index.d.ts +0 -1
- package/es/components/productExtension/fields/SelectResourcesTable/index.d.ts +0 -1
- package/es/components/ruleSetting/ruleBorder/index.d.ts +0 -1
- package/es/components/schedules/calendar/calendarItem.d.ts +0 -1
- package/es/components/schedules/calendar/index.d.ts +0 -1
- package/es/components/schedules/components/CurrentDay/index.d.ts +0 -1
- package/es/components/schedules/components/ScheduleDetailList/index.d.ts +0 -1
- package/es/components/schedules/components/ScheduleList/index.d.ts +0 -1
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.d.ts +0 -1
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/ResourcesModule/index.d.ts +0 -1
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +0 -1
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +0 -1
- package/es/components/schedules/products/ProductDetailDrawer/index.d.ts +0 -1
- package/es/components/schedules/products/index.d.ts +0 -1
- package/es/components/schedules/products/list/ProductItem/index.d.ts +0 -1
- package/es/components/schedules/products/list/index.d.ts +0 -1
- package/es/components/schedules/resources/index.d.ts +0 -1
- package/es/components/schedules/resources/list/index.d.ts +0 -1
- package/es/components/schedules/resources/relationProduct/index.d.ts +0 -1
- package/es/components/schedules/schedules/AllSchedules/index.d.ts +0 -1
- package/es/components/schedules/schedules/ScheduleDetailDrawer/index.d.ts +0 -1
- package/es/components/schedules/schedules/index.d.ts +0 -1
- package/es/components/shoppingCart/components/Empty/index.d.ts +0 -1
- package/es/components/shoppingCart/components/Render/index.d.ts +0 -1
- package/es/components/shoppingCart/index.d.ts +0 -1
- package/es/components/wallet/hooks/useWalletCard.d.ts +0 -1
- package/es/hooks/usePaymentLogger.d.ts +22 -0
- package/es/hooks/usePaymentLogger.js +78 -0
- package/es/plus/saasCreateOrganization/components/Header.d.ts +0 -1
- package/es/plus/saasRegister/components/EntryEmail.d.ts +0 -1
- package/es/plus/saasRegister/components/EntryInfo.d.ts +0 -1
- package/es/plus/saasRegister/components/GoLogin.d.ts +0 -1
- package/es/plus/saasRegister/components/Header.d.ts +0 -1
- package/es/plus/saasRegister/components/VerifyError.d.ts +0 -1
- package/es/plus/saasRegister/components/VerifyingLink.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Cart/Item/index.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Services/index.js +12 -3
- package/lib/components/appointmentBooking/hooks.js +6 -0
- package/lib/components/booking/components/TabProduct/index.d.ts +0 -1
- package/lib/components/booking/components/TabProduct/productItem/index.d.ts +0 -1
- package/lib/components/booking/components/TabProduct/selectProductItem/index.d.ts +0 -1
- package/lib/components/booking/components/collapsibleList/utils.d.ts +0 -1
- package/lib/components/booking/components/emptyBooking/index.d.ts +0 -1
- package/lib/components/booking/components/footer/FooterMenus/index.d.ts +0 -1
- package/lib/components/booking/components/formItemChildrenWrap/index.d.ts +0 -1
- package/lib/components/booking/forms/single/index.d.ts +0 -1
- package/lib/components/booking/forms/table/index.d.ts +0 -1
- package/lib/components/booking/info/clientVariant/hooks/useClientFn.d.ts +0 -1
- package/lib/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
- package/lib/components/booking/info/date/index.d.ts +0 -1
- package/lib/components/booking/info/notes/index.d.ts +0 -1
- package/lib/components/booking/info/service/actions/index.d.ts +0 -1
- package/lib/components/booking/info/service/like/index.d.ts +0 -1
- package/lib/components/booking/info2/service/actions/index.d.ts +0 -1
- package/lib/components/booking/locales.d.ts +6 -0
- package/lib/components/booking/locales.js +6 -0
- package/lib/components/booking/materiels/contacts/index.d.ts +0 -1
- package/lib/components/booking/materiels/duration/index.d.ts +0 -1
- package/lib/components/booking/materiels/holder/index.d.ts +0 -1
- package/lib/components/booking/materiels/startTime/index.d.ts +0 -1
- package/lib/components/booking/notes/NoteBlock/NoteItem/index.d.ts +0 -1
- package/lib/components/booking/notes/NoteBlock/index.d.ts +0 -1
- package/lib/components/eftpos/deviceList/index.d.ts +0 -1
- package/lib/components/eftpos/form/index.d.ts +0 -1
- package/lib/components/eftpos/group/index.d.ts +0 -1
- package/lib/components/eftpos/hooks.d.ts +0 -1
- package/lib/components/eftpos/icon/apiKey.d.ts +0 -1
- package/lib/components/eftpos/icon/device.d.ts +0 -1
- package/lib/components/eftpos/index.d.ts +0 -1
- package/lib/components/eftpos/pos.d.ts +0 -1
- package/lib/components/eftpos/receipt/index.d.ts +0 -1
- package/lib/components/eftposPay/amount.d.ts +0 -1
- package/lib/components/eftposPay/component/alert/warn.d.ts +0 -1
- package/lib/components/eftposPay/component/fail/failCustom.d.ts +0 -1
- package/lib/components/eftposPay/component/fail/index.d.ts +0 -1
- package/lib/components/eftposPay/component/fail/network.d.ts +0 -1
- package/lib/components/eftposPay/component/fail/unknow.d.ts +0 -1
- package/lib/components/eftposPay/component/header/titlebar.d.ts +0 -1
- package/lib/components/eftposPay/component/manual/index.d.ts +0 -1
- package/lib/components/eftposPay/component/signature/index.d.ts +0 -1
- package/lib/components/eftposPay/component/step/index.d.ts +0 -1
- package/lib/components/eftposPay/component/step/step.d.ts +0 -1
- package/lib/components/eftposPay/hooks.d.ts +1 -1
- package/lib/components/eftposPay/linkly/hooks/useTimeQuery.js +43 -11
- package/lib/components/eftposPay/pay.d.ts +0 -1
- package/lib/components/eftposPay/payo/config.d.ts +0 -1
- package/lib/components/eftposPay/payo/config.js +9 -9
- package/lib/components/eftposPay/store/index.d.ts +1 -1
- package/lib/components/eftposPay/tip.d.ts +0 -1
- package/lib/components/eftposPay/tyro/hooks.d.ts +0 -1
- package/lib/components/eftposPay/windcave/receiptAction.d.ts +0 -1
- package/lib/components/eftposPay/windcave/windcave.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/Content/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/Header/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/SelectHolderModal.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +0 -1
- package/lib/components/eventBooking/components/scheduleCalendar/ProductItem/index.d.ts +0 -1
- package/lib/components/login/index.d.ts +0 -1
- 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/MWCreditCard/tds2.js +2 -0
- package/lib/components/pay/toC/PaymentMethods/OfflinePayment/index.js +72 -10
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +0 -1
- 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/pisellSelectCustomerModal/RightPanel/Add/BirthdayField/index.d.ts +0 -1
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/GenderField/index.d.ts +0 -1
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/index.d.ts +0 -1
- package/lib/components/productExtension/fields/Actor/index.d.ts +0 -1
- package/lib/components/productExtension/fields/Forms/index.d.ts +0 -1
- package/lib/components/productExtension/fields/SelectProducts/ProductItem/index.d.ts +0 -1
- package/lib/components/productExtension/fields/SelectProducts/ProductItemPreview/index.d.ts +0 -1
- package/lib/components/productExtension/fields/SelectProducts/index.d.ts +0 -1
- package/lib/components/productExtension/fields/SelectResourcesTable/index.d.ts +0 -1
- package/lib/components/ruleSetting/ruleBorder/index.d.ts +0 -1
- package/lib/components/schedules/calendar/calendarItem.d.ts +0 -1
- package/lib/components/schedules/calendar/index.d.ts +0 -1
- package/lib/components/schedules/components/CurrentDay/index.d.ts +0 -1
- package/lib/components/schedules/components/ScheduleDetailList/index.d.ts +0 -1
- package/lib/components/schedules/components/ScheduleList/index.d.ts +0 -1
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.d.ts +0 -1
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/ResourcesModule/index.d.ts +0 -1
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +0 -1
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +0 -1
- package/lib/components/schedules/products/ProductDetailDrawer/index.d.ts +0 -1
- package/lib/components/schedules/products/index.d.ts +0 -1
- package/lib/components/schedules/products/list/ProductItem/index.d.ts +0 -1
- package/lib/components/schedules/products/list/index.d.ts +0 -1
- package/lib/components/schedules/resources/index.d.ts +0 -1
- package/lib/components/schedules/resources/list/index.d.ts +0 -1
- package/lib/components/schedules/resources/relationProduct/index.d.ts +0 -1
- package/lib/components/schedules/schedules/AllSchedules/index.d.ts +0 -1
- package/lib/components/schedules/schedules/ScheduleDetailDrawer/index.d.ts +0 -1
- package/lib/components/schedules/schedules/index.d.ts +0 -1
- package/lib/components/shoppingCart/components/Empty/index.d.ts +0 -1
- package/lib/components/shoppingCart/components/Render/index.d.ts +0 -1
- package/lib/components/shoppingCart/index.d.ts +0 -1
- package/lib/components/wallet/hooks/useWalletCard.d.ts +0 -1
- package/lib/hooks/usePaymentLogger.d.ts +22 -0
- package/lib/hooks/usePaymentLogger.js +69 -0
- package/lib/plus/saasCreateOrganization/components/Header.d.ts +0 -1
- package/lib/plus/saasRegister/components/EntryEmail.d.ts +0 -1
- package/lib/plus/saasRegister/components/EntryInfo.d.ts +0 -1
- package/lib/plus/saasRegister/components/GoLogin.d.ts +0 -1
- package/lib/plus/saasRegister/components/Header.d.ts +0 -1
- package/lib/plus/saasRegister/components/VerifyError.d.ts +0 -1
- package/lib/plus/saasRegister/components/VerifyingLink.d.ts +0 -1
- package/package.json +3 -3
|
@@ -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;
|
|
@@ -93,7 +93,10 @@ var Services = (0, import_react.forwardRef)((props, ref) => {
|
|
|
93
93
|
delete product.option;
|
|
94
94
|
if (isRetailTemplate) {
|
|
95
95
|
if (data == null ? void 0 : data.isCancel) return;
|
|
96
|
-
appointmentBooking.storeProduct(product);
|
|
96
|
+
const res = appointmentBooking.storeProduct(product);
|
|
97
|
+
if (!res.success && res.errorCode === "not_enough_stock") {
|
|
98
|
+
return (0, import_utils2.Toast)(import_utils.locales.getText("pisell2.appointment.unuse.stock"));
|
|
99
|
+
}
|
|
97
100
|
return;
|
|
98
101
|
}
|
|
99
102
|
if (data == null ? void 0 : data.isCancel) {
|
|
@@ -107,13 +110,16 @@ var Services = (0, import_react.forwardRef)((props, ref) => {
|
|
|
107
110
|
if (session) {
|
|
108
111
|
const startDate = (0, import_dayjs.default)(session == null ? void 0 : session.start_at).format("YYYY-MM-DD");
|
|
109
112
|
const endDate = (0, import_dayjs.default)(session == null ? void 0 : session.end_at).format("YYYY-MM-DD");
|
|
110
|
-
appointmentBooking.addProductToCart({
|
|
113
|
+
const res = appointmentBooking.addProductToCart({
|
|
111
114
|
product: { ...product },
|
|
112
115
|
date: {
|
|
113
116
|
startTime: `${startDate} ${session == null ? void 0 : session.start_time}`,
|
|
114
117
|
endTime: `${endDate} ${session == null ? void 0 : session.end_time}`
|
|
115
118
|
}
|
|
116
119
|
});
|
|
120
|
+
if (!res.success && res.errorCode === "not_enough_stock") {
|
|
121
|
+
return (0, import_utils2.Toast)(import_utils.locales.getText("pisell2.appointment.unuse.stock"));
|
|
122
|
+
}
|
|
117
123
|
appointmentBooking.closeProductDetail();
|
|
118
124
|
await appointmentBooking.getAvailableDate({
|
|
119
125
|
startDate,
|
|
@@ -127,7 +133,10 @@ var Services = (0, import_react.forwardRef)((props, ref) => {
|
|
|
127
133
|
import_utils.locales.getText("pisell2.appointment.no.available.service")
|
|
128
134
|
);
|
|
129
135
|
}
|
|
130
|
-
appointmentBooking.storeProduct(product);
|
|
136
|
+
const res = appointmentBooking.storeProduct(product);
|
|
137
|
+
if (!res.success && res.errorCode === "not_enough_stock") {
|
|
138
|
+
return (0, import_utils2.Toast)(import_utils.locales.getText("pisell2.appointment.unuse.stock"));
|
|
139
|
+
}
|
|
131
140
|
if (type === "duration") {
|
|
132
141
|
await appointmentBooking.getAvailableDate();
|
|
133
142
|
}
|
|
@@ -189,6 +189,12 @@ var useAppointmentBookingStep = () => {
|
|
|
189
189
|
if (!result) {
|
|
190
190
|
return (0, import_utils2.Toast)(import_utils.locales.getText("pisell2.appointment.unuse.date"));
|
|
191
191
|
}
|
|
192
|
+
const capacityResult = appointmentBooking.checkMaxDurationCapacity();
|
|
193
|
+
if (!capacityResult.success) {
|
|
194
|
+
const getMessage = import_utils.locales.getText("pisell2.appointment.unuse.capacity");
|
|
195
|
+
const message = typeof getMessage === "function" ? getMessage(capacityResult.minAvailableCount) : getMessage;
|
|
196
|
+
return (0, import_utils2.Toast)(message);
|
|
197
|
+
}
|
|
192
198
|
}
|
|
193
199
|
if (!isRetailTemplate && (currentKey == null ? void 0 : currentKey.startsWith("select-resource"))) {
|
|
194
200
|
const { hasError, updatedCartList } = (0, import_utils2.checkAndMarkCartRenderError)(currentSelectedResources, appointmentBooking, utils);
|
|
@@ -156,6 +156,8 @@ declare const _default: {
|
|
|
156
156
|
'pisell2.text.deposit-delete-message': string;
|
|
157
157
|
'pisell2.text.deposit-paid': string;
|
|
158
158
|
"pisell2.text.stock": string;
|
|
159
|
+
'pisell2.appointment.unuse.stock': string;
|
|
160
|
+
'pisell2.appointment.unuse.capacity': (count: number) => string;
|
|
159
161
|
'pisell2.text.payment-link': string;
|
|
160
162
|
'pisell2.text.send-mail': string;
|
|
161
163
|
'pisell2.text.copy-to-clipboard': string;
|
|
@@ -429,6 +431,8 @@ declare const _default: {
|
|
|
429
431
|
'pisell2.text.deposit-delete-message': string;
|
|
430
432
|
'pisell2.text.deposit-paid': string;
|
|
431
433
|
"pisell2.text.stock": string;
|
|
434
|
+
'pisell2.appointment.unuse.stock': string;
|
|
435
|
+
'pisell2.appointment.unuse.capacity': (count: number) => string;
|
|
432
436
|
'pisell2.text.payment-link': string;
|
|
433
437
|
'pisell2.text.send-mail': string;
|
|
434
438
|
'pisell2.text.copy-to-clipboard': string;
|
|
@@ -702,6 +706,8 @@ declare const _default: {
|
|
|
702
706
|
'pisell2.text.deposit-delete-message': string;
|
|
703
707
|
'pisell2.text.deposit-paid': string;
|
|
704
708
|
"pisell2.text.stock": string;
|
|
709
|
+
'pisell2.appointment.unuse.stock': string;
|
|
710
|
+
'pisell2.appointment.unuse.capacity': (count: number) => string;
|
|
705
711
|
'pisell2.text.payment-link': string;
|
|
706
712
|
'pisell2.text.send-mail': string;
|
|
707
713
|
'pisell2.text.copy-to-clipboard': string;
|
|
@@ -200,6 +200,8 @@ var locales_default = {
|
|
|
200
200
|
"pisell2.text.deposit-delete-message": "It cannot be restored after deletion. Please confirm the operation.",
|
|
201
201
|
"pisell2.text.deposit-paid": "Deposit paid",
|
|
202
202
|
"pisell2.text.stock": "Stock",
|
|
203
|
+
"pisell2.appointment.unuse.stock": "Not enough stock",
|
|
204
|
+
"pisell2.appointment.unuse.capacity": (count) => `Only ${count} spots available. Please reduce quantity.`,
|
|
203
205
|
"pisell2.text.payment-link": "Payment link",
|
|
204
206
|
"pisell2.text.send-mail": "Send email",
|
|
205
207
|
"pisell2.text.copy-to-clipboard": "Copy to clipboard",
|
|
@@ -505,6 +507,8 @@ var locales_default = {
|
|
|
505
507
|
"pisell2.text.deposit-delete-message": "删除后不可恢复,请确认操作",
|
|
506
508
|
"pisell2.text.deposit-paid": "已付定金",
|
|
507
509
|
"pisell2.text.stock": "库存",
|
|
510
|
+
"pisell2.appointment.unuse.stock": "库存不足",
|
|
511
|
+
"pisell2.appointment.unuse.capacity": (count) => `仅可预约 ${count} 个,请减少数量`,
|
|
508
512
|
"pisell2.text.payment-link": "付款链接",
|
|
509
513
|
"pisell2.text.send-mail": "发送邮件",
|
|
510
514
|
"pisell2.text.copy-to-clipboard": "复制到剪切板",
|
|
@@ -810,6 +814,8 @@ var locales_default = {
|
|
|
810
814
|
"pisell2.text.deposit-delete-message": "刪除後不可恢復,請確認操作",
|
|
811
815
|
"pisell2.text.deposit-paid": "已付定金",
|
|
812
816
|
"pisell2.text.stock": "庫存",
|
|
817
|
+
"pisell2.appointment.unuse.stock": "庫存不足",
|
|
818
|
+
"pisell2.appointment.unuse.capacity": (count) => `僅可預約 ${count} 個,請減少數量`,
|
|
813
819
|
"pisell2.text.payment-link": "付款鏈接",
|
|
814
820
|
"pisell2.text.send-mail": "發送郵件",
|
|
815
821
|
"pisell2.text.copy-to-clipboard": "複製到剪切板",
|