@pisell/private-materials 3.4.53 → 3.4.55

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.
@@ -476,16 +476,7 @@ export var createChallengeIframe = function createChallengeIframe(challengeData,
476
476
  // 返回iframe
477
477
  return new Promise(function (res, rej) {
478
478
  var timer = null;
479
-
480
- // 120秒没成功 认为失败
481
- timer = setTimeout(function () {
482
- log({
483
- msg: '第五步: 60秒超时则走N逻辑',
484
- data: challengeData
485
- });
486
- rej('time out');
487
- }, 2 * 60 * 1000);
488
- window.addEventListener('message', function (event) {
479
+ var handleMessage = function handleMessage(event) {
489
480
  // loadingSpinnerAnimation("on");
490
481
  if (event.origin.indexOf(postmessageUrl) !== -1 || event.origin.indexOf('securesuite') !== -1) {
491
482
  if (typeof event.data.cres == 'string') {
@@ -496,7 +487,18 @@ export var createChallengeIframe = function createChallengeIframe(challengeData,
496
487
  closeIframe();
497
488
  }
498
489
  }
499
- }, false);
490
+ };
491
+
492
+ // 120秒没成功 认为失败
493
+ timer = setTimeout(function () {
494
+ log({
495
+ msg: '第五步: 60秒超时则走N逻辑',
496
+ data: challengeData
497
+ });
498
+ window.removeEventListener('message', handleMessage);
499
+ rej('time out');
500
+ }, 2 * 60 * 1000);
501
+ window.addEventListener('message', handleMessage, false);
500
502
  });
501
503
  };
502
504
 
@@ -130,6 +130,8 @@ var PaymentReturnContent = function PaymentReturnContent(_ref) {
130
130
  src: "".concat(prefix, "/payment-content.png"),
131
131
  alt: "success"
132
132
  })), /*#__PURE__*/React.createElement("div", {
133
+ className: "payment-return-content-text"
134
+ }, locales.getText('tocPay.text.weAreVerifyingYourPaymentPleaseCheckYourOrderStatusLater')), /*#__PURE__*/React.createElement("div", {
133
135
  className: "payment-return-content-buttons"
134
136
  }, /*#__PURE__*/React.createElement(Button, {
135
137
  block: true,
@@ -1,16 +1,26 @@
1
1
  .payment-return-content {
2
2
  padding: 100px 46px 0;
3
+ max-height: 100vh;
4
+ display: flex;
5
+ flex-direction: column;
6
+ gap: 24px;
3
7
 
4
8
  .payment-return-content-img {
5
9
  width: 100%;
6
- margin-bottom: 60px;
7
10
  min-height: 270px;
11
+ display: flex;
12
+ justify-content: center;
13
+ align-items: center;
8
14
  img {
9
- width: 100%;
15
+ max-width: 100%;
10
16
  height: 100%;
17
+ max-height: 480px;
11
18
  }
12
19
  }
13
-
20
+ .payment-return-content-text {
21
+ color: var(--Gray-600, #475467);
22
+ text-align: center;
23
+ }
14
24
  .payment-return-content-buttons {
15
25
  display: flex;
16
26
  flex-direction: column;
@@ -511,7 +511,8 @@ var ToCPay = function ToCPay(props, ref) {
511
511
  fn: 'paymentInit'
512
512
  }
513
513
  });
514
- case 18:
514
+ throw _context5.t0;
515
+ case 19:
515
516
  case "end":
516
517
  return _context5.stop();
517
518
  }
@@ -97,6 +97,7 @@ declare const _default: {
97
97
  'tocPay.text.returnAndSelectOtherPaymentMethod': string;
98
98
  'tocPay.text.paymentCompletedAndViewOrder': string;
99
99
  'tocPay.text.paymentFailed': string;
100
+ 'tocPay.text.weAreVerifyingYourPaymentPleaseCheckYourOrderStatusLater': string;
100
101
  };
101
102
  'zh-CN': {
102
103
  'tocPay.text.checkout': string;
@@ -195,6 +196,7 @@ declare const _default: {
195
196
  'tocPay.text.returnAndSelectOtherPaymentMethod': string;
196
197
  'tocPay.text.paymentCompletedAndViewOrder': string;
197
198
  'tocPay.text.paymentFailed': string;
199
+ 'tocPay.text.weAreVerifyingYourPaymentPleaseCheckYourOrderStatusLater': string;
198
200
  };
199
201
  'zh-HK': {
200
202
  'tocPay.text.checkout': string;
@@ -293,6 +295,7 @@ declare const _default: {
293
295
  'tocPay.text.returnAndSelectOtherPaymentMethod': string;
294
296
  'tocPay.text.paymentCompletedAndViewOrder': string;
295
297
  'tocPay.text.paymentFailed': string;
298
+ 'tocPay.text.weAreVerifyingYourPaymentPleaseCheckYourOrderStatusLater': string;
296
299
  };
297
300
  };
298
301
  export default _default;
@@ -116,7 +116,8 @@ export default {
116
116
  'tocPay.text.viewDetail': 'View detail',
117
117
  'tocPay.text.returnAndSelectOtherPaymentMethod': 'Go Back / Choose Another Payment',
118
118
  'tocPay.text.paymentCompletedAndViewOrder': 'Payment Completed / View Order',
119
- 'tocPay.text.paymentFailed': 'Not paid yet, please check if the payment is successful'
119
+ 'tocPay.text.paymentFailed': 'Not paid yet, please check if the payment is successful',
120
+ 'tocPay.text.weAreVerifyingYourPaymentPleaseCheckYourOrderStatusLater': 'We are verifying your payment. Please check your order status later.'
120
121
  },
121
122
  'zh-CN': {
122
123
  'tocPay.text.checkout': '结账',
@@ -234,7 +235,8 @@ export default {
234
235
  'tocPay.text.viewDetail': '查看详情',
235
236
  'tocPay.text.returnAndSelectOtherPaymentMethod': '返回 / 选择其他支付方式',
236
237
  'tocPay.text.paymentCompletedAndViewOrder': '支付完成 / 查看订单',
237
- 'tocPay.text.paymentFailed': "未支付完成,请检查是否支付成功"
238
+ 'tocPay.text.paymentFailed': "未支付完成,请检查是否支付成功",
239
+ 'tocPay.text.weAreVerifyingYourPaymentPleaseCheckYourOrderStatusLater': '我们正在确认您的支付状态,请稍后查看订单状态。'
238
240
  },
239
241
  'zh-HK': {
240
242
  'tocPay.text.checkout': '結帳',
@@ -352,6 +354,7 @@ export default {
352
354
  'tocPay.text.viewDetail': '查看詳情',
353
355
  'tocPay.text.returnAndSelectOtherPaymentMethod': '返回 / 選擇其他支付方式',
354
356
  'tocPay.text.paymentCompletedAndViewOrder': '支付完成 / 查看訂單',
355
- 'tocPay.text.paymentFailed': "未支付完成,请检查是否支付成功"
357
+ 'tocPay.text.paymentFailed': "未支付完成,请检查是否支付成功",
358
+ 'tocPay.text.weAreVerifyingYourPaymentPleaseCheckYourOrderStatusLater': '我們正在確認您的支付狀態,請稍後查看訂單狀態。'
356
359
  }
357
360
  };
@@ -218,6 +218,8 @@ export var getDetailApi = /*#__PURE__*/function () {
218
218
  order_behavior_count: 1,
219
219
  // 订单行为次数
220
220
  order_behavior_count_customer: 1 // 客户订单行为次数
221
+ }, {
222
+ isOriginHost: true
221
223
  });
222
224
  case 2:
223
225
  _yield$request$getReq6 = _context6.sent;
@@ -311,26 +311,28 @@ var createChallengeIframe = (challengeData, callback) => {
311
311
  };
312
312
  return new Promise((res, rej) => {
313
313
  let timer = null;
314
+ const handleMessage = (event) => {
315
+ if (event.origin.indexOf(postmessageUrl) !== -1 || event.origin.indexOf("securesuite") !== -1) {
316
+ if (typeof event.data.cres == "string") {
317
+ if (timer) {
318
+ clearTimeout(timer);
319
+ }
320
+ res(event.data.cres);
321
+ closeIframe();
322
+ }
323
+ }
324
+ };
314
325
  timer = setTimeout(() => {
315
326
  log({
316
327
  msg: "第五步: 60秒超时则走N逻辑",
317
328
  data: challengeData
318
329
  });
330
+ window.removeEventListener("message", handleMessage);
319
331
  rej("time out");
320
332
  }, 2 * 60 * 1e3);
321
333
  window.addEventListener(
322
334
  "message",
323
- (event) => {
324
- if (event.origin.indexOf(postmessageUrl) !== -1 || event.origin.indexOf("securesuite") !== -1) {
325
- if (typeof event.data.cres == "string") {
326
- if (timer) {
327
- clearTimeout(timer);
328
- }
329
- res(event.data.cres);
330
- closeIframe();
331
- }
332
- }
333
- },
335
+ handleMessage,
334
336
  false
335
337
  );
336
338
  });
@@ -83,6 +83,6 @@ var PaymentReturnContent = ({
83
83
  });
84
84
  }
85
85
  };
86
- return /* @__PURE__ */ import_react.default.createElement("div", { className: "payment-return-content" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "payment-return-content-img" }, /* @__PURE__ */ import_react.default.createElement("img", { src: `${prefix}/payment-content.png`, alt: "success" })), /* @__PURE__ */ import_react.default.createElement("div", { className: "payment-return-content-buttons" }, /* @__PURE__ */ import_react.default.createElement(import_materials.Button, { block: true, className: "payment-return-content-order-button", onClick: handleViewOrder }, import_utils.locales.getText("tocPay.text.paymentCompletedAndViewOrder")), /* @__PURE__ */ import_react.default.createElement(import_materials.Button, { block: true, onClick: handleGoBack }, import_utils.locales.getText("tocPay.text.returnAndSelectOtherPaymentMethod"))));
86
+ return /* @__PURE__ */ import_react.default.createElement("div", { className: "payment-return-content" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "payment-return-content-img" }, /* @__PURE__ */ import_react.default.createElement("img", { src: `${prefix}/payment-content.png`, alt: "success" })), /* @__PURE__ */ import_react.default.createElement("div", { className: "payment-return-content-text" }, import_utils.locales.getText("tocPay.text.weAreVerifyingYourPaymentPleaseCheckYourOrderStatusLater")), /* @__PURE__ */ import_react.default.createElement("div", { className: "payment-return-content-buttons" }, /* @__PURE__ */ import_react.default.createElement(import_materials.Button, { block: true, className: "payment-return-content-order-button", onClick: handleViewOrder }, import_utils.locales.getText("tocPay.text.paymentCompletedAndViewOrder")), /* @__PURE__ */ import_react.default.createElement(import_materials.Button, { block: true, onClick: handleGoBack }, import_utils.locales.getText("tocPay.text.returnAndSelectOtherPaymentMethod"))));
87
87
  };
