@pisell/private-materials 3.4.93 → 3.4.94

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 (73) 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 +9 -9
  7. package/build/lowcode/render/default/view.js +10 -10
  8. package/build/lowcode/view.js +10 -10
  9. package/es/components/booking/addons/model.d.ts +1 -10
  10. package/es/components/booking/forms/model.d.ts +1 -10
  11. package/es/components/booking/info/model.d.ts +1 -10
  12. package/es/components/booking/model.d.ts +1 -9
  13. package/es/components/booking/notes/model.d.ts +1 -10
  14. package/es/components/booking/payments/model.d.ts +1 -10
  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/GlobePayAliPayH5/index.js +52 -44
  18. package/es/components/pay/toC/PaymentMethods/GlobePayPaypalH5/index.js +51 -43
  19. package/es/components/pay/toC/PaymentMethods/GlobePayWxH5/index.js +51 -43
  20. package/es/components/pay/toC/PaymentMethods/MWCreditCard/TDSPay/index.js +24 -15
  21. package/es/components/pay/toC/PaymentMethods/MWCreditCard/index.js +19 -19
  22. package/es/components/pay/toC/PaymentMethods/MWCreditCard/tds2.d.ts +3 -1
  23. package/es/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +32 -27
  24. package/es/components/pay/toC/PaymentMethods/SuperPayAliPayH5/index.js +17 -16
  25. package/es/components/pay/toC/PaymentMethods/SuperPayWxPayH5/index.js +47 -42
  26. package/es/components/pay/toC/PaymentMethods/WalletPass/index.js +2 -2
  27. package/es/components/pay/toC/PaymentMethods/WalletPass/utils.d.ts +7 -0
  28. package/es/components/pay/toC/PaymentMethods/WalletPass/utils.js +18 -1
  29. package/es/components/pay/toC/PaymentMethods/index.js +116 -90
  30. package/es/components/pay/toC/index.js +4 -1
  31. package/es/components/pay/toC/locales.d.ts +5 -0
  32. package/es/components/pay/toC/locales.js +5 -0
  33. package/es/components/pay/toC/model.d.ts +1 -9
  34. package/es/components/pay/toC/payGroup.d.ts +14 -3
  35. package/es/components/pay/toC/payGroup.js +174 -15
  36. package/es/components/pay/toC/serve.d.ts +13 -0
  37. package/es/components/pay/toC/serve.js +30 -0
  38. package/es/components/pay/toC/utils.d.ts +3 -0
  39. package/es/components/pay/toC/utils.js +5 -1
  40. package/es/components/schedules/model.d.ts +1 -9
  41. package/lib/components/booking/addons/model.d.ts +1 -10
  42. package/lib/components/booking/forms/model.d.ts +1 -10
  43. package/lib/components/booking/info/model.d.ts +1 -10
  44. package/lib/components/booking/model.d.ts +1 -9
  45. package/lib/components/booking/notes/model.d.ts +1 -10
  46. package/lib/components/booking/payments/model.d.ts +1 -10
  47. package/lib/components/eftposPay/hooks.d.ts +1 -1
  48. package/lib/components/eftposPay/store/index.d.ts +1 -1
  49. package/lib/components/pay/toC/PaymentMethods/GlobePayAliPayH5/index.js +7 -3
  50. package/lib/components/pay/toC/PaymentMethods/GlobePayPaypalH5/index.js +7 -3
  51. package/lib/components/pay/toC/PaymentMethods/GlobePayWxH5/index.js +7 -3
  52. package/lib/components/pay/toC/PaymentMethods/MWCreditCard/TDSPay/index.js +19 -7
  53. package/lib/components/pay/toC/PaymentMethods/MWCreditCard/index.js +15 -9
  54. package/lib/components/pay/toC/PaymentMethods/MWCreditCard/tds2.d.ts +3 -1
  55. package/lib/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +10 -6
  56. package/lib/components/pay/toC/PaymentMethods/SuperPayAliPayH5/index.js +3 -3
  57. package/lib/components/pay/toC/PaymentMethods/SuperPayWxPayH5/index.js +3 -3
  58. package/lib/components/pay/toC/PaymentMethods/WalletPass/index.js +1 -1
  59. package/lib/components/pay/toC/PaymentMethods/WalletPass/utils.d.ts +7 -0
  60. package/lib/components/pay/toC/PaymentMethods/WalletPass/utils.js +16 -0
  61. package/lib/components/pay/toC/PaymentMethods/index.js +12 -7
  62. package/lib/components/pay/toC/index.js +5 -1
  63. package/lib/components/pay/toC/locales.d.ts +5 -0
  64. package/lib/components/pay/toC/locales.js +5 -0
  65. package/lib/components/pay/toC/model.d.ts +1 -9
  66. package/lib/components/pay/toC/payGroup.d.ts +14 -3
  67. package/lib/components/pay/toC/payGroup.js +60 -4
  68. package/lib/components/pay/toC/serve.d.ts +13 -0
  69. package/lib/components/pay/toC/serve.js +12 -2
  70. package/lib/components/pay/toC/utils.d.ts +3 -0
  71. package/lib/components/pay/toC/utils.js +5 -1
  72. package/lib/components/schedules/model.d.ts +1 -9
  73. package/package.json +3 -3
