@pisell/private-materials 3.4.2 → 3.4.3

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 (29) 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/meta.js +1 -1
  5. package/build/lowcode/render/default/view.js +1 -1
  6. package/build/lowcode/view.js +1 -1
  7. package/es/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +44 -18
  8. package/lib/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +66 -47
  9. package/package.json +3 -3
  10. package/es/components/Sales/Customer/index.d.ts +0 -25
  11. package/es/components/appointmentBooking/components/Form/index.d.ts +0 -4
  12. package/es/components/appointmentBooking/components/Form/utils.d.ts +0 -8
  13. package/es/components/booking/info/service/Lists.d.ts +0 -2
  14. package/es/components/booking/info2/service/index.d.ts +0 -4
  15. package/es/components/booking/info2/utils.d.ts +0 -4
  16. package/es/components/pay/toC/PaymentMethods/WalletPass/serve.d.ts +0 -113
  17. package/es/components/pay/toC/utils.d.ts +0 -57
  18. package/es/components/shoppingCart/components/Cart/Product.d.ts +0 -3
  19. package/es/components/ticketBooking/locales.d.ts +0 -171
  20. package/lib/components/Sales/Customer/index.d.ts +0 -25
  21. package/lib/components/appointmentBooking/components/Form/index.d.ts +0 -4
  22. package/lib/components/appointmentBooking/components/Form/utils.d.ts +0 -8
  23. package/lib/components/booking/info/service/Lists.d.ts +0 -2
  24. package/lib/components/booking/info2/service/index.d.ts +0 -4
  25. package/lib/components/booking/info2/utils.d.ts +0 -4
  26. package/lib/components/pay/toC/PaymentMethods/WalletPass/serve.d.ts +0 -113
  27. package/lib/components/pay/toC/utils.d.ts +0 -57
  28. package/lib/components/shoppingCart/components/Cart/Product.d.ts +0 -3
  29. package/lib/components/ticketBooking/locales.d.ts +0 -171
@@ -108,26 +108,32 @@ export var startPayment = /*#__PURE__*/function () {
108
108
  return _context.abrupt("return");
109
109
  case 24:
110
110
  _context.next = 26;
111
- return checkTDSAuth(step2, step3);
111
+ return checkTDSAuth(step2, step3, callback);
112
112
  case 26:
113
113
  step4 = _context.sent;
114
+ if (!(step4 === 0)) {
115
+ _context.next = 29;
116
+ break;
117
+ }
118
+ return _context.abrupt("return");
119
+ case 29:
114
120
  paymentData.step4 = step4;
115
121
 
116
122
  // 返回数据执行步骤5, 没有则略过 5&6
117
123
  if (!step4) {
118
- _context.next = 35;
124
+ _context.next = 37;
119
125
  break;
120
126
  }
121
- _context.next = 31;
127
+ _context.next = 33;
122
128
  return createChallengeIframe(step4, callback);
123
- case 31:
129
+ case 33:
124
130
  step5 = _context.sent;
125
131
  paymentData.step5 = step5;
126
132
 
127
133
  // 步骤6, 换取token
128
- _context.next = 35;
134
+ _context.next = 37;
129
135
  return checkPARes(step2, step4, step5);
130
- case 35:
136
+ case 37:
131
137
  callback({
132
138
  key: 'hideModal'
133
139
  });
@@ -136,8 +142,8 @@ export var startPayment = /*#__PURE__*/function () {
136
142
  status: 'success'
137
143
  }, paymentInfo), callback);
138
144
  return _context.abrupt("return", true);
139
- case 40:
140
- _context.prev = 40;
145
+ case 42:
146
+ _context.prev = 42;
141
147
  _context.t1 = _context["catch"](2);
142
148
  console.log('error', _context.t1);
143
149
  callback({
@@ -145,21 +151,21 @@ export var startPayment = /*#__PURE__*/function () {
145
151
  });
146
152
  closeIframe();
147
153
  if (!(_context.t1 === 0)) {
148
- _context.next = 47;
154
+ _context.next = 49;
149
155
  break;
150
156
  }
151
157
  return _context.abrupt("return");
152
- case 47:
158
+ case 49:
153
159
  paymentData.error = _context.t1;
154
160
  paymentEnd(_objectSpread({
155
161
  status: 'fail'
156
162
  }, paymentInfo), callback);
157
163
  return _context.abrupt("return", false);
158
- case 50:
164
+ case 52:
159
165
  case "end":
160
166
  return _context.stop();
161
167
  }
162
- }, _callee, null, [[2, 40]]);
168
+ }, _callee, null, [[2, 42]]);
163
169
  }));