88
88
  var PaymentReturnContent_default = PaymentReturnContent;
@@ -1,16 +1,26 @@
1
1
  .payment-return-content {
2
2
  padding: 100px 46px 0;
3
+ max-height: 100vh;
4
+ display: flex;
5
+ flex-direction: column;
6
+ gap: 24px;
3
7
 
4
8
  .payment-return-content-img {
5
9
  width: 100%;
6
- margin-bottom: 60px;
7
10
  min-height: 270px;
11
+ display: flex;
12
+ justify-content: center;
13
+ align-items: center;
8
14
  img {
9
- width: 100%;
15
+ max-width: 100%;
10
16
  height: 100%;
17
+ max-height: 480px;
11
18
  }
12
19
  }
13
-
20
+ .payment-return-content-text {
21
+ color: var(--Gray-600, #475467);
22
+ text-align: center;
23
+ }
14
24
  .payment-return-content-buttons {
15
25
  display: flex;
16
26
  flex-direction: column;
@@ -325,6 +325,7 @@ var ToCPay = (props, ref) => {
325
325
  fn: "paymentInit"
326
326
  }
327
327
  });
328
+ throw err;
328
329
  }
329
330
  };
330
331
  const waitAmount = (0, import_react.useMemo)(() => {
@@ -97,6 +97,7 @@ declare const _default: {
97
97
  'tocPay.text.returnAndSelectOtherPaymentMethod': string;
98
98
  'tocPay.text.paymentCompletedAndViewOrder': string;
99
99
  'tocPay.text.paymentFailed': string;
100
+ 'tocPay.text.weAreVerifyingYourPaymentPleaseCheckYourOrderStatusLater': string;
100
101
  };
101
102
  'zh-CN': {
102
103
  'tocPay.text.checkout': string;
@@ -195,6 +196,7 @@ declare const _default: {
195
196
  'tocPay.text.returnAndSelectOtherPaymentMethod': string;
196
197
  'tocPay.text.paymentCompletedAndViewOrder': string;
197
198
  'tocPay.text.paymentFailed': string;
199
+ 'tocPay.text.weAreVerifyingYourPaymentPleaseCheckYourOrderStatusLater': string;
198
200
  };
199
201
  'zh-HK': {
200
202
  'tocPay.text.checkout': string;
@@ -293,6 +295,7 @@ declare const _default: {
293
295
  'tocPay.text.returnAndSelectOtherPaymentMethod': string;
294
296
  'tocPay.text.paymentCompletedAndViewOrder': string;
295
297
  'tocPay.text.paymentFailed': string;
298
+ 'tocPay.text.weAreVerifyingYourPaymentPleaseCheckYourOrderStatusLater': string;
296
299
  };
297
300
  };
298
301
  export default _default;
@@ -120,7 +120,8 @@ var locales_default = {
120
120
  "tocPay.text.viewDetail": "View detail",
121
121
  "tocPay.text.returnAndSelectOtherPaymentMethod": "Go Back / Choose Another Payment",
122
122
  "tocPay.text.paymentCompletedAndViewOrder": "Payment Completed / View Order",
123
- "tocPay.text.paymentFailed": "Not paid yet, please check if the payment is successful"
123
+ "tocPay.text.paymentFailed": "Not paid yet, please check if the payment is successful",
124
+ "tocPay.text.weAreVerifyingYourPaymentPleaseCheckYourOrderStatusLater": "We are verifying your payment. Please check your order status later."
124
125
  },
125
126
  "zh-CN": {
126
127
  "tocPay.text.checkout": "结账",
@@ -218,7 +219,8 @@ var locales_default = {
218
219
  "tocPay.text.viewDetail": "查看详情",
219
220
  "tocPay.text.returnAndSelectOtherPaymentMethod": "返回 / 选择其他支付方式",
220
221
  "tocPay.text.paymentCompletedAndViewOrder": "支付完成 / 查看订单",
221
- "tocPay.text.paymentFailed": "未支付完成,请检查是否支付成功"
222
+ "tocPay.text.paymentFailed": "未支付完成,请检查是否支付成功",
223
+ "tocPay.text.weAreVerifyingYourPaymentPleaseCheckYourOrderStatusLater": "我们正在确认您的支付状态,请稍后查看订单状态。"
222
224
  },
223
225
  "zh-HK": {
224
226
  "tocPay.text.checkout": "結帳",
@@ -316,6 +318,7 @@ var locales_default = {
316
318
  "tocPay.text.viewDetail": "查看詳情",
317
319
  "tocPay.text.returnAndSelectOtherPaymentMethod": "返回 / 選擇其他支付方式",
318
320
  "tocPay.text.paymentCompletedAndViewOrder": "支付完成 / 查看訂單",
319
- "tocPay.text.paymentFailed": "未支付完成,请检查是否支付成功"
321
+ "tocPay.text.paymentFailed": "未支付完成,请检查是否支付成功",
322
+ "tocPay.text.weAreVerifyingYourPaymentPleaseCheckYourOrderStatusLater": "我們正在確認您的支付狀態,請稍後查看訂單狀態。"
320
323
  }
321
324
  };
@@ -74,6 +74,8 @@ var getDetailApi = async (params) => {
74
74
  // 订单行为次数
75
75
  order_behavior_count_customer: 1
76
76
  // 客户订单行为次数
77
+ }, {
78
+ isOriginHost: true
77
79
  });
78
80
  return data;
79
81
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/private-materials",
3
- "version": "3.4.53",
3
+ "version": "3.4.55",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -61,8 +61,8 @@
61
61
  "decimal.js": "^10.4.3",
62
62
  "@react-spring/web": "^9.6.1",
63
63
  "@use-gesture/react": "^10.3.1",
64
- "@pisell/materials": "3.3.69",
65
64
  "@pisell/date-picker": "3.0.3",
65
+ "@pisell/materials": "3.3.70",
66
66
  "@pisell/icon": "0.0.11",
67
67
  "@pisell/utils": "3.0.1"
68
68
  },