@@ -1,4 +1,10 @@
1
- import { formatDate, locales } from '@pisell/utils';
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
+ import { formatDate, locales, getUniqueId } from '@pisell/utils';
2
8
  import { globalConfig } from '@pisell/materials';
3
9
  import { getAvailableMaxAmount } from "../../utils";
4
10
  var voucherTime = function voucherTime(data) {
@@ -49,4 +55,15 @@ export var getDataByIds = function getDataByIds(arr, ids) {
49
55
  */
50
56
  export var getIsWalletCode = function getIsWalletCode(val) {
51
57
  return val.startsWith('WL');
58
+ };
59
+ export var formatWalletPassWithUniquePaymentNumber = function formatWalletPassWithUniquePaymentNumber(currentWalletPass) {
60
+ return _objectSpread(_objectSpread({}, currentWalletPass), {}, {
61
+ cards: ((currentWalletPass === null || currentWalletPass === void 0 ? void 0 : currentWalletPass.cards) || []).map(function (item) {
62
+ return _objectSpread(_objectSpread({}, item), {}, {
63
+ metadata: _objectSpread(_objectSpread({}, item.metadata || {}), {}, {
64
+ unique_payment_number: getUniqueId()
65
+ })
66
+ });
67
+ })
68
+ });
52
69
  };
@@ -18,7 +18,7 @@ import CustomPayment from "./CustomPayment";
18
18
  import { isCustomPayment } from "../PaymentList/status";
19
19
  import CashManual from "./CashManual";
20
20
  import GooglePay from "./GooglePay";
21
- import { removePayGroupFromStorage, setPayNumber, syncPayGroupToStorage } from "../payGroup";
21
+ import { clearStashPayGroup, removePayGroupFromStorage, setPayNumber, syncPayGroupToStorage } from "../payGroup";
22
22
  import ApplePay from "./ApplePay";
23
23
  import GlobePayAliPayH5 from "./GlobePayAliPayH5";
24
24
  import GlobePayPaypalH5 from "./GlobePayPaypalH5";
@@ -51,8 +51,9 @@ var PaymentMethods = function PaymentMethods(props, ref) {
51
51
  var GlobePayWxH5Ref = useRef(null);
52
52
  var GlobePayQrcodeRef = useRef(null);
53
53
  var context = useEngineContext();
54
- var _context$appHelper$ut = (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils,
55
- interaction = _context$appHelper$ut.interaction;
54
+ var _ref = ((_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils) || {},
55
+ interaction = _ref.interaction,
56
+ token = _ref.token;
56
57
 
57
58
  // 获取店铺名称,用于信用卡授权说明文案
58
59
  var dvaStore = (_context$appHelper2 = context.appHelper) === null || _context$appHelper2 === void 0 || (_context$appHelper2 = _context$appHelper2.utils) === null || _context$appHelper2 === void 0 || (_context$appHelper2$g = _context$appHelper2.getStore) === null || _context$appHelper2$g === void 0 || (_context$appHelper2$g = _context$appHelper2$g.call(_context$appHelper2)) === null || _context$appHelper2$g === void 0 ? void 0 : _context$appHelper2$g.getState();
@@ -61,13 +62,13 @@ var PaymentMethods = function PaymentMethods(props, ref) {
61
62
  var shopPhone = (shop === null || shop === void 0 ? void 0 : shop.phone) || '';
62
63
  var shopEmail = (shop === null || shop === void 0 ? void 0 : shop.contact_email) || '';
63
64
  var init = /*#__PURE__*/function () {
64
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref) {
65
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref2) {
65
66
  var _payGroup$walletPass;
66
67
  var type, payGroup, waitAmount, cards;
67
68
  return _regeneratorRuntime().wrap(function _callee$(_context) {
68
69
  while (1) switch (_context.prev = _context.next) {
69
70
  case 0:
70
- type = _ref.type, payGroup = _ref.payGroup;
71
+ type = _ref2.type, payGroup = _ref2.payGroup;
71
72
  waitAmount = (payGroup === null || payGroup === void 0 ? void 0 : payGroup.wait_amount) || 0;
72
73
  cards = payGroup === null || payGroup === void 0 || (_payGroup$walletPass = payGroup.walletPass) === null || _payGroup$walletPass === void 0 || (_payGroup$walletPass = _payGroup$walletPass.cards) === null || _payGroup$walletPass === void 0 ? void 0 : _payGroup$walletPass.length;
73
74
  sendWarningLog({
@@ -89,13 +90,16 @@ var PaymentMethods = function PaymentMethods(props, ref) {
89
90
 
90
91
  // 仅选择钱包 并且当前选择的支付方式是 线下支付|自定义支付|银行转账, 前置支付钱包
91
92
  if (!(cards && (waitAmount <= 0 || isOfflinePayment(type)))) {
92
- _context.next = 15;
93
+ _context.next = 17;
93
94
  break;
94
95
  }
95
96
  _context.prev = 5;
96
97
  _context.next = 8;
97
98
  return walletPassPay(formatWalletPassParams(payGroup));
98
99
  case 8:
100
+ _context.next = 10;
101
+ return clearStashPayGroup(payGroup.order_id);
102
+ case 10:
99
103
  // 支付成功后 清空卡片
100
104
  syncPayGroupToStorage(_objectSpread(_objectSpread({}, payGroup), {}, {
101
105
  walletPass: _objectSpread(_objectSpread({}, payGroup.walletPass), {}, {
@@ -103,10 +107,10 @@ var PaymentMethods = function PaymentMethods(props, ref) {
103
107
  paid: true
104
108
  })
105
109
  }));
106
- _context.next = 15;
110
+ _context.next = 17;
107
111
  break;
108
- case 11:
109
- _context.prev = 11;
112
+ case 13:
113
+ _context.prev = 13;
110
114
  _context.t0 = _context["catch"](5);
111
115
  sendWarningLog({
112
116
  title: '钱包支付失败 catch',
@@ -131,47 +135,54 @@ var PaymentMethods = function PaymentMethods(props, ref) {
131
135
  fn: 'init'
132
136
  }
133
137
  }));
134
- case 15:
138
+ case 17:
135
139
  if (!(waitAmount <= 0)) {
136
- _context.next = 18;
140
+ _context.next = 29;
137
141
  break;
138
142
  }
139
- try {
140
- // 清空交易组
141
- removePayGroupFromStorage(payGroup.order_id);
142
- props.payCallback({
143
- key: 'success'
144
- });
145
- } catch (err) {
146
- sendWarningLog({
147
- title: '跳转成功页面 catch',
148
- content: [{
149
- key: '错误信息',
150
- value: (err === null || err === void 0 ? void 0 : err.message) || '未知错误'
151
- }, {
152
- key: '错误堆栈',
153
- value: (err === null || err === void 0 ? void 0 : err.stack) || '无堆栈信息'
154
- }, {
155
- key: '错误类型',
156
- value: (err === null || err === void 0 ? void 0 : err.name) || '未知错误类型'
157
- }]
158
- });
159
- }
143
+ _context.prev = 18;
144
+ // 清空交易组
145
+ removePayGroupFromStorage(payGroup.order_id);
146
+ _context.next = 22;
147
+ return clearStashPayGroup(payGroup.order_id);
148
+ case 22:
149
+ props.payCallback({
150
+ key: 'success'
151
+ });
152
+ _context.next = 28;
153
+ break;
154
+ case 25:
155
+ _context.prev = 25;
156
+ _context.t1 = _context["catch"](18);
157
+ sendWarningLog({
158
+ title: '跳转成功页面 catch',
159
+ content: [{
160
+ key: '错误信息',
161
+ value: (_context.t1 === null || _context.t1 === void 0 ? void 0 : _context.t1.message) || '未知错误'
162
+ }, {
163
+ key: '错误堆栈',
164
+ value: (_context.t1 === null || _context.t1 === void 0 ? void 0 : _context.t1.stack) || '无堆栈信息'
165
+ }, {
166
+ key: '错误类型',
167
+ value: (_context.t1 === null || _context.t1 === void 0 ? void 0 : _context.t1.name) || '未知错误类型'
168
+ }]
169
+ });
170
+ case 28:
160
171
  return _context.abrupt("return");
161
- case 18:
162
- _context.next = 20;
172
+ case 29:
173
+ _context.next = 31;
163
174
  return onPayByType({
164
175
  type: type,
165
176
  payGroup: payGroup
166
177
  });
167
- case 20:
178
+ case 31:
168
179
  case "end":
169
180
  return _context.stop();
170
181
  }
171
- }, _callee, null, [[5, 11]]);
182
+ }, _callee, null, [[5, 13], [18, 25]]);
172
183
  }));
173
184
  return function init(_x) {
174
- return _ref2.apply(this, arguments);
185
+ return _ref3.apply(this, arguments);
175
186
  };
176
187
  }();
177
188
  useEffect(function () {
@@ -185,182 +196,197 @@ var PaymentMethods = function PaymentMethods(props, ref) {
185
196
  var type = result.type,
186
197
  pay_number = result.pay_number,
187
198
  order_id = result.order_id;
188
- if (type && order_id && pay_number) {
189
- setPayNumber(order_id, pay_number);
190
- }
191
- props.payCallback({
192
- key: 'success'
193
- });
199
+ void _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
200
+ var _token$get;
201
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
202
+ while (1) switch (_context2.prev = _context2.next) {
203
+ case 0:
204
+ if (!(type && order_id && pay_number)) {
205
+ _context2.next = 3;
206
+ break;
207
+ }
208
+ _context2.next = 3;
209
+ return setPayNumber(order_id, pay_number, token === null || token === void 0 || (_token$get = token.get) === null || _token$get === void 0 ? void 0 : _token$get.call(token));
210
+ case 3:
211
+ props.payCallback({
212
+ key: 'success'
213
+ });
214
+ case 4:
215
+ case "end":
216
+ return _context2.stop();
217
+ }
218
+ }, _callee2);
219
+ }))();
194
220
  });
