mts-booking-library 3.2.0 → 3.3.0
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/lib/booking/booking.d.ts
CHANGED
|
@@ -78,13 +78,11 @@ export declare abstract class Booking {
|
|
|
78
78
|
/**
|
|
79
79
|
* @description This method shall be used to get all necessary informations to initialize a payment with a certain gateway.
|
|
80
80
|
* @param gatewayId The id of the gateway to use. Its value shall be taken from the response of the {@link Booking.getSellerGateways} API
|
|
81
|
-
* @param
|
|
82
|
-
*
|
|
83
|
-
* `/booking?step=BOOKING_STEP_PAYMENT_PROCESSING&cartGuid={guid}` path on top. Pass `window.location.origin` from the
|
|
84
|
-
* caller — the BE owns the rest. Replaces the legacy full-URL `returnUrl` parameter (BE 3.2.0+).
|
|
81
|
+
* @param returnUrl The url to which the user will be redirected after the payment. This value shall be set only if the
|
|
82
|
+
* chosen gateway is {@link GatewayTypes.PAYPAL} or {@link GatewayTypes.WORLDLINE}
|
|
85
83
|
* @returns An {@link ErrorResponse} object in case of error, a {@link GetPaymentInformationFromGatewayResponse} object otherwise.
|
|
86
84
|
*/
|
|
87
|
-
getPaymentInformationFromGateway(gatewayId: number,
|
|
85
|
+
getPaymentInformationFromGateway(gatewayId: number, returnUrl?: string, options?: ApiCallOptions): Promise<ErrorResponse | GetPaymentInformationFromGatewayResponse>;
|
|
88
86
|
/**
|
|
89
87
|
* @description This method shall be used to issue the tickets. It must be called after the payment was successful.
|
|
90
88
|
* @param paymentMethod The payment method used to pay the cart. If the chosen method is {@link PaymentMethods.ZERO_COST},
|
package/lib/booking/booking.js
CHANGED
|
@@ -285,13 +285,11 @@ var Booking = /** @class */ (function () {
|
|
|
285
285
|
/**
|
|
286
286
|
* @description This method shall be used to get all necessary informations to initialize a payment with a certain gateway.
|
|
287
287
|
* @param gatewayId The id of the gateway to use. Its value shall be taken from the response of the {@link Booking.getSellerGateways} API
|
|
288
|
-
* @param
|
|
289
|
-
*
|
|
290
|
-
* `/booking?step=BOOKING_STEP_PAYMENT_PROCESSING&cartGuid={guid}` path on top. Pass `window.location.origin` from the
|
|
291
|
-
* caller — the BE owns the rest. Replaces the legacy full-URL `returnUrl` parameter (BE 3.2.0+).
|
|
288
|
+
* @param returnUrl The url to which the user will be redirected after the payment. This value shall be set only if the
|
|
289
|
+
* chosen gateway is {@link GatewayTypes.PAYPAL} or {@link GatewayTypes.WORLDLINE}
|
|
292
290
|
* @returns An {@link ErrorResponse} object in case of error, a {@link GetPaymentInformationFromGatewayResponse} object otherwise.
|
|
293
291
|
*/
|
|
294
|
-
Booking.prototype.getPaymentInformationFromGateway = function (gatewayId,
|
|
292
|
+
Booking.prototype.getPaymentInformationFromGateway = function (gatewayId, returnUrl, options) {
|
|
295
293
|
return __awaiter(this, void 0, void 0, function () {
|
|
296
294
|
var issueStep, searchParams, url;
|
|
297
295
|
return __generator(this, function (_a) {
|
|
@@ -303,7 +301,7 @@ var Booking = /** @class */ (function () {
|
|
|
303
301
|
if (!issueStep || !issueStep[0]) {
|
|
304
302
|
throw Error("The status of the cart does not allow to call this API");
|
|
305
303
|
}
|
|
306
|
-
searchParams = new URLSearchParams(__assign({ gatewayId: gatewayId.toString(), cartGuid: this.cartGuid }, (
|
|
304
|
+
searchParams = new URLSearchParams(__assign({ gatewayId: gatewayId.toString(), cartGuid: this.cartGuid }, (returnUrl && { returnUrl: returnUrl })));
|
|
307
305
|
url = "".concat(this.config.API_ENDPOINT, "/v3_payment/paymentInformation?").concat(searchParams);
|
|
308
306
|
return [2 /*return*/, this.callGetApi(url, options).then(function (response) {
|
|
309
307
|
return (0, ErrorResponse_1.objectIsMTSErrorResponse)(response)
|
|
@@ -19,6 +19,8 @@ export type Person = {
|
|
|
19
19
|
notes?: string;
|
|
20
20
|
/** The social security number of the person. */
|
|
21
21
|
socialSecurityNumber?: string | null;
|
|
22
|
+
/** The sex of the person. M = male, F = female, O = other. */
|
|
23
|
+
sex?: "M" | "F" | "O" | null;
|
|
22
24
|
};
|
|
23
25
|
export declare const DEFAULT_PERSON: Person;
|
|
24
26
|
export declare const initializePerson: (person?: Person | undefined | null) => Person;
|
|
@@ -55,6 +57,8 @@ export type GetPassenger = Person & {
|
|
|
55
57
|
passengerPhoneNumberOption: PersonDataFieldStatus;
|
|
56
58
|
/** Whether the passenger social security number is reuqired, optional or cannot be specified. */
|
|
57
59
|
passengerSSNOption: PersonDataFieldStatus;
|
|
60
|
+
/** Whether the passenger sex is required, optional or cannot be specified. */
|
|
61
|
+
passengerSexOption?: PersonDataFieldStatus;
|
|
58
62
|
};
|
|
59
63
|
export declare enum PersonDataFieldStatus {
|
|
60
64
|
/** The field (e.g. the buyer's email) is optional. The input shall be displayed, but the user can skip it. */
|