@pisell/private-materials 3.0.149 → 3.0.150

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.
@@ -277,6 +277,8 @@ export default (function (props) {
277
277
  onChangeParams: props.onChangeParams,
278
278
  action: action,
279
279
  source: props.source,
280
+ tyroUrl: props.tyroUrl,
281
+ tyroVersion: props.tyroVersion,
280
282
  device_number: props === null || props === void 0 ? void 0 : (_props$params2 = props.params) === null || _props$params2 === void 0 ? void 0 : _props$params2.device_number
281
283
  }));
282
284
  });
@@ -235,12 +235,12 @@ export default (function (_ref) {
235
235
  merchantReceipt = _ref3.merchantReceipt;
236
236
  console.log('商家小票 客户端是否打印小票 = ', signatureRequired);
237
237
  console.log('商家小票 小票内容 = \n', merchantReceipt);
238
- if (signatureRequired) {
239
- var receipt = [merchantReceipt].filter(function (item) {
240
- return typeof item === 'string';
241
- }).filter(Boolean);
242
- onChange('print', receipt);
243
- }
238
+ // if (signatureRequired) {
239
+ var receipt = [merchantReceipt].filter(function (item) {
240
+ return typeof item === 'string';
241
+ }).filter(Boolean);
242
+ onChange('print', receipt);
243
+ // }
244
244
  merchantReceiptRef.current = {
245
245
  signatureRequired: signatureRequired,
246
246
  merchantReceipt: merchantReceipt
@@ -344,7 +344,7 @@ export default (function (_ref) {
344
344
  card_reader_id: (_deviceRef$current5 = deviceRef.current) === null || _deviceRef$current5 === void 0 ? void 0 : _deviceRef$current5.id,
345
345
  card_reader_type: eftpos,
346
346
  amount: requestParams.current.amount,
347
- action: modeRef.current,
347
+ action: modeRef.current === ModeEnum.FullPay ? ModeEnum.Pay : modeRef.current,
348
348
  status: response.result === 'APPROVED' ? 'succeed' : 'failed',
349
349
  request: requestParams.current,
350
350
  response: _objectSpread(_objectSpread({}, response), {}, {
@@ -413,7 +413,8 @@ export default (function (_ref) {
413
413
  failCustom: {
414
414
  isPosNetworkError: false,
415
415
  status: 'fail',
416
- fail: locales.getText('page.eftpos-pay.text.transaction.fail'),
416
+ fail: response.result,
417
+ //locales.getText('page.eftpos-pay.text.transaction.fail'),
417
418
  warn: null,
418
419
  title: locales.getText('page.eftpos-pay.text.failed')(modeRef.current)
419
420
  }
@@ -427,7 +428,9 @@ export default (function (_ref) {
427
428
  if (load && TyroRef.current) {
428
429
  var _IClient = TyroRef.current.IClient;
429
430
  if (_IClient) {
431
+ console.log('apiKey = ', apiKey, 'posProductData = ', posProductData);
430
432
  var iclient = new _IClient(apiKey, posProductData);
433
+ console.log(iclient.posProductData);
431
434
  iClientRef.current = iclient;
432
435
  if (isCancelRef.current) {
433
436
  return;
@@ -241,6 +241,8 @@ var eftposPay_default = (props) => {
241
241
  onChangeParams: props.onChangeParams,
242
242
  action,
243
243
  source: props.source,
244
+ tyroUrl: props.tyroUrl,
245
+ tyroVersion: props.tyroVersion,
244
246
  device_number: (_f = props == null ? void 0 : props.params) == null ? void 0 : _f.device_number
245
247
  }
246
248
  ));
@@ -197,10 +197,8 @@ var tyro_default = ({
197
197
  const receiptCallbackImpl = ({ signatureRequired, merchantReceipt }) => {
198
198
  console.log("商家小票 客户端是否打印小票 = ", signatureRequired);
199
199
  console.log("商家小票 小票内容 = \n", merchantReceipt);
200
- if (signatureRequired) {
201
- const receipt = [merchantReceipt].filter((item) => typeof item === "string").filter(Boolean);
202
- onChange("print", receipt);
203
- }
200
+ const receipt = [merchantReceipt].filter((item) => typeof item === "string").filter(Boolean);
201
+ onChange("print", receipt);
204
202
  merchantReceiptRef.current = { signatureRequired, merchantReceipt };
205
203
  };
206
204
  const statusMessageCallbackImpl = (message) => {
@@ -308,7 +306,7 @@ var tyro_default = ({
308
306
  card_reader_id: (_a = deviceRef.current) == null ? void 0 : _a.id,
309
307
  card_reader_type: eftpos,
310
308
  amount: requestParams.current.amount,
311
- action: modeRef.current,
309
+ action: modeRef.current === import_const.ModeEnum.FullPay ? import_const.ModeEnum.Pay : modeRef.current,
312
310
  status: response.result === "APPROVED" ? "succeed" : "failed",
313
311
  request: requestParams.current,
314
312
  response: { ...response, merchantReceipt: merchantReceiptRef.current },
@@ -382,7 +380,8 @@ var tyro_default = ({
382
380
  failCustom: {
383
381
  isPosNetworkError: false,
384
382
  status: "fail",
385
- fail: import_utils.locales.getText("page.eftpos-pay.text.transaction.fail"),
383
+ fail: response.result,
384
+ //locales.getText('page.eftpos-pay.text.transaction.fail'),
386
385
  warn: null,
387
386
  title: import_utils.locales.getText("page.eftpos-pay.text.failed")(
388
387
  modeRef.current
@@ -398,7 +397,9 @@ var tyro_default = ({
398
397
  if (load && TyroRef.current) {
399
398
  const IClient = TyroRef.current.IClient;
400
399
  if (IClient) {
400
+ console.log("apiKey = ", apiKey, "posProductData = ", posProductData);
401
401
  const iclient = new IClient(apiKey, posProductData);
402
+ console.log(iclient.posProductData);
402
403
  iClientRef.current = iclient;
403
404
  if (isCancelRef.current) {
404
405
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/private-materials",
3
- "version": "3.0.149",
3
+ "version": "3.0.150",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -59,10 +59,10 @@
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/materials": "3.0.48",
63
62
  "@pisell/utils": "1.0.42",
64
63
  "@pisell/icon": "0.0.11",
65
- "@pisell/date-picker": "1.0.100"
64
+ "@pisell/date-picker": "1.0.100",
65
+ "@pisell/materials": "3.0.48"
66
66
  },
67
67
  "peerDependencies": {
68
68
  "react": "^18.0.0",