195
221
  }
196
222
  }, []);
197
223
  var onPayByType = /*#__PURE__*/function () {
198
- var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(_ref3) {
224
+ var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(_ref5) {
199
225
  var type, payGroup, _ApplePayRef$current, _GooglePayRef$current, _MWCreditCardRef$curr, _SuperPayAliPayH5Ref$, _SuperPayWxPayH5Ref$c, _StripePayRef$current, _OfflinePaymentRef$cu, _BankDepositRef$curre, _CashManualRef$curren, _GlobePayAliPayH5Ref$, _GlobePayPaypalH5Ref$, _GlobePayWxH5Ref$curr, _GlobePayQrcodeRef$cu, _CustomPaymentRef$cur;
200
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
201
- while (1) switch (_context2.prev = _context2.next) {
226
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
227
+ while (1) switch (_context3.prev = _context3.next) {
202
228
  case 0:
203
- type = _ref3.type, payGroup = _ref3.payGroup;
229
+ type = _ref5.type, payGroup = _ref5.payGroup;
204
230
  console.log(type, payGroup);
205
231
 
206
232
  // 苹果支付
207
233
  if (!(type === 'mw.apple')) {
208
- _context2.next = 6;
234
+ _context3.next = 6;
209
235
  break;
210
236
  }
211
- _context2.next = 5;
237
+ _context3.next = 5;
212
238
  return (_ApplePayRef$current = ApplePayRef.current) === null || _ApplePayRef$current === void 0 ? void 0 : _ApplePayRef$current.init({
213
239
  payGroup: payGroup
214
240
  });
215
241
  case 5:
216
- return _context2.abrupt("return");
242
+ return _context3.abrupt("return");
217
243
  case 6:
218
244
  if (!(type === 'mw.google')) {
219
- _context2.next = 10;
245
+ _context3.next = 10;
220
246
  break;
221
247
  }
222
- _context2.next = 9;
248
+ _context3.next = 9;
223
249
  return (_GooglePayRef$current = GooglePayRef.current) === null || _GooglePayRef$current === void 0 ? void 0 : _GooglePayRef$current.init({
224
250
  payGroup: payGroup
225
251
  });
226
252
  case 9:
227
- return _context2.abrupt("return");
253
+ return _context3.abrupt("return");
228
254
  case 10:
229
255
  if (!(type === 'mw.credit_card')) {
230
- _context2.next = 13;
256
+ _context3.next = 13;
231
257
  break;
232
258
  }
233
259
  (_MWCreditCardRef$curr = MWCreditCardRef.current) === null || _MWCreditCardRef$curr === void 0 || _MWCreditCardRef$curr.init({
234
260
  payGroup: payGroup
235
261
  });
236
- return _context2.abrupt("return");
262
+ return _context3.abrupt("return");
237
263
  case 13:
238
264
  if (!(type === 'superpay.alipay.h5')) {
239
- _context2.next = 17;
265
+ _context3.next = 17;
240
266
  break;
241
267
  }
242
- _context2.next = 16;
268
+ _context3.next = 16;
243
269
  return (_SuperPayAliPayH5Ref$ = SuperPayAliPayH5Ref.current) === null || _SuperPayAliPayH5Ref$ === void 0 ? void 0 : _SuperPayAliPayH5Ref$.init({
244
270
  payGroup: payGroup
245
271
  });
246
272
  case 16:
247
- return _context2.abrupt("return");
273
+ return _context3.abrupt("return");
248
274
  case 17:
249
275
  if (!(type === 'superpay.wechat.h5')) {
250
- _context2.next = 21;
276
+ _context3.next = 21;
251
277
  break;
252
278
  }
253
- _context2.next = 20;
279
+ _context3.next = 20;
254
280
  return (_SuperPayWxPayH5Ref$c = SuperPayWxPayH5Ref.current) === null || _SuperPayWxPayH5Ref$c === void 0 ? void 0 : _SuperPayWxPayH5Ref$c.init({
255
281
  payGroup: payGroup
256
282
  });
257
283
  case 20:
258
- return _context2.abrupt("return");
284
+ return _context3.abrupt("return");
259
285
  case 21:
260
286
  if (!(type === 'stripe')) {
261
- _context2.next = 24;
287
+ _context3.next = 24;
262
288
  break;
263
289
  }
264
290
  (_StripePayRef$current = StripePayRef.current) === null || _StripePayRef$current === void 0 || _StripePayRef$current.init({
265
291
  payGroup: payGroup
266
292
  });
267
- return _context2.abrupt("return");
293
+ return _context3.abrupt("return");
268
294
  case 24:
269
295
  if (!(type === 'pisell.offline_payment')) {
270
- _context2.next = 28;
296
+ _context3.next = 28;
271
297
  break;
272
298
  }
273
- _context2.next = 27;
299
+ _context3.next = 27;
274
300
  return (_OfflinePaymentRef$cu = OfflinePaymentRef.current) === null || _OfflinePaymentRef$cu === void 0 ? void 0 : _OfflinePaymentRef$cu.init({
275
301
  payGroup: payGroup
276
302
  });
277
303
  case 27:
278
- return _context2.abrupt("return");
304
+ return _context3.abrupt("return");
279
305
  case 28:
280
306
  if (!(type === 'pisell.bank_deposit')) {
281
- _context2.next = 32;
307
+ _context3.next = 32;
282
308
  break;
283
309
  }
284
- _context2.next = 31;
310
+ _context3.next = 31;
285
311
  return (_BankDepositRef$curre = BankDepositRef.current) === null || _BankDepositRef$curre === void 0 ? void 0 : _BankDepositRef$curre.init({
286
312
  payGroup: payGroup
287
313
  });
288
314
  case 31:
289
- return _context2.abrupt("return");
315
+ return _context3.abrupt("return");
290
316
  case 32:
291
317
  if (!(type === 'pisell.other.cashmanual')) {
292
- _context2.next = 36;
318
+ _context3.next = 36;
293
319
  break;
294
320
  }
295
- _context2.next = 35;
321
+ _context3.next = 35;
296
322
  return (_CashManualRef$curren = CashManualRef.current) === null || _CashManualRef$curren === void 0 ? void 0 : _CashManualRef$curren.init({
297
323
  payGroup: payGroup
298
324
  });
299
325
  case 35:
300
- return _context2.abrupt("return");
326
+ return _context3.abrupt("return");
301
327
  case 36:
302
328
  if (!(type === 'globepay.alipay.h5')) {
303
- _context2.next = 40;
329
+ _context3.next = 40;
304
330
  break;
305
331
  }
306
- _context2.next = 39;
332
+ _context3.next = 39;
307
333
  return (_GlobePayAliPayH5Ref$ = GlobePayAliPayH5Ref.current) === null || _GlobePayAliPayH5Ref$ === void 0 ? void 0 : _GlobePayAliPayH5Ref$.init({
308
334
  payGroup: payGroup
309
335
  });
310
336
  case 39:
311
- return _context2.abrupt("return");
337
+ return _context3.abrupt("return");
312
338
  case 40:
313
339
  if (!(type === 'globepay.paypal.h5')) {
314
- _context2.next = 44;
340
+ _context3.next = 44;
315
341
  break;
316
342
  }
317
- _context2.next = 43;
343
+ _context3.next = 43;
318
344
  return (_GlobePayPaypalH5Ref$ = GlobePayPaypalH5Ref.current) === null || _GlobePayPaypalH5Ref$ === void 0 ? void 0 : _GlobePayPaypalH5Ref$.init({
319
345
  payGroup: payGroup
320
346
  });
321
347
  case 43:
322
- return _context2.abrupt("return");
348
+ return _context3.abrupt("return");
323
349
  case 44:
324
350
  if (!(type === 'globepay.wechat.jsapi')) {
325
- _context2.next = 48;
351
+ _context3.next = 48;
326
352
  break;
327
353
  }
328
- _context2.next = 47;
354
+ _context3.next = 47;
329
355
  return (_GlobePayWxH5Ref$curr = GlobePayWxH5Ref.current) === null || _GlobePayWxH5Ref$curr === void 0 ? void 0 : _GlobePayWxH5Ref$curr.init({
330
356
  payGroup: payGroup
331
357
  });
332
358
  case 47:
333
- return _context2.abrupt("return");
359
+ return _context3.abrupt("return");
334
360
  case 48:
335
361
  if (!(type === 'globepay.alipay.qrcode' || type === 'globepay.wechat.qrcode')) {
336
- _context2.next = 52;
362
+ _context3.next = 52;
337
363
  break;
338
364
  }
339
- _context2.next = 51;
365
+ _context3.next = 51;
340
366
  return (_GlobePayQrcodeRef$cu = GlobePayQrcodeRef.current) === null || _GlobePayQrcodeRef$cu === void 0 ? void 0 : _GlobePayQrcodeRef$cu.init({
341
367
  payGroup: payGroup
342
368
  });
343
369
  case 51:
344
- return _context2.abrupt("return");
370
+ return _context3.abrupt("return");
345
371
  case 52:
346
372
  if (!isCustomPayment(type)) {
347
- _context2.next = 56;
373
+ _context3.next = 56;
348
374
  break;
349
375
  }
350
- _context2.next = 55;
376
+ _context3.next = 55;
351
377
  return (_CustomPaymentRef$cur = CustomPaymentRef.current) === null || _CustomPaymentRef$cur === void 0 ? void 0 : _CustomPaymentRef$cur.init({
352
378
  payGroup: payGroup
353
379
  });
354
380
  case 55:
355
- return _context2.abrupt("return");
381
+ return _context3.abrupt("return");
356
382
  case 56:
357
383
  case "end":
358
- return _context2.stop();
384
+ return _context3.stop();
359
385
  }
360
- }, _callee2);
386
+ }, _callee3);
361
387
  }));