164
170
  return function startPayment(_x, _x2) {
165
171
  return _ref2.apply(this, arguments);
@@ -334,6 +340,7 @@ export var checkTDSAuth = /*#__PURE__*/function () {
334
340
  return _regeneratorRuntime().wrap(function _callee4$(_context4) {
335
341
  while (1) switch (_context4.prev = _context4.next) {
336
342
  case 0:
343
+ _context4.prev = 0;
337
344
  pay_number = step2.pay_number, order_id = step2.order_id, pay_info = step2.pay_info, amount = step2.amount, notifyURL = step2.notifyURL;
338
345
  threeDSServerTransID = step3.threeDSServerTransID, threeDSCompInd = step3.threeDSCompInd;
339
346
  currentData = new Date();
@@ -341,7 +348,7 @@ export var checkTDSAuth = /*#__PURE__*/function () {
341
348
  if (REACT_APP_API_ENV === 'pre' && pay_info.check_tds_auth.card_name === 'aa bb') {
342
349
  isPre = true;
343
350
  }
344
- _context4.next = 7;
351
+ _context4.next = 8;
345
352
  return request.getRequest().post('/h5/pay/order/mw-3ds-pay/v2/tds_auth_pay', {
346
353
  order_id: order_id,
347
354
  pay_number: pay_number,
@@ -379,21 +386,40 @@ export var checkTDSAuth = /*#__PURE__*/function () {
379
386
  notifyURL: notifyURL
380
387
  }
381
388
  });
382
- case 7:
389
+ case 8:
383
390
  _yield$request$getReq2 = _context4.sent;
384
391
  data = _yield$request$getReq2.data;
385
392
  if (data) {
386
- _context4.next = 11;
393
+ _context4.next = 12;
387
394
  break;
388
395
  }
389
396
  return _context4.abrupt("return", null);
390
- case 11:
391
- return _context4.abrupt("return", data);
392
397
  case 12:
398
+ return _context4.abrupt("return", data);
399
+ case 15:
400
+ _context4.prev = 15;
401
+ _context4.t0 = _context4["catch"](0);
402
+ // 记录卡失败的原因
403
+ log({
404
+ msg: _context4.t0,
405
+ data: paymentData
406
+ });
407
+ PisellToast({
408
+ content: (_context4.t0 === null || _context4.t0 === void 0 ? void 0 : _context4.t0.message) || '',
409
+ duration: 1000 * 200,
410
+ onClose: function onClose() {
411
+ callback({
412
+ key: 'hideModal'
413
+ });
414
+ closeIframe();
415
+ }
416
+ });
417
+ return _context4.abrupt("return", 0);
418
+ case 20:
393
419
  case "end":
394
420
  return _context4.stop();
395
421
  }
396
- }, _callee4);
422
+ }, _callee4, null, [[0, 15]]);
397
423
  }));
