@roomstay/frontend 2.6.44 → 2.6.45
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/dist/109.bundle.js +1 -0
- package/dist/279.bundle.js +1 -1
- package/dist/288.bundle.js +1 -1
- package/dist/370.bundle.js +1 -1
- package/dist/449.bundle.js +1 -1
- package/dist/586.bundle.js +1 -1
- package/dist/839.bundle.js +1 -1
- package/dist/873.bundle.js +1 -1
- package/dist/903.bundle.js +1 -1
- package/dist/972.bundle.js +1 -1
- package/dist/978.bundle.js +1 -1
- package/dist/984.bundle.js +1 -0
- package/dist/main.bundle.js +1 -1
- package/dist/src/components/generic/BookingWizard/BookingWizard.d.ts +5 -0
- package/dist/src/components/generic/BookingWizard/BookingWizard.js +9 -4
- package/dist/src/components/generic/BookingWizard/BookingWizard.js.map +1 -1
- package/dist/src/components/steps/confirmation/AdyenPaymentOption/AdyenPaymentOption.d.ts +4 -0
- package/dist/src/components/steps/confirmation/AdyenPaymentOption/AdyenPaymentOption.js +128 -0
- package/dist/src/components/steps/confirmation/AdyenPaymentOption/AdyenPaymentOption.js.map +1 -0
- package/dist/src/components/steps/confirmation/PaymentDetails/StepConfirmationPaymentDetails.js +6 -2
- package/dist/src/components/steps/confirmation/PaymentDetails/StepConfirmationPaymentDetails.js.map +1 -1
- package/dist/src/components/steps/confirmation/PaymentInformation.d.ts +1 -7
- package/dist/src/components/steps/confirmation/PaymentInformation.js +18 -66
- package/dist/src/components/steps/confirmation/PaymentInformation.js.map +1 -1
- package/dist/src/components/steps/confirmation/PlanpayPaymentMethod.js +1 -1
- package/dist/src/components/steps/confirmation/PlanpayPaymentMethod.js.map +1 -1
- package/dist/src/components/steps/confirmation/RoomContactDetails.js +1 -1
- package/dist/src/components/steps/confirmation/RoomContactDetails.js.map +1 -1
- package/dist/src/components/steps/confirmation/StepConfirmationAcknowledgement.d.ts +1 -6
- package/dist/src/components/steps/confirmation/StepConfirmationAcknowledgement.js +7 -7
- package/dist/src/components/steps/confirmation/StepConfirmationAcknowledgement.js.map +1 -1
- package/dist/src/components/steps/confirmation/StepConfirmationCommentsComponent.d.ts +1 -3
- package/dist/src/components/steps/confirmation/StepConfirmationCommentsComponent.js +4 -2
- package/dist/src/components/steps/confirmation/StepConfirmationCommentsComponent.js.map +1 -1
- package/dist/src/components/steps/confirmation/StepConfirmationForm.js +46 -214
- package/dist/src/components/steps/confirmation/StepConfirmationForm.js.map +1 -1
- package/dist/src/contexts/ConfirmationStepContext/ConfirmationStepContextTypes.d.ts +12 -2
- package/dist/src/contexts/ConfirmationStepContext/ConfirmationStepContextTypes.js.map +1 -1
- package/dist/src/contexts/ConfirmationStepContext/ConfirmationStepContextWrapper.js +231 -39
- package/dist/src/contexts/ConfirmationStepContext/ConfirmationStepContextWrapper.js.map +1 -1
- package/dist/src/contexts/Members/RoomstayMemberContext/RoomstayMemberContextProvider.js +2 -1
- package/dist/src/contexts/Members/RoomstayMemberContext/RoomstayMemberContextProvider.js.map +1 -1
- package/dist/src/engines/BookingWizardEngine/BookingWizardEngine.d.ts +2 -0
- package/dist/src/engines/BookingWizardEngine/BookingWizardEngine.js.map +1 -1
- package/dist/src/engines/BookingWizardEngine/BookingWizardEngineElement.js +1 -0
- package/dist/src/engines/BookingWizardEngine/BookingWizardEngineElement.js.map +1 -1
- package/dist/src/handlers/payment/AdyenPaymentHandler.d.ts +2 -0
- package/dist/src/handlers/payment/AdyenPaymentHandler.js +66 -0
- package/dist/src/handlers/payment/AdyenPaymentHandler.js.map +1 -0
- package/dist/src/handlers/payment/PaymentHandler.d.ts +32 -0
- package/dist/src/handlers/payment/PaymentHandler.js +3 -0
- package/dist/src/handlers/payment/PaymentHandler.js.map +1 -0
- package/dist/src/handlers/payment/PlanpayPaymentHandler.d.ts +2 -0
- package/dist/src/handlers/payment/PlanpayPaymentHandler.js +82 -0
- package/dist/src/handlers/payment/PlanpayPaymentHandler.js.map +1 -0
- package/dist/src/handlers/payment/RedirectPaymentHandler.d.ts +2 -0
- package/dist/src/handlers/payment/RedirectPaymentHandler.js +49 -0
- package/dist/src/handlers/payment/RedirectPaymentHandler.js.map +1 -0
- package/dist/src/handlers/payment/VGSMemberPaymentHandler.d.ts +2 -0
- package/dist/src/handlers/payment/VGSMemberPaymentHandler.js +80 -0
- package/dist/src/handlers/payment/VGSMemberPaymentHandler.js.map +1 -0
- package/dist/src/handlers/payment/VGSPaymentHandler.d.ts +2 -0
- package/dist/src/handlers/payment/VGSPaymentHandler.js +75 -0
- package/dist/src/handlers/payment/VGSPaymentHandler.js.map +1 -0
- package/dist/src/hooks/Planpay.d.ts +1 -1
- package/dist/src/hooks/RoomRateAvailabilityListFromApi.js +2 -2
- package/dist/src/hooks/RoomRateAvailabilityListFromApi.js.map +1 -1
- package/dist/src/models/Api/ReservationsDTO.d.ts +10 -0
- package/dist/src/models/Api/ReservationsDTO.js.map +1 -1
- package/dist/src/models/Confirmation.d.ts +3 -6
- package/dist/src/models/Confirmation.js.map +1 -1
- package/dist/src/providers/storage/SessionProvider.d.ts +1 -1
- package/dist/src/providers/storage/SessionProvider.js +20 -24
- package/dist/src/providers/storage/SessionProvider.js.map +1 -1
- package/dist/src/providers/storage/StorageProvider.d.ts +1 -1
- package/dist/src/providers/storage/StorageProvider.js +14 -16
- package/dist/src/providers/storage/StorageProvider.js.map +1 -1
- package/dist/src/translations/Translation.d.ts +5 -0
- package/dist/src/translations/Translation.js +5 -0
- package/dist/src/translations/Translation.js.map +1 -1
- package/dist/src/translations/languages/en-gb.js +5 -0
- package/dist/src/translations/languages/en-gb.js.map +1 -1
- package/dist/src/util/EventsHelper.d.ts +1 -1
- package/dist/src/util/usePaymentHelper.d.ts +6 -0
- package/dist/src/util/usePaymentHelper.js +19 -0
- package/dist/src/util/usePaymentHelper.js.map +1 -0
- package/dist/test.bundle.js +1 -1
- package/dist/tests/offline/entry/OfflineEngineDefaults.js.map +1 -1
- package/dist/vendors.bundle.js +1 -1
- package/package.json +4 -3
- package/dist/927.bundle.js +0 -1
|
@@ -35,233 +35,76 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
35
35
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
36
36
|
};
|
|
37
37
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
-
const contexts_1 = require("../../../contexts/index.js");
|
|
39
|
-
const hooks_1 = require("../../../hooks/index.js");
|
|
40
|
-
const core_1 = require("@roomstay/core");
|
|
41
38
|
const ConfirmationStepContext_1 = require("contexts/ConfirmationStepContext/ConfirmationStepContext");
|
|
42
39
|
const HistoryConsistentPush_1 = require("hooks/HistoryConsistentPush");
|
|
43
|
-
const react_1 =
|
|
40
|
+
const react_1 = __importDefault(require("react"));
|
|
44
41
|
const react_hook_form_1 = require("react-hook-form");
|
|
45
42
|
const react_i18next_1 = require("react-i18next");
|
|
46
43
|
const Translation_1 = require("translations/Translation");
|
|
44
|
+
const AutoAutoHeight_1 = __importDefault(require("../../../animations/AutoAutoHeight"));
|
|
47
45
|
const Alert_1 = __importStar(require("../../generic/Alert"));
|
|
48
46
|
const SSLSecureBadge_1 = __importDefault(require("../../generic/badging/SSLSecureBadge"));
|
|
49
47
|
const BEButton_1 = __importDefault(require("../../generic/BEButton"));
|
|
50
|
-
const NextStepButton_1 = __importDefault(require("../../generic/buttons/NextStepButton"));
|
|
51
48
|
const Headline_1 = __importDefault(require("../../generic/Headline"));
|
|
52
49
|
const Icon_1 = __importStar(require("../../generic/Icon/Icon"));
|
|
53
50
|
const LineBreak_1 = __importDefault(require("../../generic/LineBreak"));
|
|
54
51
|
const LargeLoader_1 = __importDefault(require("../../generic/loader/LargeLoader"));
|
|
52
|
+
const ScrollToTop_1 = __importDefault(require("../../generic/ScrollToTop"));
|
|
55
53
|
const Text_1 = __importStar(require("../../generic/Text"));
|
|
56
54
|
const TextBox_1 = __importDefault(require("../../generic/TextBox"));
|
|
57
55
|
const PaymentInformation_1 = __importDefault(require("./PaymentInformation"));
|
|
58
56
|
const RoomContactDetails_1 = __importDefault(require("./RoomContactDetails"));
|
|
59
57
|
const StepConfirmationAcknowledgement_1 = __importDefault(require("./StepConfirmationAcknowledgement"));
|
|
60
|
-
const StepConfirmationCheckoutDifferencesModal_1 = __importDefault(require("./StepConfirmationCheckoutDifferencesModal"));
|
|
61
58
|
const StepConfirmationCommentsComponent_1 = require("./StepConfirmationCommentsComponent");
|
|
62
59
|
const StepConfirmationPoliciesSection_1 = __importDefault(require("./StepConfirmationPoliciesSection"));
|
|
63
60
|
const StepConfirmationPolicyBlock_1 = __importDefault(require("./StepConfirmationPolicyBlock"));
|
|
64
|
-
const ConfirmationQuery_1 = require("../../../hooks/ConfirmationQuery");
|
|
65
61
|
const ConfirmationVerifyFeature_1 = __importDefault(require("../../../providers/feature/ConfirmationVerifyFeature"));
|
|
66
62
|
const ShowIATANumberOnCheckoutFeature_1 = __importDefault(require("../../../providers/feature/ShowIATANumberOnCheckoutFeature"));
|
|
67
63
|
const Color_1 = require("../../../util/Color");
|
|
68
64
|
const GetStepRoom_1 = __importDefault(require("../../../util/GetStepRoom"));
|
|
65
|
+
const usePaymentHelper_1 = require("../../../util/usePaymentHelper");
|
|
69
66
|
function StepConfirmationForm() {
|
|
70
|
-
|
|
71
|
-
differences: [],
|
|
72
|
-
warnings: [],
|
|
73
|
-
});
|
|
74
|
-
const formContext = (0, react_1.useContext)(contexts_1.ConfirmationFormContext);
|
|
75
|
-
const [source, setSource] = (0, react_1.useState)('');
|
|
76
|
-
const [confirmationPolicyError, setConfirmationPolicyError] = (0, react_1.useState)(false);
|
|
77
|
-
const confirmationPolicy = (0, react_1.useRef)(null);
|
|
78
|
-
const commentTextbox = (0, react_1.useRef)(null);
|
|
67
|
+
var _a;
|
|
79
68
|
const { t } = (0, react_i18next_1.useTranslation)();
|
|
80
|
-
const { queryPaymentMethod, queryRoomstayId, queryPlanpayCheckoutId } = (0, ConfirmationQuery_1.useConfirmationQuery)();
|
|
81
|
-
const context = (0, contexts_1.useBookingEngine)();
|
|
82
69
|
const methods = (0, react_hook_form_1.useFormContext)();
|
|
83
|
-
const {
|
|
84
|
-
const basketContext = (0, contexts_1.useBasket)();
|
|
85
|
-
const tokenizerRef = (0, react_1.useRef)(null);
|
|
70
|
+
const { isInPaymentMode, isBackFromPlanpay, bookingSource } = (0, ConfirmationStepContext_1.useConfirmationStep)();
|
|
86
71
|
const historyConsistentPush = (0, HistoryConsistentPush_1.useHistoryConsistentPush)();
|
|
87
|
-
const {
|
|
88
|
-
const { hotel } = (0, hooks_1.useCurrentHotel)();
|
|
89
|
-
const isCardPassthrough = (hotel === null || hotel === void 0 ? void 0 : hotel.cardProcessor) ? hotel.cardProcessor === core_1.EHotelCardProcessor.Passthrough : true;
|
|
90
|
-
const toPaymentPayload = (paymentMethod) => __awaiter(this, void 0, void 0, function* () {
|
|
91
|
-
var _a;
|
|
92
|
-
let payment;
|
|
93
|
-
switch (paymentMethod) {
|
|
94
|
-
case core_1.EBookingPaymentMethod.Planpay: {
|
|
95
|
-
const params = new URLSearchParams(window.location.search);
|
|
96
|
-
params.set('roomstayId', '{{rsId}}');
|
|
97
|
-
params.set('session', context.sessionProvider.getCurrentSessionID().toString());
|
|
98
|
-
params.set('paymentMethod', core_1.EBookingPaymentMethod.Planpay);
|
|
99
|
-
const redirectURL = `${window.location.origin}${window.location.pathname}${window.location.search}#/step/confirmation/?${params}`;
|
|
100
|
-
payment = {
|
|
101
|
-
Method: core_1.EBookingPaymentMethod.Planpay,
|
|
102
|
-
PlanpayCheckoutId: queryPlanpayCheckoutId || undefined,
|
|
103
|
-
RedirectUrl: redirectURL,
|
|
104
|
-
};
|
|
105
|
-
break;
|
|
106
|
-
}
|
|
107
|
-
case core_1.EBookingPaymentMethod.Card: {
|
|
108
|
-
if (isCardPassthrough) {
|
|
109
|
-
payment = {
|
|
110
|
-
Method: core_1.EBookingPaymentMethod.Card,
|
|
111
|
-
PaymentCard: yield ((_a = tokenizerRef.current) === null || _a === void 0 ? void 0 : _a.getTokenizedCode()),
|
|
112
|
-
};
|
|
113
|
-
}
|
|
114
|
-
else {
|
|
115
|
-
payment = {
|
|
116
|
-
Method: core_1.EBookingPaymentMethod.Card,
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
break;
|
|
120
|
-
}
|
|
121
|
-
case core_1.EBookingPaymentMethod.SavedCard:
|
|
122
|
-
default: {
|
|
123
|
-
payment = {
|
|
124
|
-
Method: core_1.EBookingPaymentMethod.SavedCard,
|
|
125
|
-
SavedCardID: paymentMethod,
|
|
126
|
-
};
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
return payment;
|
|
130
|
-
});
|
|
131
|
-
(0, react_1.useEffect)(() => {
|
|
132
|
-
var _a, _b;
|
|
133
|
-
let defaultPaymentValue = '';
|
|
134
|
-
if (Object.values(core_1.EBookingPaymentMethod).includes(queryPaymentMethod)) {
|
|
135
|
-
defaultPaymentValue = queryPaymentMethod;
|
|
136
|
-
}
|
|
137
|
-
else {
|
|
138
|
-
if ((roomstayMember === null || roomstayMember === void 0 ? void 0 : roomstayMember.defaultCard) && ((_a = roomstayMember === null || roomstayMember === void 0 ? void 0 : roomstayMember.cards) === null || _a === void 0 ? void 0 : _a.find((card) => card.cardId === (roomstayMember === null || roomstayMember === void 0 ? void 0 : roomstayMember.defaultCard)))) {
|
|
139
|
-
defaultPaymentValue = roomstayMember === null || roomstayMember === void 0 ? void 0 : roomstayMember.defaultCard;
|
|
140
|
-
}
|
|
141
|
-
else {
|
|
142
|
-
defaultPaymentValue = core_1.EBookingPaymentMethod.Card;
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
methods.setValue('paymentMethod', defaultPaymentValue);
|
|
146
|
-
const reservationRoomstayId = (_b = basketContext.reservationData) === null || _b === void 0 ? void 0 : _b.roomstayId;
|
|
147
|
-
const isMatchingRoomstayId = !!queryRoomstayId && (!reservationRoomstayId || queryRoomstayId === reservationRoomstayId);
|
|
148
|
-
if (isBackFromExternalPayment && isMatchingRoomstayId) {
|
|
149
|
-
commitReservation === null || commitReservation === void 0 ? void 0 : commitReservation(basketContext.reservationData, 'Please wait... Finalising your reservation');
|
|
150
|
-
}
|
|
151
|
-
else {
|
|
152
|
-
handleChangePaymentMethod(defaultPaymentValue);
|
|
153
|
-
}
|
|
154
|
-
if (isBackFromPlanpay) {
|
|
155
|
-
if (queryRoomstayId === reservationRoomstayId) {
|
|
156
|
-
onPlaypayCallback();
|
|
157
|
-
}
|
|
158
|
-
else {
|
|
159
|
-
rollbackReservation === null || rollbackReservation === void 0 ? void 0 : rollbackReservation();
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
return () => {
|
|
163
|
-
if (!isBackFromPlanpay && !isBackFromExternalPayment)
|
|
164
|
-
rollbackReservation === null || rollbackReservation === void 0 ? void 0 : rollbackReservation();
|
|
165
|
-
};
|
|
166
|
-
}, []);
|
|
167
|
-
const onPlaypayCallback = () => __awaiter(this, void 0, void 0, function* () {
|
|
168
|
-
yield (commitReservation === null || commitReservation === void 0 ? void 0 : commitReservation(basketContext.reservationData));
|
|
169
|
-
});
|
|
170
|
-
const paymentMethod = methods.watch('paymentMethod');
|
|
171
|
-
context.engine
|
|
172
|
-
.getSessionProvider()
|
|
173
|
-
.getSession()
|
|
174
|
-
.then((session) => {
|
|
175
|
-
setSource(session.source);
|
|
176
|
-
});
|
|
72
|
+
const { exclusivePayment } = (0, usePaymentHelper_1.usePaymentHelper)();
|
|
177
73
|
const returnToPickRooms = () => __awaiter(this, void 0, void 0, function* () {
|
|
178
|
-
// TODO: What if StepRoom doesn't exist?
|
|
179
74
|
historyConsistentPush((0, GetStepRoom_1.default)().getStepUrl());
|
|
180
75
|
});
|
|
181
|
-
const
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
const adhocValid = formContext === null || formContext === void 0 ? void 0 : formContext.errorChecks.every((check) => check().validate(scrollToInput));
|
|
197
|
-
return adhocValid === undefined ? true : adhocValid;
|
|
198
|
-
};
|
|
199
|
-
const handleBook = (paymentMethod) => __awaiter(this, void 0, void 0, function* () {
|
|
200
|
-
var _b;
|
|
201
|
-
yield (book === null || book === void 0 ? void 0 : book(() => __awaiter(this, void 0, void 0, function* () { return toPaymentPayload(paymentMethod); }), (_b = commentTextbox.current) === null || _b === void 0 ? void 0 : _b.value, () => __awaiter(this, void 0, void 0, function* () {
|
|
202
|
-
if (!validateConfirmationPolicy()) {
|
|
203
|
-
setConfirmationPolicyError(true);
|
|
204
|
-
return false;
|
|
205
|
-
}
|
|
206
|
-
if (!validateCustomFields(true)) {
|
|
207
|
-
return false;
|
|
208
|
-
}
|
|
209
|
-
try {
|
|
210
|
-
if (paymentMethod === core_1.EBookingPaymentMethod.Card && isCardPassthrough)
|
|
211
|
-
yield tokenizerRef.current.getTokenizedCode();
|
|
212
|
-
return true;
|
|
213
|
-
}
|
|
214
|
-
catch (e) {
|
|
215
|
-
return false;
|
|
216
|
-
}
|
|
217
|
-
}), (validationResult) => {
|
|
218
|
-
if (validationResult) {
|
|
219
|
-
setDifferenceWarning(validationResult);
|
|
220
|
-
}
|
|
221
|
-
}));
|
|
222
|
-
});
|
|
223
|
-
const handleChangePaymentMethod = (paymentMethod) => __awaiter(this, void 0, void 0, function* () {
|
|
224
|
-
if (paymentMethod !== core_1.EBookingPaymentMethod.Planpay) {
|
|
225
|
-
yield (rollbackReservation === null || rollbackReservation === void 0 ? void 0 : rollbackReservation());
|
|
226
|
-
}
|
|
227
|
-
});
|
|
228
|
-
return (react_1.default.createElement("form", null,
|
|
229
|
-
isBackFromPlanpay ? (react_1.default.createElement(LargeLoader_1.default, null)) : (react_1.default.createElement(react_1.default.Fragment, null,
|
|
76
|
+
const prePaymentInfo = (react_1.default.createElement(react_1.default.Fragment, null,
|
|
77
|
+
react_1.default.createElement("div", { className: "u-marg-bottom--heavy" },
|
|
78
|
+
react_1.default.createElement("div", { className: "u-marg-bottom--light" },
|
|
79
|
+
react_1.default.createElement(Headline_1.default, { bold: true }, t(Translation_1.Translation.Step.Confirmation.GuestDetails))),
|
|
80
|
+
react_1.default.createElement(Text_1.default, { type: Text_1.TextType.Small, color: Color_1.Color.Success },
|
|
81
|
+
react_1.default.createElement("strong", null, t(Translation_1.Translation.Step.Confirmation.AlmostDone, { required: '*' })))),
|
|
82
|
+
react_1.default.createElement(RoomContactDetails_1.default, null),
|
|
83
|
+
bookingSource === 'inline' ? (react_1.default.createElement(Alert_1.default, { type: Alert_1.AlertType.Accent2, heavyPadding: true },
|
|
84
|
+
react_1.default.createElement("div", { className: "u-flex u-w-100 flex-wrap flex-xl-nowrap" },
|
|
85
|
+
react_1.default.createElement("div", null,
|
|
86
|
+
react_1.default.createElement(Text_1.default, { color: Color_1.Color.Accent, bold: true }, t(Translation_1.Translation.Step.Confirmation.WantMoreRooms)),
|
|
87
|
+
react_1.default.createElement(Text_1.default, { color: Color_1.Color.Navy }, t(Translation_1.Translation.Step.Confirmation.YouCanAddAndEditRooms))),
|
|
88
|
+
react_1.default.createElement("div", { className: "d-flex align-items-center u-marg-top@xl-" },
|
|
89
|
+
react_1.default.createElement(BEButton_1.default, { filled: true, primary: true, icon: Icon_1.IconType.Add, iconPosition: "left", onClick: returnToPickRooms }, t(Translation_1.Translation.Step.Confirmation.AddMoreRooms)))))) : (react_1.default.createElement(react_1.default.Fragment, null)),
|
|
90
|
+
ShowIATANumberOnCheckoutFeature_1.default.isActive() && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
230
91
|
react_1.default.createElement("div", { className: "u-marg-bottom--heavy" },
|
|
92
|
+
react_1.default.createElement("div", { className: "u-marg-bottom" },
|
|
93
|
+
react_1.default.createElement(Headline_1.default, { bold: true }, t(Translation_1.Translation.Step.Confirmation.TravelAgent))),
|
|
231
94
|
react_1.default.createElement("div", { className: "u-marg-bottom--light" },
|
|
232
|
-
react_1.default.createElement(
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
react_1.default.createElement("div", { className: "d-flex align-items-center u-marg-top@xl-" },
|
|
242
|
-
react_1.default.createElement(BEButton_1.default, { filled: true, primary: true, icon: Icon_1.IconType.Add, iconPosition: "left", onClick: returnToPickRooms }, t(Translation_1.Translation.Step.Confirmation.AddMoreRooms)))))) : (react_1.default.createElement(react_1.default.Fragment, null)),
|
|
243
|
-
ShowIATANumberOnCheckoutFeature_1.default.isActive() && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
244
|
-
react_1.default.createElement("div", { className: "u-marg-bottom--heavy" },
|
|
245
|
-
react_1.default.createElement("div", { className: "u-marg-bottom" },
|
|
246
|
-
react_1.default.createElement(Headline_1.default, { bold: true }, "Travel Agent")),
|
|
247
|
-
react_1.default.createElement("div", { className: "u-marg-bottom--light" },
|
|
248
|
-
react_1.default.createElement(Text_1.default, { type: Text_1.TextType.Small },
|
|
249
|
-
react_1.default.createElement("strong", null, t(Translation_1.Translation.Step.Confirmation.Inputs.IATANumber)))),
|
|
250
|
-
react_1.default.createElement("div", { className: "u-marg-bottom--light" },
|
|
251
|
-
react_1.default.createElement(Text_1.default, { type: Text_1.TextType.Small }, t(Translation_1.Translation.Step.Confirmation.Inputs.IATANumberGuide))),
|
|
252
|
-
react_1.default.createElement(TextBox_1.default, Object.assign({ placeholder: t(Translation_1.Translation.Step.Confirmation.Inputs.IATANumber), wide: true }, methods.register('IATANumber')))),
|
|
253
|
-
react_1.default.createElement(LineBreak_1.default, null))),
|
|
254
|
-
react_1.default.createElement(StepConfirmationCommentsComponent_1.StepConfirmationCommentsComponent, { inputRef: commentTextbox }),
|
|
255
|
-
react_1.default.createElement(LineBreak_1.default, null),
|
|
95
|
+
react_1.default.createElement(Text_1.default, { type: Text_1.TextType.Small },
|
|
96
|
+
react_1.default.createElement("strong", null, t(Translation_1.Translation.Step.Confirmation.Inputs.IATANumber)))),
|
|
97
|
+
react_1.default.createElement("div", { className: "u-marg-bottom--light" },
|
|
98
|
+
react_1.default.createElement(Text_1.default, { type: Text_1.TextType.Small }, t(Translation_1.Translation.Step.Confirmation.Inputs.IATANumberGuide))),
|
|
99
|
+
react_1.default.createElement(TextBox_1.default, Object.assign({ placeholder: t(Translation_1.Translation.Step.Confirmation.Inputs.IATANumber), wide: true }, methods.register('IATANumber')))),
|
|
100
|
+
react_1.default.createElement(LineBreak_1.default, null))),
|
|
101
|
+
react_1.default.createElement(StepConfirmationCommentsComponent_1.StepConfirmationCommentsComponent, null),
|
|
102
|
+
react_1.default.createElement(LineBreak_1.default, null),
|
|
103
|
+
!exclusivePayment && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
256
104
|
react_1.default.createElement("div", { className: "u-marg-bottom--heavy" },
|
|
257
105
|
react_1.default.createElement("div", { className: "u-marg-bottom" },
|
|
258
106
|
react_1.default.createElement(Headline_1.default, { bold: true }, t(Translation_1.Translation.Navigation.Menu.PaymentInformation))),
|
|
259
|
-
react_1.default.createElement(PaymentInformation_1.default,
|
|
260
|
-
yield handleChangePaymentMethod(code);
|
|
261
|
-
if (code === core_1.EBookingPaymentMethod.Planpay) {
|
|
262
|
-
yield handleBook(code);
|
|
263
|
-
}
|
|
264
|
-
}) }),
|
|
107
|
+
react_1.default.createElement(PaymentInformation_1.default, null),
|
|
265
108
|
react_1.default.createElement("div", { className: "u-marg-top u-flex align-items-center" },
|
|
266
109
|
react_1.default.createElement("div", { className: "u-flex align-items-center justify-content-start" },
|
|
267
110
|
react_1.default.createElement(Icon_1.default, { icon: Icon_1.IconType.Lock, color: Color_1.Color.Success }),
|
|
@@ -269,30 +112,19 @@ function StepConfirmationForm() {
|
|
|
269
112
|
react_1.default.createElement(Text_1.default, { type: Text_1.TextType.Small, color: Color_1.Color.Success },
|
|
270
113
|
react_1.default.createElement("strong", null, t(Translation_1.Translation.Step.Confirmation.Secured))))),
|
|
271
114
|
react_1.default.createElement(SSLSecureBadge_1.default, null))),
|
|
115
|
+
react_1.default.createElement(LineBreak_1.default, null))),
|
|
116
|
+
react_1.default.createElement(StepConfirmationPoliciesSection_1.default, null),
|
|
117
|
+
react_1.default.createElement("div", { className: "u-pad-top--light u-marg-bottom" },
|
|
118
|
+
react_1.default.createElement(StepConfirmationPolicyBlock_1.default, null)),
|
|
119
|
+
ConfirmationVerifyFeature_1.default.isActive() && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
272
120
|
react_1.default.createElement(LineBreak_1.default, null),
|
|
273
|
-
react_1.default.createElement(
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
react_1.default.createElement("div", { className: "u-flex u-marg-top--heavy justify-content-end" },
|
|
281
|
-
react_1.default.createElement(NextStepButton_1.default, { disabled: paymentMethod === core_1.EBookingPaymentMethod.Planpay || isLoading, text: t(Translation_1.Translation.Step.Confirmation.ConfirmReservation), isLoading: isLoading, onClick: onNextStepClicked })))),
|
|
282
|
-
react_1.default.createElement(StepConfirmationCheckoutDifferencesModal_1.default, { differences: differenceWarning.differences, warnings: differenceWarning.warnings, isLoading: isLoading, onClose: () => __awaiter(this, void 0, void 0, function* () {
|
|
283
|
-
yield (rollbackReservation === null || rollbackReservation === void 0 ? void 0 : rollbackReservation());
|
|
284
|
-
historyConsistentPush((0, GetStepRoom_1.default)().getStepUrl());
|
|
285
|
-
}), onProceed: () => __awaiter(this, void 0, void 0, function* () {
|
|
286
|
-
if (paymentMethod === core_1.EBookingPaymentMethod.Planpay) {
|
|
287
|
-
setDifferenceWarning({
|
|
288
|
-
differences: [],
|
|
289
|
-
warnings: [],
|
|
290
|
-
});
|
|
291
|
-
}
|
|
292
|
-
else {
|
|
293
|
-
yield (commitReservation === null || commitReservation === void 0 ? void 0 : commitReservation(basketContext.reservationData));
|
|
294
|
-
}
|
|
295
|
-
}) })));
|
|
121
|
+
react_1.default.createElement("div", null,
|
|
122
|
+
react_1.default.createElement(StepConfirmationAcknowledgement_1.default, null))))));
|
|
123
|
+
return (react_1.default.createElement("form", null, isBackFromPlanpay ? (react_1.default.createElement(LargeLoader_1.default, null)) : (react_1.default.createElement(react_1.default.Fragment, null,
|
|
124
|
+
react_1.default.createElement(AutoAutoHeight_1.default, { open: !exclusivePayment || !isInPaymentMode }, prePaymentInfo),
|
|
125
|
+
exclusivePayment && (react_1.default.createElement(AutoAutoHeight_1.default, { open: isInPaymentMode },
|
|
126
|
+
react_1.default.createElement(ScrollToTop_1.default, null), (_a = exclusivePayment.renderPaymentInput) === null || _a === void 0 ? void 0 :
|
|
127
|
+
_a.call(exclusivePayment)))))));
|
|
296
128
|
}
|
|
297
129
|
exports.default = StepConfirmationForm;
|
|
298
130
|
//# sourceMappingURL=StepConfirmationForm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StepConfirmationForm.js","sourceRoot":"/","sources":["src/components/steps/confirmation/StepConfirmationForm.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAA4G;AAC5G,2CAAkD;AAClD,yCAA6F;AAC7F,sGAA+F;AAC/F,uEAAuE;AACvE,+CAAuE;AACvE,qDAAiD;AACjD,iDAA+C;AAC/C,0DAAuD;AAEvD,oEAA8D;AAC9D,iGAAyE;AACzE,6EAAqD;AACrD,iGAAyE;AACzE,6EAAqD;AACrD,uEAAgE;AAChE,+EAAuD;AACvD,0FAAkE;AAClE,kEAA2D;AAC3D,2EAAmD;AACnD,4GAAoF;AACpF,4GAAoF;AACpF,sIAA8G;AAC9G,wJAAgI;AAChI,yHAAsH;AACtH,sIAA8G;AAC9G,8HAAsG;AACtG,iEAAiE;AAGjE,8GAAsF;AACtF,0HAAkG;AAClG,wCAAqC;AACrC,qEAA6C;AAE7C,SAAwB,oBAAoB;IACxC,MAAM,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,GAAG,IAAA,gBAAQ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gBACzD,8BAAC,wBAAc,IACX,QAAQ,EAAE,aAAa,KAAK,4BAAqB,CAAC,OAAO,IAAI,SAAS,EACtE,IAAI,EAAE,CAAC,CAAC,yBAAW,CAAC,IAAI,CAAC,YAAY,CAAC,kBAAkB,CAAC,EACzD,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,iBAAiB,GAC5B,CACA,CACP,CACN;QAED,8BAAC,kDAAwC,IACrC,WAAW,EAAE,iBAAiB,CAAC,WAAW,EAC1C,QAAQ,EAAE,iBAAiB,CAAC,QAAQ,EACpC,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,GAAS,EAAE;gBAChB,MAAM,CAAA,mBAAmB,aAAnB,mBAAmB,uBAAnB,mBAAmB,EAAI,CAAA,CAAC;gBAC9B,qBAAqB,CAAC,IAAA,qBAAW,GAAE,CAAC,UAAU,EAAE,CAAC,CAAC;YACtD,CAAC,CAAA,EACD,SAAS,EAAE,GAAS,EAAE;gBAClB,IAAI,aAAa,KAAK,4BAAqB,CAAC,OAAO,EAAE;oBACjD,oBAAoB,CAAC;wBACjB,WAAW,EAAE,EAAE;wBACf,QAAQ,EAAE,EAAE;qBACf,CAAC,CAAC;iBACN;qBAAM;oBACH,MAAM,CAAA,iBAAiB,aAAjB,iBAAiB,uBAAjB,iBAAiB,CAAG,aAAa,CAAC,eAAe,CAAC,CAAA,CAAC;iBAC5D;YACL,CAAC,CAAA,GACH,CACC,CACV,CAAC;AACN,CAAC;AA7SD,uCA6SC","sourcesContent":["import { ConfirmationFormContext, useBasket, useBookingEngine, useMemberContext } from '@frontend/contexts';\nimport { useCurrentHotel } from '@frontend/hooks';\nimport { EBookingPaymentMethod, EHotelCardProcessor, IBookingPayment } from '@roomstay/core';\nimport { useConfirmationStep } from 'contexts/ConfirmationStepContext/ConfirmationStepContext';\nimport { useHistoryConsistentPush } from 'hooks/HistoryConsistentPush';\nimport React, { useContext, useEffect, useRef, useState } from 'react';\nimport { useFormContext } from 'react-hook-form';\nimport { useTranslation } from 'react-i18next';\nimport { Translation } from 'translations/Translation';\n\nimport Alert, { AlertType } from '@/components/generic/Alert';\nimport SSLSecureBadge from '@/components/generic/badging/SSLSecureBadge';\nimport BEButton from '@/components/generic/BEButton';\nimport NextStepButton from '@/components/generic/buttons/NextStepButton';\nimport Headline from '@/components/generic/Headline';\nimport Icon, { IconType } from '@/components/generic/Icon/Icon';\nimport LineBreak from '@/components/generic/LineBreak';\nimport LargeLoader from '@/components/generic/loader/LargeLoader';\nimport Text, { TextType } from '@/components/generic/Text';\nimport TextBox from '@/components/generic/TextBox';\nimport PaymentInformation from '@/components/steps/confirmation/PaymentInformation';\nimport RoomContactDetails from '@/components/steps/confirmation/RoomContactDetails';\nimport StepConfirmationAcknowledgement from '@/components/steps/confirmation/StepConfirmationAcknowledgement';\nimport StepConfirmationCheckoutDifferencesModal from '@/components/steps/confirmation/StepConfirmationCheckoutDifferencesModal';\nimport { StepConfirmationCommentsComponent } from '@/components/steps/confirmation/StepConfirmationCommentsComponent';\nimport StepConfirmationPoliciesSection from '@/components/steps/confirmation/StepConfirmationPoliciesSection';\nimport StepConfirmationPolicyBlock from '@/components/steps/confirmation/StepConfirmationPolicyBlock';\nimport { useConfirmationQuery } from '@/hooks/ConfirmationQuery';\nimport BasketRowDifferences from '@/models/BasketRowDifferences';\nimport { ConfirmationFormValues } from '@/models/Confirmation';\nimport ConfirmationVerifyFeature from '@/providers/feature/ConfirmationVerifyFeature';\nimport ShowIATANumberOnCheckoutFeature from '@/providers/feature/ShowIATANumberOnCheckoutFeature';\nimport { Color } from '@/util/Color';\nimport getStepRoom from '@/util/GetStepRoom';\n\nexport default function StepConfirmationForm() {\n const [differenceWarning, setDifferenceWarning] = useState<{\n differences: BasketRowDifferences[];\n warnings: string[];\n }>({\n differences: [],\n warnings: [],\n });\n\n const formContext = useContext(ConfirmationFormContext);\n const [source, setSource] = useState('');\n const [confirmationPolicyError, setConfirmationPolicyError] = useState(false);\n const confirmationPolicy = useRef<HTMLInputElement | null>(null);\n const commentTextbox = useRef<HTMLInputElement | HTMLTextAreaElement | null>(null);\n const { t } = useTranslation();\n const { queryPaymentMethod, queryRoomstayId, queryPlanpayCheckoutId } = useConfirmationQuery();\n const context = useBookingEngine();\n const methods = useFormContext<ConfirmationFormValues>();\n const { isBackFromPlanpay, isBackFromExternalPayment, isLoading, setLoadingStatus, book, rollbackReservation, commitReservation } = useConfirmationStep();\n const basketContext = useBasket();\n const tokenizerRef = useRef<any | null>(null);\n const historyConsistentPush = useHistoryConsistentPush();\n const { roomstayMember } = useMemberContext();\n const { hotel } = useCurrentHotel();\n\n const isCardPassthrough = hotel?.cardProcessor ? hotel.cardProcessor === EHotelCardProcessor.Passthrough : true;\n\n const toPaymentPayload = async (paymentMethod: string): Promise<IBookingPayment> => {\n let payment: IBookingPayment;\n switch (paymentMethod) {\n case EBookingPaymentMethod.Planpay: {\n const params = new URLSearchParams(window.location.search);\n params.set('roomstayId', '{{rsId}}');\n params.set('session', context.sessionProvider.getCurrentSessionID().toString());\n params.set('paymentMethod', EBookingPaymentMethod.Planpay);\n const redirectURL = `${window.location.origin}${window.location.pathname}${window.location.search}#/step/confirmation/?${params}`;\n payment = {\n Method: EBookingPaymentMethod.Planpay,\n PlanpayCheckoutId: queryPlanpayCheckoutId || undefined,\n RedirectUrl: redirectURL,\n };\n break;\n }\n case EBookingPaymentMethod.Card: {\n if (isCardPassthrough) {\n payment = {\n Method: EBookingPaymentMethod.Card,\n PaymentCard: await tokenizerRef.current?.getTokenizedCode(),\n };\n } else {\n payment = {\n Method: EBookingPaymentMethod.Card,\n };\n }\n\n break;\n }\n case EBookingPaymentMethod.SavedCard:\n default: {\n payment = {\n Method: EBookingPaymentMethod.SavedCard,\n SavedCardID: paymentMethod,\n };\n }\n }\n\n return payment;\n };\n\n useEffect(() => {\n let defaultPaymentValue = '' as EBookingPaymentMethod;\n if (Object.values(EBookingPaymentMethod).includes(queryPaymentMethod as EBookingPaymentMethod)) {\n defaultPaymentValue = queryPaymentMethod as EBookingPaymentMethod;\n } else {\n if (roomstayMember?.defaultCard && roomstayMember?.cards?.find((card) => card.cardId === roomstayMember?.defaultCard)) {\n defaultPaymentValue = roomstayMember?.defaultCard as EBookingPaymentMethod;\n } else {\n defaultPaymentValue = EBookingPaymentMethod.Card;\n }\n }\n\n methods.setValue('paymentMethod', defaultPaymentValue);\n\n const reservationRoomstayId: string | undefined = basketContext.reservationData?.roomstayId;\n const isMatchingRoomstayId: boolean = !!queryRoomstayId && (!reservationRoomstayId || queryRoomstayId === reservationRoomstayId);\n if (isBackFromExternalPayment && isMatchingRoomstayId) {\n commitReservation?.(basketContext.reservationData, 'Please wait... Finalising your reservation');\n } else {\n handleChangePaymentMethod(defaultPaymentValue);\n }\n\n if (isBackFromPlanpay) {\n if (queryRoomstayId === reservationRoomstayId) {\n onPlaypayCallback();\n } else {\n rollbackReservation?.();\n }\n }\n\n return () => {\n if (!isBackFromPlanpay && !isBackFromExternalPayment) rollbackReservation?.();\n };\n }, []);\n\n const onPlaypayCallback = async () => {\n await commitReservation?.(basketContext.reservationData);\n };\n\n const paymentMethod = methods.watch('paymentMethod');\n\n context.engine\n .getSessionProvider()\n .getSession()\n .then((session) => {\n setSource(session.source);\n });\n\n const returnToPickRooms = async () => {\n // TODO: What if StepRoom doesn't exist?\n historyConsistentPush(getStepRoom().getStepUrl());\n };\n\n const onNextStepClicked = async () => {\n if (hotel?.cardProcessor !== EHotelCardProcessor.Passthrough) {\n setLoadingStatus('You will be redirected shortly to the payment provider.');\n } else {\n setLoadingStatus('Processing booking');\n }\n\n await handleBook(paymentMethod);\n return false;\n };\n\n const validateConfirmationPolicy = (): boolean => {\n return !ConfirmationVerifyFeature.isActive() || !!confirmationPolicy?.current?.checked;\n };\n\n const validateCustomFields = (scrollToInput?: boolean): boolean => {\n const adhocValid = formContext?.errorChecks.every((check) => check().validate(scrollToInput));\n return adhocValid === undefined ? true : adhocValid;\n };\n\n const handleBook = async (paymentMethod: EBookingPaymentMethod): Promise<void> => {\n await book?.(\n async () => toPaymentPayload(paymentMethod),\n commentTextbox.current?.value,\n async (): Promise<boolean> => {\n if (!validateConfirmationPolicy()) {\n setConfirmationPolicyError(true);\n return false;\n }\n if (!validateCustomFields(true)) {\n return false;\n }\n try {\n if (paymentMethod === EBookingPaymentMethod.Card && isCardPassthrough) await tokenizerRef.current.getTokenizedCode();\n return true;\n } catch (e) {\n return false;\n }\n },\n (validationResult) => {\n if (validationResult) {\n setDifferenceWarning(validationResult);\n }\n }\n );\n };\n\n const handleChangePaymentMethod = async (paymentMethod: string) => {\n if (paymentMethod !== EBookingPaymentMethod.Planpay) {\n await rollbackReservation?.();\n }\n };\n\n return (\n <form>\n {isBackFromPlanpay ? (\n <LargeLoader />\n ) : (\n <>\n <div className=\"u-marg-bottom--heavy\">\n <div className=\"u-marg-bottom--light\">\n <Headline bold>{t(Translation.Step.Confirmation.GuestDetails)}</Headline>\n </div>\n <Text type={TextType.Small} color={Color.Success}>\n <strong>{t(Translation.Step.Confirmation.AlmostDone, { required: '*' })}</strong>\n </Text>\n </div>\n <RoomContactDetails />\n {source === 'inline' ? (\n <Alert type={AlertType.Accent2} heavyPadding>\n <div className=\"u-flex u-w-100 flex-wrap flex-xl-nowrap\">\n <div>\n <Text color={Color.Accent} bold>\n {t(Translation.Step.Confirmation.WantMoreRooms)}\n </Text>\n <Text color={Color.Navy}>{t(Translation.Step.Confirmation.YouCanAddAndEditRooms)}</Text>\n </div>\n <div className=\"d-flex align-items-center u-marg-top@xl-\">\n <BEButton filled primary icon={IconType.Add} iconPosition=\"left\" onClick={returnToPickRooms}>\n {t(Translation.Step.Confirmation.AddMoreRooms)}\n </BEButton>\n </div>\n </div>\n </Alert>\n ) : (\n <></>\n )}\n {ShowIATANumberOnCheckoutFeature.isActive() && (\n <>\n <div className=\"u-marg-bottom--heavy\">\n <div className=\"u-marg-bottom\">\n <Headline bold>Travel Agent</Headline>\n </div>\n\n <div className=\"u-marg-bottom--light\">\n <Text type={TextType.Small}>\n <strong>{t(Translation.Step.Confirmation.Inputs.IATANumber)}</strong>\n </Text>\n </div>\n <div className=\"u-marg-bottom--light\">\n <Text type={TextType.Small}>{t(Translation.Step.Confirmation.Inputs.IATANumberGuide)}</Text>\n </div>\n <TextBox placeholder={t(Translation.Step.Confirmation.Inputs.IATANumber)} wide {...methods.register('IATANumber')} />\n </div>\n <LineBreak />\n </>\n )}\n <StepConfirmationCommentsComponent inputRef={commentTextbox} />\n <LineBreak />\n <div className=\"u-marg-bottom--heavy\">\n <div className=\"u-marg-bottom\">\n <Headline bold>{t(Translation.Navigation.Menu.PaymentInformation)}</Headline>\n </div>\n <PaymentInformation\n tokenizerRef={tokenizerRef}\n onChangeCb={async (code: EBookingPaymentMethod) => {\n await handleChangePaymentMethod(code);\n if (code === EBookingPaymentMethod.Planpay) {\n await handleBook(code);\n }\n }}\n />\n <div className=\"u-marg-top u-flex align-items-center\">\n <div className=\"u-flex align-items-center justify-content-start\">\n <Icon icon={IconType.Lock} color={Color.Success} />\n <div className=\"u-marg-left--light\">\n <Text type={TextType.Small} color={Color.Success}>\n <strong>{t(Translation.Step.Confirmation.Secured)}</strong>\n </Text>\n </div>\n </div>\n <SSLSecureBadge />\n </div>\n </div>\n <LineBreak />\n <StepConfirmationPoliciesSection />\n <div className=\"u-pad-top--light u-marg-bottom\">\n <StepConfirmationPolicyBlock />\n </div>\n {ConfirmationVerifyFeature.isActive() && (\n <>\n <LineBreak />\n <div>\n <StepConfirmationAcknowledgement ref={confirmationPolicy} confirmationPolicyError={confirmationPolicyError} />\n </div>\n </>\n )}\n <div className=\"u-flex u-marg-top--heavy justify-content-end\">\n <NextStepButton\n disabled={paymentMethod === EBookingPaymentMethod.Planpay || isLoading}\n text={t(Translation.Step.Confirmation.ConfirmReservation)}\n isLoading={isLoading}\n onClick={onNextStepClicked}\n />\n </div>\n </>\n )}\n\n <StepConfirmationCheckoutDifferencesModal\n differences={differenceWarning.differences}\n warnings={differenceWarning.warnings}\n isLoading={isLoading}\n onClose={async () => {\n await rollbackReservation?.();\n historyConsistentPush(getStepRoom().getStepUrl());\n }}\n onProceed={async () => {\n if (paymentMethod === EBookingPaymentMethod.Planpay) {\n setDifferenceWarning({\n differences: [],\n warnings: [],\n });\n } else {\n await commitReservation?.(basketContext.reservationData);\n }\n }}\n />\n </form>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"StepConfirmationForm.js","sourceRoot":"/","sources":["src/components/steps/confirmation/StepConfirmationForm.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sGAA+F;AAC/F,uEAAuE;AACvE,kDAA0B;AAC1B,qDAAiD;AACjD,iDAA+C;AAC/C,0DAAuD;AAEvD,iFAAyD;AACzD,oEAA8D;AAC9D,iGAAyE;AACzE,6EAAqD;AACrD,6EAAqD;AACrD,uEAAgE;AAChE,+EAAuD;AACvD,0FAAkE;AAClE,mFAA2D;AAC3D,kEAA2D;AAC3D,2EAAmD;AACnD,4GAAoF;AACpF,4GAAoF;AACpF,sIAA8G;AAC9G,yHAAsH;AACtH,sIAA8G;AAC9G,8HAAsG;AAEtG,8GAAsF;AACtF,0HAAkG;AAClG,wCAAqC;AACrC,qEAA6C;AAC7C,8DAA2D;AAE3D,SAAwB,oBAAoB;;IACxC,MAAM,EAAE,CAAC,EAAE,GAAG,IAAA,8BAAc,GAAE,CAAC;IAE/B,MAAM,OAAO,GAAG,IAAA,gCAAc,GAA0B,CAAC;IACzD,MAAM,EAAE,eAAe,EAAE,iBAAiB,EAAE,aAAa,EAAE,GAAG,IAAA,6CAAmB,GAAE,CAAC;IAEpF,MAAM,qBAAqB,GAAG,IAAA,gDAAwB,GAAE,CAAC;IAEzD,MAAM,EAAE,gBAAgB,EAAE,GAAG,IAAA,mCAAgB,GAAE,CAAC;IAEhD,MAAM,iBAAiB,GAAG,GAAS,EAAE;QACjC,qBAAqB,CAAC,IAAA,qBAAW,GAAE,CAAC,UAAU,EAAE,CAAC,CAAC;IACtD,CAAC,CAAA,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AAE,aAAK,CAAC,OAAO,GAAI;wBACnD,uCAAK,SAAS,EAAC,oBAAoB;4BAC/B,8BAAC,cAAI,IAAC,IAAI,EAAE,eAAQ,CAAC,KAAK,EAAE,KAAK,EAAE,aAAK,CAAC,OAAO;gCAC5C,8CAAS,CAAC,CAAC,yBAAW,CAAC,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAU,CACxD,CACL,CACJ;oBACN,8BAAC,wBAAc,OAAG,CAChB,CACJ;YACN,8BAAC,mBAAS,OAAG,CACd,CACN;QACD,8BAAC,yCAA+B,OAAG;QACnC,uCAAK,SAAS,EAAC,gCAAgC;YAC3C,8BAAC,qCAA2B,OAAG,CAC7B;QACL,mCAAyB,CAAC,QAAQ,EAAE,IAAI,CACrC;YACI,8BAAC,mBAAS,OAAG;YACb;gBACI,8BAAC,yCAA+B,OAAG,CACjC,CACP,CACN,CACF,CACN,CAAC;IAEF,OAAO,CACH,4CACK,iBAAiB,CAAC,CAAC,CAAC,CACjB,8BAAC,qBAAW,OAAG,CAClB,CAAC,CAAC,CAAC,CACA;QACI,8BAAC,wBAAc,IAAC,IAAI,EAAE,CAAC,gBAAgB,IAAI,CAAC,eAAe,IAAG,cAAc,CAAkB;QAC7F,gBAAgB,IAAI,CACjB,8BAAC,wBAAc,IAAC,IAAI,EAAE,eAAe;YACjC,8BAAC,qBAAW,OAAG,EACd,MAAA,gBAAgB,CAAC,kBAAkB;qCAAI,CAC3B,CACpB,CACF,CACN,CACE,CACV,CAAC;AACN,CAAC;AAzHD,uCAyHC","sourcesContent":["import { useConfirmationStep } from 'contexts/ConfirmationStepContext/ConfirmationStepContext';\nimport { useHistoryConsistentPush } from 'hooks/HistoryConsistentPush';\nimport React from 'react';\nimport { useFormContext } from 'react-hook-form';\nimport { useTranslation } from 'react-i18next';\nimport { Translation } from 'translations/Translation';\n\nimport AutoAutoHeight from '@/animations/AutoAutoHeight';\nimport Alert, { AlertType } from '@/components/generic/Alert';\nimport SSLSecureBadge from '@/components/generic/badging/SSLSecureBadge';\nimport BEButton from '@/components/generic/BEButton';\nimport Headline from '@/components/generic/Headline';\nimport Icon, { IconType } from '@/components/generic/Icon/Icon';\nimport LineBreak from '@/components/generic/LineBreak';\nimport LargeLoader from '@/components/generic/loader/LargeLoader';\nimport ScrollToTop from '@/components/generic/ScrollToTop';\nimport Text, { TextType } from '@/components/generic/Text';\nimport TextBox from '@/components/generic/TextBox';\nimport PaymentInformation from '@/components/steps/confirmation/PaymentInformation';\nimport RoomContactDetails from '@/components/steps/confirmation/RoomContactDetails';\nimport StepConfirmationAcknowledgement from '@/components/steps/confirmation/StepConfirmationAcknowledgement';\nimport { StepConfirmationCommentsComponent } from '@/components/steps/confirmation/StepConfirmationCommentsComponent';\nimport StepConfirmationPoliciesSection from '@/components/steps/confirmation/StepConfirmationPoliciesSection';\nimport StepConfirmationPolicyBlock from '@/components/steps/confirmation/StepConfirmationPolicyBlock';\nimport { ConfirmationFormValues } from '@/models/Confirmation';\nimport ConfirmationVerifyFeature from '@/providers/feature/ConfirmationVerifyFeature';\nimport ShowIATANumberOnCheckoutFeature from '@/providers/feature/ShowIATANumberOnCheckoutFeature';\nimport { Color } from '@/util/Color';\nimport getStepRoom from '@/util/GetStepRoom';\nimport { usePaymentHelper } from '@/util/usePaymentHelper';\n\nexport default function StepConfirmationForm() {\n const { t } = useTranslation();\n\n const methods = useFormContext<ConfirmationFormValues>();\n const { isInPaymentMode, isBackFromPlanpay, bookingSource } = useConfirmationStep();\n\n const historyConsistentPush = useHistoryConsistentPush();\n\n const { exclusivePayment } = usePaymentHelper();\n\n const returnToPickRooms = async () => {\n historyConsistentPush(getStepRoom().getStepUrl());\n };\n\n const prePaymentInfo = (\n <>\n <div className=\"u-marg-bottom--heavy\">\n <div className=\"u-marg-bottom--light\">\n <Headline bold>{t(Translation.Step.Confirmation.GuestDetails)}</Headline>\n </div>\n <Text type={TextType.Small} color={Color.Success}>\n <strong>{t(Translation.Step.Confirmation.AlmostDone, { required: '*' })}</strong>\n </Text>\n </div>\n <RoomContactDetails />\n {bookingSource === 'inline' ? (\n <Alert type={AlertType.Accent2} heavyPadding>\n <div className=\"u-flex u-w-100 flex-wrap flex-xl-nowrap\">\n <div>\n <Text color={Color.Accent} bold>\n {t(Translation.Step.Confirmation.WantMoreRooms)}\n </Text>\n <Text color={Color.Navy}>{t(Translation.Step.Confirmation.YouCanAddAndEditRooms)}</Text>\n </div>\n <div className=\"d-flex align-items-center u-marg-top@xl-\">\n <BEButton filled primary icon={IconType.Add} iconPosition=\"left\" onClick={returnToPickRooms}>\n {t(Translation.Step.Confirmation.AddMoreRooms)}\n </BEButton>\n </div>\n </div>\n </Alert>\n ) : (\n <></>\n )}\n {ShowIATANumberOnCheckoutFeature.isActive() && (\n <>\n <div className=\"u-marg-bottom--heavy\">\n <div className=\"u-marg-bottom\">\n <Headline bold>{t(Translation.Step.Confirmation.TravelAgent)}</Headline>\n </div>\n\n <div className=\"u-marg-bottom--light\">\n <Text type={TextType.Small}>\n <strong>{t(Translation.Step.Confirmation.Inputs.IATANumber)}</strong>\n </Text>\n </div>\n <div className=\"u-marg-bottom--light\">\n <Text type={TextType.Small}>{t(Translation.Step.Confirmation.Inputs.IATANumberGuide)}</Text>\n </div>\n <TextBox placeholder={t(Translation.Step.Confirmation.Inputs.IATANumber)} wide {...methods.register('IATANumber')} />\n </div>\n <LineBreak />\n </>\n )}\n <StepConfirmationCommentsComponent />\n <LineBreak />\n {!exclusivePayment && (\n <>\n <div className=\"u-marg-bottom--heavy\">\n <div className=\"u-marg-bottom\">\n <Headline bold>{t(Translation.Navigation.Menu.PaymentInformation)}</Headline>\n </div>\n\n <PaymentInformation />\n <div className=\"u-marg-top u-flex align-items-center\">\n <div className=\"u-flex align-items-center justify-content-start\">\n <Icon icon={IconType.Lock} color={Color.Success} />\n <div className=\"u-marg-left--light\">\n <Text type={TextType.Small} color={Color.Success}>\n <strong>{t(Translation.Step.Confirmation.Secured)}</strong>\n </Text>\n </div>\n </div>\n <SSLSecureBadge />\n </div>\n </div>\n <LineBreak />\n </>\n )}\n <StepConfirmationPoliciesSection />\n <div className=\"u-pad-top--light u-marg-bottom\">\n <StepConfirmationPolicyBlock />\n </div>\n {ConfirmationVerifyFeature.isActive() && (\n <>\n <LineBreak />\n <div>\n <StepConfirmationAcknowledgement />\n </div>\n </>\n )}\n </>\n );\n\n return (\n <form>\n {isBackFromPlanpay ? (\n <LargeLoader />\n ) : (\n <>\n <AutoAutoHeight open={!exclusivePayment || !isInPaymentMode}>{prePaymentInfo}</AutoAutoHeight>\n {exclusivePayment && (\n <AutoAutoHeight open={isInPaymentMode}>\n <ScrollToTop />\n {exclusivePayment.renderPaymentInput?.()}\n </AutoAutoHeight>\n )}\n </>\n )}\n </form>\n );\n}\n"]}
|
|
@@ -1,12 +1,22 @@
|
|
|
1
|
+
import { PaymentHandler } from '../../handlers/payment/PaymentHandler';
|
|
1
2
|
import ReservationsDTO from '../../models/Api/ReservationsDTO';
|
|
2
|
-
|
|
3
|
+
export type ConfirmationValidator = {
|
|
4
|
+
message: string;
|
|
5
|
+
name: string;
|
|
6
|
+
validate: (scrollToInput?: boolean) => boolean;
|
|
7
|
+
};
|
|
3
8
|
export interface ConfirmationContextProps {
|
|
4
|
-
|
|
9
|
+
onContinueClick: () => Promise<void>;
|
|
5
10
|
commitReservation?: (resData: ReservationsDTO, statusUpdate?: string) => Promise<void>;
|
|
6
11
|
rollbackReservation?: () => Promise<void>;
|
|
7
12
|
redirectOut: (target: string, statusUpdate?: string) => void;
|
|
8
13
|
setLoadingStatus: (status: string) => void;
|
|
14
|
+
bookingSource?: string;
|
|
9
15
|
isLoading?: boolean;
|
|
10
16
|
isBackFromPlanpay?: boolean;
|
|
11
17
|
isBackFromExternalPayment?: boolean;
|
|
18
|
+
isInPaymentMode: boolean;
|
|
19
|
+
availablePaymentHandlers: PaymentHandler[];
|
|
20
|
+
errorChecks: (() => ConfirmationValidator)[];
|
|
21
|
+
addErrorChecks: (...checks: (() => ConfirmationValidator)[]) => void;
|
|
12
22
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfirmationStepContextTypes.js","sourceRoot":"/","sources":["src/contexts/ConfirmationStepContext/ConfirmationStepContextTypes.ts"],"names":[],"mappings":"","sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"ConfirmationStepContextTypes.js","sourceRoot":"/","sources":["src/contexts/ConfirmationStepContext/ConfirmationStepContextTypes.ts"],"names":[],"mappings":"","sourcesContent":["import { PaymentHandler } from '@/handlers/payment/PaymentHandler';\nimport ReservationsDTO from '@/models/Api/ReservationsDTO';\n\nexport type ConfirmationValidator = {\n message: string;\n name: string;\n\n validate: (scrollToInput?: boolean) => boolean;\n};\n\nexport interface ConfirmationContextProps {\n onContinueClick: () => Promise<void>;\n commitReservation?: (resData: ReservationsDTO, statusUpdate?: string) => Promise<void>;\n rollbackReservation?: () => Promise<void>;\n redirectOut: (target: string, statusUpdate?: string) => void;\n setLoadingStatus: (status: string) => void;\n\n bookingSource?: string;\n\n isLoading?: boolean;\n isBackFromPlanpay?: boolean;\n isBackFromExternalPayment?: boolean;\n\n isInPaymentMode: boolean;\n availablePaymentHandlers: PaymentHandler[];\n\n errorChecks: (() => ConfirmationValidator)[];\n addErrorChecks: (...checks: (() => ConfirmationValidator)[]) => void;\n}\n"]}
|