@pisell/private-materials 6.12.373 → 6.12.374
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.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/render/default/view.js +1 -1
- package/build/lowcode/view.js +1 -1
- package/es/components/bigSale/templates/Kiosk/index.js +4 -4
- package/es/components/bigSale/templates/Kiosk/zeroAmountCheckout.js +14 -6
- package/lib/components/bigSale/templates/Kiosk/index.js +3 -3
- package/lib/components/bigSale/templates/Kiosk/zeroAmountCheckout.js +15 -7
- package/package.json +3 -3
|
@@ -33,7 +33,7 @@ import { resolveKioskPresentation } from "../../../kioskSale/resolveKioskPresent
|
|
|
33
33
|
import { resolveKioskCartItemsConfig } from "./cartPresentation.js";
|
|
34
34
|
import KioskPaymentPage from "./payment/index.js";
|
|
35
35
|
import { normalizeKioskNavigableView, resolveKioskLayoutState, resolveKioskProductListPreferencesChannel, resolveKioskPromotionRevealTarget } from "./layout.js";
|
|
36
|
-
import {
|
|
36
|
+
import { isKioskPlatformZeroAmountCheckout, isOnlineOrderingZeroAmountValue, resolveKioskNoPaymentResultViewModel, resolveKioskNoPaymentSubmitParams, resolveKioskSubmittedPayableAmount, shouldSubmitKioskOrderBeforeCheckout, toFiniteKioskAmount, validateKioskNoPaymentSubmitResult } from "./zeroAmountCheckout.js";
|
|
37
37
|
import { openKioskCheckoutCustomerAuth, resolveKioskCheckoutCustomerAuthRequest } from "./checkoutCustomerAuth.js";
|
|
38
38
|
import KioskPickupTiming from "./KioskPickupTiming.js";
|
|
39
39
|
import useKioskFulfillmentCheckout from "./useKioskFulfillmentCheckout.js";
|
|
@@ -1026,8 +1026,8 @@ function KioskBigSaleTemplate({ isActive = true, catalogPreparation, osKey, prod
|
|
|
1026
1026
|
showCheckoutFailure(String(locales.getText("pisell2.big-sale.kiosk.payment-failure-description")));
|
|
1027
1027
|
return;
|
|
1028
1028
|
}
|
|
1029
|
-
const
|
|
1030
|
-
if (shouldUseConsumerPayment ||
|
|
1029
|
+
const shouldRedirectOnlineOrderingZeroAmount = isOnlineOrderingZeroAmountValue(platform, totalAmount);
|
|
1030
|
+
if (shouldUseConsumerPayment || shouldRedirectOnlineOrderingZeroAmount) {
|
|
1031
1031
|
publishKioskCollaborationPreviewStatus(app, "checkout");
|
|
1032
1032
|
yield launchKioskConsumerPaymentAfterReset({
|
|
1033
1033
|
action: utils.action,
|
|
@@ -1050,7 +1050,7 @@ function KioskBigSaleTemplate({ isActive = true, catalogPreparation, osKey, prod
|
|
|
1050
1050
|
persistKioskSessionView(context.sales.bookingTicket, "catalog");
|
|
1051
1051
|
},
|
|
1052
1052
|
recalcSummary: context.cart.recalcSummary,
|
|
1053
|
-
redirectZeroAmount:
|
|
1053
|
+
redirectZeroAmount: shouldRedirectOnlineOrderingZeroAmount,
|
|
1054
1054
|
replace: (path) => {
|
|
1055
1055
|
var _utils$history3, _app$history6;
|
|
1056
1056
|
if (typeof (utils === null || utils === void 0 || (_utils$history3 = utils.history) === null || _utils$history3 === void 0 ? void 0 : _utils$history3.replace) === "function") {
|
|
@@ -9,6 +9,8 @@ function toFiniteKioskAmount(value) {
|
|
|
9
9
|
function resolveKioskAmountDue(summary) {
|
|
10
10
|
var _toFiniteKioskAmount;
|
|
11
11
|
if (!summary) return null;
|
|
12
|
+
const serverWaitPayAmount = toFiniteKioskAmount(summary.order_wait_pay_amount);
|
|
13
|
+
if (serverWaitPayAmount !== null) return serverWaitPayAmount;
|
|
12
14
|
const orderPaidAmount = toFiniteKioskAmount(summary.order_paid_amount);
|
|
13
15
|
if (orderPaidAmount !== null && orderPaidAmount > 0) return toFiniteKioskAmount(summary.amount_gap);
|
|
14
16
|
return (_toFiniteKioskAmount = toFiniteKioskAmount(summary.expect_amount)) !== null && _toFiniteKioskAmount !== void 0 ? _toFiniteKioskAmount : toFiniteKioskAmount(summary.total_amount);
|
|
@@ -16,17 +18,23 @@ function resolveKioskAmountDue(summary) {
|
|
|
16
18
|
function isKioskZeroAmountCheckout(summary) {
|
|
17
19
|
return resolveKioskAmountDue(summary) === 0;
|
|
18
20
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
/**
|
|
22
|
+
* Online ordering runs in both H5 and desktop (pc) containers. A zero due
|
|
23
|
+
* amount must submit directly in either container instead of opening the
|
|
24
|
+
* payment-method UI.
|
|
25
|
+
*/
|
|
26
|
+
function isOnlineOrderingZeroAmountCheckout(platform, summary) {
|
|
27
|
+
return isOnlineOrderingZeroAmountValue(platform, resolveKioskAmountDue(summary));
|
|
21
28
|
}
|
|
22
|
-
function
|
|
23
|
-
|
|
29
|
+
function isOnlineOrderingZeroAmountValue(platform, amount) {
|
|
30
|
+
const normalizedPlatform = String(platform || "").trim().toLowerCase();
|
|
31
|
+
return (normalizedPlatform === "h5" || normalizedPlatform === "pc") && toFiniteKioskAmount(amount) === 0;
|
|
24
32
|
}
|
|
25
33
|
function isKioskPlatformZeroAmountCheckout(platform, summary) {
|
|
26
34
|
return isSelfServicePlatform(platform) && isKioskZeroAmountCheckout(summary);
|
|
27
35
|
}
|
|
28
36
|
function shouldSubmitKioskOrderBeforeCheckout(options) {
|
|
29
|
-
return options.shouldUseConsumerPayment ||
|
|
37
|
+
return options.shouldUseConsumerPayment || isOnlineOrderingZeroAmountCheckout(options.platform, options.summary) || isKioskPlatformZeroAmountCheckout(options.platform, options.summary);
|
|
30
38
|
}
|
|
31
39
|
function resolveKioskSubmittedPayableAmount(result, tempOrderSummary, contextSummary) {
|
|
32
40
|
var _result$data, _result$data2, _result$data3;
|
|
@@ -83,4 +91,4 @@ function resolveKioskNoPaymentResultViewModel(options) {
|
|
|
83
91
|
});
|
|
84
92
|
}
|
|
85
93
|
//#endregion
|
|
86
|
-
export {
|
|
94
|
+
export { isKioskPlatformZeroAmountCheckout, isOnlineOrderingZeroAmountCheckout, isOnlineOrderingZeroAmountValue, resolveKioskAmountDue, resolveKioskNoPaymentResultViewModel, resolveKioskNoPaymentSubmitParams, resolveKioskSubmittedPayableAmount, shouldSubmitKioskOrderBeforeCheckout, toFiniteKioskAmount, validateKioskNoPaymentSubmitResult };
|
|
@@ -1027,8 +1027,8 @@ function KioskBigSaleTemplate({ isActive = true, catalogPreparation, osKey, prod
|
|
|
1027
1027
|
showCheckoutFailure(String(_pisell_utils.locales.getText("pisell2.big-sale.kiosk.payment-failure-description")));
|
|
1028
1028
|
return;
|
|
1029
1029
|
}
|
|
1030
|
-
const
|
|
1031
|
-
if (shouldUseConsumerPayment ||
|
|
1030
|
+
const shouldRedirectOnlineOrderingZeroAmount = require_zeroAmountCheckout.isOnlineOrderingZeroAmountValue(platform, totalAmount);
|
|
1031
|
+
if (shouldUseConsumerPayment || shouldRedirectOnlineOrderingZeroAmount) {
|
|
1032
1032
|
publishKioskCollaborationPreviewStatus(app, "checkout");
|
|
1033
1033
|
yield launchKioskConsumerPaymentAfterReset({
|
|
1034
1034
|
action: utils.action,
|
|
@@ -1051,7 +1051,7 @@ function KioskBigSaleTemplate({ isActive = true, catalogPreparation, osKey, prod
|
|
|
1051
1051
|
persistKioskSessionView(context.sales.bookingTicket, "catalog");
|
|
1052
1052
|
},
|
|
1053
1053
|
recalcSummary: context.cart.recalcSummary,
|
|
1054
|
-
redirectZeroAmount:
|
|
1054
|
+
redirectZeroAmount: shouldRedirectOnlineOrderingZeroAmount,
|
|
1055
1055
|
replace: (path) => {
|
|
1056
1056
|
var _utils$history3, _app$history6;
|
|
1057
1057
|
if (typeof (utils === null || utils === void 0 || (_utils$history3 = utils.history) === null || _utils$history3 === void 0 ? void 0 : _utils$history3.replace) === "function") {
|
|
@@ -9,6 +9,8 @@ function toFiniteKioskAmount(value) {
|
|
|
9
9
|
function resolveKioskAmountDue(summary) {
|
|
10
10
|
var _toFiniteKioskAmount;
|
|
11
11
|
if (!summary) return null;
|
|
12
|
+
const serverWaitPayAmount = toFiniteKioskAmount(summary.order_wait_pay_amount);
|
|
13
|
+
if (serverWaitPayAmount !== null) return serverWaitPayAmount;
|
|
12
14
|
const orderPaidAmount = toFiniteKioskAmount(summary.order_paid_amount);
|
|
13
15
|
if (orderPaidAmount !== null && orderPaidAmount > 0) return toFiniteKioskAmount(summary.amount_gap);
|
|
14
16
|
return (_toFiniteKioskAmount = toFiniteKioskAmount(summary.expect_amount)) !== null && _toFiniteKioskAmount !== void 0 ? _toFiniteKioskAmount : toFiniteKioskAmount(summary.total_amount);
|
|
@@ -16,17 +18,23 @@ function resolveKioskAmountDue(summary) {
|
|
|
16
18
|
function isKioskZeroAmountCheckout(summary) {
|
|
17
19
|
return resolveKioskAmountDue(summary) === 0;
|
|
18
20
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
/**
|
|
22
|
+
* Online ordering runs in both H5 and desktop (pc) containers. A zero due
|
|
23
|
+
* amount must submit directly in either container instead of opening the
|
|
24
|
+
* payment-method UI.
|
|
25
|
+
*/
|
|
26
|
+
function isOnlineOrderingZeroAmountCheckout(platform, summary) {
|
|
27
|
+
return isOnlineOrderingZeroAmountValue(platform, resolveKioskAmountDue(summary));
|
|
21
28
|
}
|
|
22
|
-
function
|
|
23
|
-
|
|
29
|
+
function isOnlineOrderingZeroAmountValue(platform, amount) {
|
|
30
|
+
const normalizedPlatform = String(platform || "").trim().toLowerCase();
|
|
31
|
+
return (normalizedPlatform === "h5" || normalizedPlatform === "pc") && toFiniteKioskAmount(amount) === 0;
|
|
24
32
|
}
|
|
25
33
|
function isKioskPlatformZeroAmountCheckout(platform, summary) {
|
|
26
34
|
return require_platform.isSelfServicePlatform(platform) && isKioskZeroAmountCheckout(summary);
|
|
27
35
|
}
|
|
28
36
|
function shouldSubmitKioskOrderBeforeCheckout(options) {
|
|
29
|
-
return options.shouldUseConsumerPayment ||
|
|
37
|
+
return options.shouldUseConsumerPayment || isOnlineOrderingZeroAmountCheckout(options.platform, options.summary) || isKioskPlatformZeroAmountCheckout(options.platform, options.summary);
|
|
30
38
|
}
|
|
31
39
|
function resolveKioskSubmittedPayableAmount(result, tempOrderSummary, contextSummary) {
|
|
32
40
|
var _result$data, _result$data2, _result$data3;
|
|
@@ -83,9 +91,9 @@ function resolveKioskNoPaymentResultViewModel(options) {
|
|
|
83
91
|
});
|
|
84
92
|
}
|
|
85
93
|
//#endregion
|
|
86
|
-
exports.isH5ZeroAmountCheckout = isH5ZeroAmountCheckout;
|
|
87
|
-
exports.isH5ZeroAmountValue = isH5ZeroAmountValue;
|
|
88
94
|
exports.isKioskPlatformZeroAmountCheckout = isKioskPlatformZeroAmountCheckout;
|
|
95
|
+
exports.isOnlineOrderingZeroAmountCheckout = isOnlineOrderingZeroAmountCheckout;
|
|
96
|
+
exports.isOnlineOrderingZeroAmountValue = isOnlineOrderingZeroAmountValue;
|
|
89
97
|
exports.resolveKioskAmountDue = resolveKioskAmountDue;
|
|
90
98
|
exports.resolveKioskNoPaymentResultViewModel = resolveKioskNoPaymentResultViewModel;
|
|
91
99
|
exports.resolveKioskNoPaymentSubmitParams = resolveKioskNoPaymentSubmitParams;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/private-materials",
|
|
3
|
-
"version": "6.12.
|
|
3
|
+
"version": "6.12.374",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"module": "./es/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -76,8 +76,8 @@
|
|
|
76
76
|
"@pisell/pi-payment-sdk": "0.0.4",
|
|
77
77
|
"@pisell/utils": "3.0.7",
|
|
78
78
|
"@pisell/materials": "6.12.88",
|
|
79
|
-
"@pisell/
|
|
80
|
-
"@pisell/
|
|
79
|
+
"@pisell/icon": "0.0.11",
|
|
80
|
+
"@pisell/date-picker": "3.0.12"
|
|
81
81
|
},
|
|
82
82
|
"peerDependencies": {
|
|
83
83
|
"react": "^18.0.0",
|