398
424
  return function checkTDSAuth(_x8, _x9, _x10) {
399
425
  return _ref5.apply(this, arguments);
@@ -95,7 +95,10 @@ var startPayment = async ({ orderId, cardInfo, payData }, callback) => {
95
95
  if (step3 === "N") {
96
96
  return;
97
97
  }
98
- const step4 = await checkTDSAuth(step2, step3);
98
+ const step4 = await checkTDSAuth(step2, step3, callback);
99
+ if (step4 === 0) {
100
+ return;
101
+ }
99
102
  paymentData.step4 = step4;
100
103
  if (step4) {
101
104
  const step5 = await createChallengeIframe(step4, callback);
@@ -216,54 +219,70 @@ var createThreeDSMethodIframe = async (threeDSMethodData, callback) => {
216
219
  });
217
220
  };
218
221
  var checkTDSAuth = async (step2, step3, callback) => {
219
- const { pay_number, order_id, pay_info, amount, notifyURL } = step2;
220
- const { threeDSServerTransID, threeDSCompInd } = step3;
221
- var currentData = /* @__PURE__ */ new Date();
222
- let isPre = false;
223
- if (REACT_APP_API_ENV === "pre" && pay_info.check_tds_auth.card_name === "aa bb") {
224
- isPre = true;
225
- }
226
- let { data } = await import_utils.request.getRequest().post("/h5/pay/order/mw-3ds-pay/v2/tds_auth_pay", {
227
- order_id,
228
- pay_number,
229
- mw_data: {
230
- accessToken: pay_info.check_tds_auth.access_token,
231
- method: "checkTDSAuth",
232
- cardID: pay_info.check_tds_auth.card_id,
233
- // paymentCardNumber: cardInfo.paymentCardNumber,
234
- paymentCardExpiry: pay_info.check_tds_auth.card_expiry,
235
- paymentCardName: pay_info.check_tds_auth.card_name,
236
- // paymentCardCSC: cardInfo.paymentCardCSC,
237
- customerName: pay_info.check_tds_auth.card_name,
238
- transactionAmount: amount,
239
- transactionCurrency: paymentInfo.transactionInfo.transactionCurrency,
240
- transactionProduct: pay_info.check_tds_auth.product_name,
241
- browserAcceptHeader: "*/*",
242
- browserColorDepth: screen.colorDepth,
243
- browserJavaEnabled: navigator.javaEnabled(),
244
- browserJavascriptEnabled: true,
245
- browserLanguage: navigator.language,
246
- browserScreenHeight: screen.height,
247
- browserScreenWidth: screen.width,
248
- browserTZ: currentData.getTimezoneOffset(),
249
- browserUserAgent: navigator.userAgent,
250
- purchaseDate: "20220420165834",
251
- billAddrCity: paymentInfo.billingAddress.billAddrCity,
252
- billAddrCountry: paymentInfo.billingAddress.billAddrCountry,
253
- billAddrLine1: paymentInfo.billingAddress.billAddrLine1,
254
- billAddrPostCode: paymentInfo.billingAddress.billAddrPostCode,
255
- billAddrState: paymentInfo.billingAddress.billAddrState,
256
- threeDSCompInd: isPre ? "" : threeDSCompInd,
257
- threeDSServerTransID: isPre ? "" : threeDSServerTransID,
258
- threeDSRequestorAuthenticationInd: "01",
259
- threeDSRequestorURL: window.location.href,
260
- notifyURL
222
+ try {
223
+ const { pay_number, order_id, pay_info, amount, notifyURL } = step2;
224
+ const { threeDSServerTransID, threeDSCompInd } = step3;
225
+ var currentData = /* @__PURE__ */ new Date();
226
+ let isPre = false;
227
+ if (REACT_APP_API_ENV === "pre" && pay_info.check_tds_auth.card_name === "aa bb") {
228
+ isPre = true;
261
229
  }
262
- });
263
- if (!data) {
264
- return null;
230
+ let { data } = await import_utils.request.getRequest().post("/h5/pay/order/mw-3ds-pay/v2/tds_auth_pay", {
231
+ order_id,
232
+ pay_number,
233
+ mw_data: {
234
+ accessToken: pay_info.check_tds_auth.access_token,
235
+ method: "checkTDSAuth",
236
+ cardID: pay_info.check_tds_auth.card_id,
237
+ // paymentCardNumber: cardInfo.paymentCardNumber,
238
+ paymentCardExpiry: pay_info.check_tds_auth.card_expiry,
239
+ paymentCardName: pay_info.check_tds_auth.card_name,
240
+ // paymentCardCSC: cardInfo.paymentCardCSC,
241
+ customerName: pay_info.check_tds_auth.card_name,
242
+ transactionAmount: amount,
243
+ transactionCurrency: paymentInfo.transactionInfo.transactionCurrency,
244
+ transactionProduct: pay_info.check_tds_auth.product_name,
245
+ browserAcceptHeader: "*/*",
246
+ browserColorDepth: screen.colorDepth,
247
+ browserJavaEnabled: navigator.javaEnabled(),
248
+ browserJavascriptEnabled: true,
249
+ browserLanguage: navigator.language,
250
+ browserScreenHeight: screen.height,
251
+ browserScreenWidth: screen.width,
252
+ browserTZ: currentData.getTimezoneOffset(),
253
+ browserUserAgent: navigator.userAgent,
254
+ purchaseDate: "20220420165834",
255
+ billAddrCity: paymentInfo.billingAddress.billAddrCity,
256
+ billAddrCountry: paymentInfo.billingAddress.billAddrCountry,
257
+ billAddrLine1: paymentInfo.billingAddress.billAddrLine1,
258
+ billAddrPostCode: paymentInfo.billingAddress.billAddrPostCode,
259
+ billAddrState: paymentInfo.billingAddress.billAddrState,
260
+ threeDSCompInd: isPre ? "" : threeDSCompInd,
261
+ threeDSServerTransID: isPre ? "" : threeDSServerTransID,
262
+ threeDSRequestorAuthenticationInd: "01",
263
+ threeDSRequestorURL: window.location.href,
264
+ notifyURL
265
+ }
266
+ });
267
+ if (!data) {
268
+ return null;
269
+ }
270
+ return data;
271
+ } catch (err) {
272
+ log({
273
+ msg: err,
274
+ data: paymentData
275
+ });
276
+ (0, import_materials.PisellToast)({
277
+ content: (err == null ? void 0 : err.message) || "",
278
+ duration: 1e3 * 200,
279
+ onClose() {
280
+ callback({ key: "hideModal" });
281
+ closeIframe();
282
+ }
283
+ });
284
+ return 0;
265
285
  }
266
- return data;
267
286
  };
268
287
  var createChallengeIframe = (challengeData, callback) => {
269
288
  const displayBox = document.getElementById("threeds-container");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/private-materials",
3
- "version": "3.4.2",
3
+ "version": "3.4.3",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -59,9 +59,9 @@
59
59
  "react-infinite-scroll-component": "^6.1.0",
60
60
  "rc-virtual-list": "^3.11.3",
61
61
  "decimal.js": "^10.4.3",
62
- "@pisell/utils": "3.0.0",
63
- "@pisell/icon": "0.0.11",
64
62
  "@pisell/materials": "3.3.37",
63
+ "@pisell/icon": "0.0.11",
64
+ "@pisell/utils": "3.0.0",
65
65
  "@pisell/date-picker": "3.0.2"
66
66
  },
67
67
  "peerDependencies": {
@@ -1,25 +0,0 @@
1
- import React from 'react';
2
- interface CustomerData {
3
- }
4
- interface CustomerContextType {
5
- appContext: any;
6
- appUtils: any;
7
- isLogin: () => boolean;
8
- openLoginModal: (params: any) => void;
9
- getUserInfo: () => any;
10
- }
11
- interface CustomerProviderProps {
12
- children: React.ReactNode;
13
- }
14
- export declare const CustomerContext: React.Context<CustomerContextType | undefined>;
15
- export declare const CustomerProvider: React.FC<CustomerProviderProps>;
16
- /**
17
- * 使用步骤管理的Hook
18
- * @throws {Error} 如果在StepProvider外部使用会抛出错误
19
- * @returns {StepContextType} 步骤管理上下文
20
- */
21
- export declare const useCustomer: () => CustomerContextType;
22
- declare const _default: {
23
- defaultState: CustomerData;
24
- };
25
- export default _default;
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- import './index.less';
3
- declare const Form: React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<unknown>>;
4
- export default Form;
@@ -1,8 +0,0 @@
1
- /**
2
- * @title: 更新表单数据
3
- * @description:
4
- * @return {*}
5
- * @Author: WangHan
6
- * @Date: 2025-05-26 16:58
7
- */
8
- export declare const updateRelationForms: (carts: any[], currentCart: any, values: any, currentStepKey?: string) => any;
@@ -1,2 +0,0 @@
1
- declare const Lists: ({ onEdit, onChange, onAction, isParallelResource }: any) => JSX.Element;
2
- export default Lists;
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- import '../../info/service/index.less';
3
- declare const _default: React.MemoExoticComponent<() => JSX.Element>;
4
- export default _default;
@@ -1,4 +0,0 @@
1
- export declare const getFormatResourceListAndMap: (data: any[], bookingId?: number[]) => {
2
- list: any[];
3
- listMap: any;
4
- };
@@ -1,113 +0,0 @@
1
- export declare type MachineCodeListParams = {
2
- order_id: number | string;
3
- available: number;
4
- prepare_payments: {
5
- voucher_id: number;
6
- amount: number;
7
- tag: string;
8
- }[];
9
- filter_prepare_wallet_pass: 1 | 0;
10
- sale_channel: string;
11
- other_exact_codes?: string[];
12
- };
13
- export declare type WalletPassDataType = {
14
- id: number;
15
- shop_id: number;
16
- customer_id: number;
17
- code: string;
18
- encoded: string;
19
- status: string;
20
- cover: string;
21
- tag: string;
22
- relation_type: string;
23
- product_id: number;
24
- limit_status: string;
25
- sales_status: number;
26
- par_value: string;
27
- used_par_value: string;
28
- start_date: string;
29
- expire_date: string;
30
- end_time: string;
31
- start_time: string;
32
- created_at: string;
33
- product_name: string;
34
- expire_time: string;
35
- available_max_par_value: string;
36
- available_max_amount: string;
37
- recommended_usage_amount: string;
38
- custom_expire_status: number;
39
- wallet_pass_usage_unit: WalletPassUsageUnit;
40
- custom_order_deduct_exhausted: number;
41
- available_product_status: number;
42
- available_product_ids: any[];
43
- available_product_type: string;
44
- available_num: number;
45
- available_product_title: string;
46
- unified_available_status: number;
47
- unified_messages: UnifiedMessages;
48
- external_card: any[];
49
- product: Product;
50
- shop: Shop;
51
- wallet_pass_usage?: any;
52
- balance_par_value: string;
53
- };
54
- declare type Shop = {
55
- id: number;
56
- name: string;
57
- default_url: string;
58
- };
59
- declare type Product = {
60
- id: number;
61
- title: string;
62
- cover: string;
63
- is_charge_tax: number;
64
- };
65
- declare type UnifiedMessages = {
66
- title: string;
67
- desc: string;
68
- alert: string;
69
- };
70
- declare type WalletPassUsageUnit = {
71
- price: number;
72
- points: number;
73
- };
74
- /**
75
- * 查询支付识别码列表
76
- */
77
- export declare const getMachineCodeList: (params: MachineCodeListParams) => Promise<WalletPassDataType[]>;
78
- /**
79
- * 获取推荐的支付识别码
80
- */
81
- export declare const getRecommendMachineCodeList: (order_id: number) => Promise<WalletPassDataType[]>;
82
- /**
83
- * 搜索支付识别码
84
- */
85
- export declare const searchMachineCodeList: (params: {
86
- order_id: number | string;
87
- code: string;
88
- sale_channel: string;
89
- prepare_payments: {
90
- voucher_id: number;
91
- amount: number;
92
- tag: string;
93
- }[];
94
- filter_prepare_wallet_pass: 1 | 0;
95
- }) => Promise<WalletPassDataType[]>;
96
- /**
97
- * walletpass支付
98
- */
99
- export declare const walletPassPay: (params: {
100
- order_id: number | string;
101
- payment_group_id: number;
102
- payments: {
103
- amount: string;
104
- wallet_pass_use_value: string;
105
- voucher_id: number;
106
- tag: string;
107
- wallet_pass_usage_unit: {
108
- price: number;
109
- points: number;
110
- };
111
- }[];
112
- }) => Promise<WalletPassDataType[]>;
113
- export {};
@@ -1,57 +0,0 @@
1
- import { PayGroup } from "./model";
2
- import { WalletPassDataType } from "./PaymentMethods/WalletPass/serve";
3
- /**
4
- * 计算walletPass列表数据的总金额
5
- * @param list
6
- */
7
- export declare const calcWalletPassListAmount: (list: any[]) => any;
8
- /**
9
- * 将walletPass列表数据转换为prepare_payments需要的数据格式
10
- * @param list
11
- */
12
- export declare const formatWalletPassList2PreparePayments: (list?: any[]) => {
13
- voucher_id: any;
14
- amount: number;
15
- tag: any;
16
- }[];
17
- /**
18
- * walletPass支付params
19
- * @param payGroup
20
- */
21
- export declare const formatWalletPassParams: (payGroup: PayGroup) => {
22
- order_id: string;
23
- payment_group_id: number;
24
- payments: {
25
- amount: string;
26
- wallet_pass_use_value: any;
27
- voucher_id: any;
28
- tag: any;
29
- wallet_pass_usage_unit: any;
30
- }[];
31
- };
32
- /**
33
- * @title: 获取是否walletPass和三方支付的组合支付
34
- * @description: 三方支付 (stripe 支付宝 微信 苹果 谷歌)
35
- * @return: *
36
- * @Author: shengjie.zuo
37
- * @Date: 2024-08-30 10:06:17
38
- */
39
- export declare const getIsWalletPassAndTripartitePayment: (payGroup: PayGroup) => boolean | 0 | undefined;
40
- export declare const isFranchiseeShop: (path?: any, history?: any) => any;
41
- /**
42
- * @title: 获取当前连锁加盟店铺shopid
43
- * @description:
44
- * @param {any} param1
45
- * @return {*}
46
- * @Author: chensheng.gu
47
- * @Date: 2024-08-07 10:04
48
- */
49
- export declare const getFranchiseeShopId: (path?: any, history?: any) => number;
50
- export declare const formatFranchiseeRoute: (url: string, history?: any) => string;
51
- export declare const getAvailableMaxAmount: (data: WalletPassDataType) => string;
52
- export declare const clientPayment: (params: {
53
- order_id: number;
54
- type: "aliPay" | "wxPay";
55
- values: any;
56
- interaction?: any;
57
- }) => void;
@@ -1,3 +0,0 @@
1
- import { ProductProps } from '../../type';
2
- declare const Product: (props: ProductProps) => JSX.Element;
3
- export default Product;