362
388
  return function onPayByType(_x2) {
363
- return _ref4.apply(this, arguments);
389
+ return _ref6.apply(this, arguments);
364
390
  };
365
391
  }();
366
392
  useImperativeHandle(ref, function () {
@@ -313,7 +313,10 @@ var ToCPay = function ToCPay(props, ref) {
313
313
  });
314
314
  withCustomerIdList = (wallet_pass_recommend_list || []).map(function (item) {
315
315
  return _objectSpread(_objectSpread({}, item), {}, {
316
- customer_id: customer_id || item.customer_id
316
+ customer_id: customer_id || item.customer_id,
317
+ metadata: _objectSpread(_objectSpread({}, item.metadata || {}), {}, {
318
+ unique_payment_number: getUniqueId()
319
+ })
317
320
  });
318
321
  }); // 设置交易组
319
322
  dispatch({
@@ -53,6 +53,7 @@ declare const _default: {
53
53
  'tocPay.text.continuePay': string;
54
54
  'tocPay.text.leave': string;
55
55
  'tocPay.text.getParamsFail': string;
56
+ 'tocPay.text.payGroupStashFail': string;
56
57
  'tocPay.text.checkingCard': string;
57
58
  'tocPay.text.processingPayment': string;
58
59
  'tocPay.text.securityCheckRequired': string;
@@ -178,6 +179,7 @@ declare const _default: {
178
179
  'tocPay.text.continuePay': string;
179
180
  'tocPay.text.leave': string;
180
181
  'tocPay.text.getParamsFail': string;
182
+ 'tocPay.text.payGroupStashFail': string;
181
183
  'tocPay.text.checkingCard': string;
182
184
  'tocPay.text.processingPayment': string;
183
185
  'tocPay.text.securityCheckRequired': string;
@@ -302,6 +304,7 @@ declare const _default: {
302
304
  'tocPay.text.continuePay': string;
303
305
  'tocPay.text.leave': string;
304
306
  'tocPay.text.getParamsFail': string;
307
+ 'tocPay.text.payGroupStashFail': string;
305
308
  'tocPay.text.checkingCard': string;
306
309
  'tocPay.text.processingPayment': string;
307
310
  'tocPay.text.securityCheckRequired': string;
@@ -426,6 +429,7 @@ declare const _default: {
426
429
  'tocPay.text.continuePay': string;
427
430
  'tocPay.text.leave': string;
428
431
  'tocPay.text.getParamsFail': string;
432
+ 'tocPay.text.payGroupStashFail': string;
429
433
  'tocPay.text.checkingCard': string;
430
434
  'tocPay.text.processingPayment': string;
431
435
  'tocPay.text.securityCheckRequired': string;
@@ -551,6 +555,7 @@ declare const _default: {
551
555
  'tocPay.text.continuePay': string;
552
556
  'tocPay.text.leave': string;
553
557
  'tocPay.text.getParamsFail': string;
558
+ 'tocPay.text.payGroupStashFail': string;
554
559
  'tocPay.text.checkingCard': string;
555
560
  'tocPay.text.processingPayment': string;
556
561
  'tocPay.text.securityCheckRequired': string;
@@ -53,6 +53,7 @@ export default {
53
53
  'tocPay.text.continuePay': 'Continue to pay',
54
54
  'tocPay.text.leave': 'Leave',
55
55
  'tocPay.text.getParamsFail': 'Failed to obtain payment parameters',
56
+ 'tocPay.text.payGroupStashFail': 'Failed to sync payment information. Please try again.',
56
57
  'tocPay.text.checkingCard': 'Checking your card...',
57
58
  'tocPay.text.processingPayment': 'Processing your payment…',
58
59
  'tocPay.text.securityCheckRequired': 'A security check may be required.',
@@ -200,6 +201,7 @@ export default {
200
201
  'tocPay.text.continuePay': '继续支付',
201
202
  'tocPay.text.leave': '离开',
202
203
  'tocPay.text.getParamsFail': '获取支付参数失败',
204
+ 'tocPay.text.payGroupStashFail': '支付信息同步失败,请重试',
203
205
  'tocPay.text.checkingCard': '正在检查您的卡片…',
204
206
  'tocPay.text.processingPayment': '正在处理中…',
205
207
  'tocPay.text.securityCheckRequired': '可能需要完成银行安全验证。',
@@ -346,6 +348,7 @@ export default {
346
348
  'tocPay.text.continuePay': '繼續支付',
347
349
  'tocPay.text.leave': '離開',
348
350
  'tocPay.text.getParamsFail': '取得支付參數失敗',
351
+ 'tocPay.text.payGroupStashFail': '支付資料同步失敗,請重試',
349
352
  'tocPay.text.checkingCard': '正在檢查您的卡片…',
350
353
  'tocPay.text.processingPayment': '正在處理中…',
351
354
  'tocPay.text.securityCheckRequired': '可能需要完成銀行安全驗證。',
@@ -492,6 +495,7 @@ export default {
492
495
  'tocPay.text.continuePay': '支払いを続行',
493
496
  'tocPay.text.leave': '離れる',
494
497
  'tocPay.text.getParamsFail': '支払いパラメータの取得に失敗しました',
498
+ 'tocPay.text.payGroupStashFail': '支払い情報の同期に失敗しました。もう一度お試しください。',
495
499
  'tocPay.text.checkingCard': 'カードを確認しています…',
496
500
  'tocPay.text.processingPayment': 'お支払いを処理中…',
497
501
  'tocPay.text.securityCheckRequired': 'セキュリティチェックが必要になる場合があります。',
@@ -639,6 +643,7 @@ export default {
639
643
  'tocPay.text.continuePay': 'Continuar a pagar',
640
644
  'tocPay.text.leave': 'Sair',
641
645
  'tocPay.text.getParamsFail': 'Falha ao obter parâmetros de pagamento',
646
+ 'tocPay.text.payGroupStashFail': 'Falha ao sincronizar as informações de pagamento. Tente novamente.',
642
647
  'tocPay.text.checkingCard': 'Verificando seu cartão...',
643
648
  'tocPay.text.processingPayment': 'Processando seu pagamento…',
644
649
  'tocPay.text.securityCheckRequired': 'Uma verificação de segurança pode ser necessária.',
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export interface FormState {
3
2
  platform: 'pc' | 'h5' | '' | undefined;
4
3
  order: any;
@@ -30,11 +29,4 @@ export interface PayGroup {
30
29
  _order: any;
31
30
  front_order_uuid?: string;
32
31
  }
33
- export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
34
- state: FormState;
35
- } & {
36
- dispatch: (params: {
37
- type: string;
38
- payload: any;
39
- }) => void;
40
- }>;
32
+ export declare const Provider: any, Context: any;
@@ -1,4 +1,8 @@
1
1
  import { PayGroup } from './model';
2
+ /**
3
+ * 生成 `/h5/core/stash` 的 token:前缀 + 订单号
4
+ */
5
+ export declare const buildPayGroupStashToken: (orderId: string) => string;
2
6
  /**
3
7
  * @title: 同步交易组到storage
4
8
  * @description:
@@ -38,11 +42,18 @@ export declare const removePayGroupFromStorage: (orderId: string) => void;
38
42
  export declare const getPayGroupParamsFromStorage: (orderId: string, rest?: any) => any;
39
43
  /**
40
44
  * @title: 通过订单id设置交易号
41
- * @description:
45
+ * @description: 合并 pay_number 后调用 `/h5/core/stash` 最多 3 次;无论 stash 成败均写入 localStorage
42
46
  * @param {string} orderId
43
47
  * @param {string} payNumber
44
- * @return {*}
48
+ * @param {string} [token] 引擎 utils.token.get(),写入 stash 的 data.token
45
49
  * @Author: zhiwei.Wang
46
50
  * @Date: 2024-08-16 10:41
47
51
  */
48
- export declare const setPayNumber: (orderId: string, payNumber: string) => void;
52
+ export declare const setPayNumber: (orderId: string, payNumber: string, token?: string) => Promise<void>;
53
+ /**
54
+ * @title: 清除服务端暂存
55
+ * @description:
56
+ * @param {string} orderId
57
+ * @return {*}
58
+ */
59
+ export declare const clearStashPayGroup: (orderId: string) => Promise<void>;