@pisell/private-materials 6.12.322 → 6.12.323

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.
@@ -1350,7 +1350,7 @@ const PaymentContent = forwardRef(({ cartData, orderInfo, isModalOpen, onPayment
1350
1350
  name: method.name,
1351
1351
  custom_payment_type: method.type,
1352
1352
  voucher_id: "",
1353
- service_charge: (method === null || method === void 0 ? void 0 : method.fixed) !== void 0 || (method === null || method === void 0 ? void 0 : method.percentage) !== void 0 ? {
1353
+ service_charge: (method === null || method === void 0 ? void 0 : method.is_surcharge) && ((method === null || method === void 0 ? void 0 : method.fixed) !== void 0 || (method === null || method === void 0 ? void 0 : method.percentage) !== void 0) ? {
1354
1354
  amount: (method === null || method === void 0 ? void 0 : method.fixed) || "0",
1355
1355
  percentage: (method === null || method === void 0 ? void 0 : method.percentage) || "0"
1356
1356
  } : {},
@@ -50,6 +50,7 @@ function normalizePercentageRate(value) {
50
50
  return Number.isFinite(percentage) ? percentage / 100 : 0;
51
51
  }
52
52
  function resolveConfiguredServiceCharge(method) {
53
+ if (!method.is_surcharge) return null;
53
54
  if (!method.fixed && !method.percentage) return null;
54
55
  return {
55
56
  amount: method.fixed || 0,
@@ -75,7 +75,7 @@ function _preparePendingEftposPayment() {
75
75
  name: method.name,
76
76
  custom_payment_type: method.type,
77
77
  voucher_id: "",
78
- service_charge: method.fixed !== void 0 || method.percentage !== void 0 ? {
78
+ service_charge: method.is_surcharge && (method.fixed !== void 0 || method.percentage !== void 0) ? {
79
79
  amount: method.fixed || "0",
80
80
  percentage: method.percentage || "0"
81
81
  } : {},
@@ -1353,7 +1353,7 @@ const PaymentContent = (0, react.forwardRef)(({ cartData, orderInfo, isModalOpen
1353
1353
  name: method.name,
1354
1354
  custom_payment_type: method.type,
1355
1355
  voucher_id: "",
1356
- service_charge: (method === null || method === void 0 ? void 0 : method.fixed) !== void 0 || (method === null || method === void 0 ? void 0 : method.percentage) !== void 0 ? {
1356
+ service_charge: (method === null || method === void 0 ? void 0 : method.is_surcharge) && ((method === null || method === void 0 ? void 0 : method.fixed) !== void 0 || (method === null || method === void 0 ? void 0 : method.percentage) !== void 0) ? {
1357
1357
  amount: (method === null || method === void 0 ? void 0 : method.fixed) || "0",
1358
1358
  percentage: (method === null || method === void 0 ? void 0 : method.percentage) || "0"
1359
1359
  } : {},
@@ -52,6 +52,7 @@ function normalizePercentageRate(value) {
52
52
  return Number.isFinite(percentage) ? percentage / 100 : 0;
53
53
  }
54
54
  function resolveConfiguredServiceCharge(method) {
55
+ if (!method.is_surcharge) return null;
55
56
  if (!method.fixed && !method.percentage) return null;
56
57
  return {
57
58
  amount: method.fixed || 0,
@@ -77,7 +77,7 @@ function _preparePendingEftposPayment() {
77
77
  name: method.name,
78
78
  custom_payment_type: method.type,
79
79
  voucher_id: "",
80
- service_charge: method.fixed !== void 0 || method.percentage !== void 0 ? {
80
+ service_charge: method.is_surcharge && (method.fixed !== void 0 || method.percentage !== void 0) ? {
81
81
  amount: method.fixed || "0",
82
82
  percentage: method.percentage || "0"
83
83
  } : {},
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/private-materials",
3
- "version": "6.12.322",
3
+ "version": "6.12.323",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -72,8 +72,8 @@
72
72
  "styled-components": "^6.0.0-rc.3",
73
73
  "use-sync-external-store": "^1.6.0",
74
74
  "@pisell/pi-payment-sdk": "0.0.3",
75
- "@pisell/materials": "6.12.79",
76
75
  "@pisell/utils": "3.0.7",
76
+ "@pisell/materials": "6.12.79",
77
77
  "@pisell/icon": "0.0.11",
78
78
  "@pisell/date-picker": "3.0.12"
79
79
  },