mts-booking-library 1.2.31 → 1.2.32
Sign up to get free protection for your applications and to get access to all the features.
@@ -58,13 +58,13 @@ export declare class JourneyBooking extends Booking {
|
|
58
58
|
getBuyerPassengersDetails(): Promise<ErrorResponse | GetBuyerPassengersDetailsResponse>;
|
59
59
|
/**
|
60
60
|
* @description This method shall be called when the user wants to retrieve information about an esisting buyer.
|
61
|
-
* @param {string} [
|
62
|
-
* A
|
63
|
-
* @param {string} [
|
61
|
+
* @param {string} [linkavelCard=undefined] The linkavel card number of the buyer. This parameter is required if phoneNumber is not set.
|
62
|
+
* A linkavelCard number is a string of 9 digits.
|
63
|
+
* @param {string} [phoneNumber=undefined] The phone number of the buyer. This parameter is required if linkavelCard is not set.
|
64
64
|
* @returns An object of type {@link GetBuyerPassengersDetailsResponse} containing the buyer and the passengers information,
|
65
65
|
* as well as a list of the available tariffs for each trip.
|
66
66
|
*/
|
67
|
-
getBuyerFromLinkavelCard(
|
67
|
+
getBuyerFromLinkavelCard(linkavelCard?: string, phoneNumber?: string): Promise<ErrorResponse | Person>;
|
68
68
|
/**
|
69
69
|
* @description This methosd shall be called when the user wants to update the buyer and the passengers information.
|
70
70
|
* @param {EditPassengersDetailsRequest} passengersDetails The object containing the buyer and the passengers information.
|
@@ -328,13 +328,13 @@ var JourneyBooking = /** @class */ (function (_super) {
|
|
328
328
|
};
|
329
329
|
/**
|
330
330
|
* @description This method shall be called when the user wants to retrieve information about an esisting buyer.
|
331
|
-
* @param {string} [
|
332
|
-
* A
|
333
|
-
* @param {string} [
|
331
|
+
* @param {string} [linkavelCard=undefined] The linkavel card number of the buyer. This parameter is required if phoneNumber is not set.
|
332
|
+
* A linkavelCard number is a string of 9 digits.
|
333
|
+
* @param {string} [phoneNumber=undefined] The phone number of the buyer. This parameter is required if linkavelCard is not set.
|
334
334
|
* @returns An object of type {@link GetBuyerPassengersDetailsResponse} containing the buyer and the passengers information,
|
335
335
|
* as well as a list of the available tariffs for each trip.
|
336
336
|
*/
|
337
|
-
JourneyBooking.prototype.getBuyerFromLinkavelCard = function (
|
337
|
+
JourneyBooking.prototype.getBuyerFromLinkavelCard = function (linkavelCard, phoneNumber) {
|
338
338
|
return __awaiter(this, void 0, void 0, function () {
|
339
339
|
var buyerPassengersDetails, searchParams, url;
|
340
340
|
return __generator(this, function (_a) {
|
@@ -346,10 +346,10 @@ var JourneyBooking = /** @class */ (function (_super) {
|
|
346
346
|
if (!buyerPassengersDetails || !buyerPassengersDetails[0]) {
|
347
347
|
throw Error("The status of the cart does not allow to call this API");
|
348
348
|
}
|
349
|
-
if (!
|
350
|
-
throw Error("At least one of the parameters
|
349
|
+
if (!linkavelCard && !phoneNumber) {
|
350
|
+
throw Error("At least one of the parameters linkavelCard or phoneNumber must be set");
|
351
351
|
}
|
352
|
-
searchParams = new URLSearchParams(__assign(__assign({}, (
|
352
|
+
searchParams = new URLSearchParams(__assign(__assign({}, (linkavelCard && { linkavelCard: linkavelCard })), (phoneNumber && { phoneNumber: phoneNumber })));
|
353
353
|
url = "".concat(this.config.API_ENDPOINT, "/buyers?").concat(searchParams);
|
354
354
|
return [2 /*return*/, this.callGetApi(url).then(function (response) {
|
355
355
|
// Check for errors
|