mts-booking-library 2.4.7 → 2.4.9

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.
@@ -110,7 +110,7 @@ export declare class ServiceBooking extends Booking {
110
110
  * It should be null if the buyer data cannot be specified (see {@link GetBuyerPassengersDetailsResponse.buyerDataStatus}).
111
111
  * @returns An {@link ErrorResponse} object in case of error, true otherwise.
112
112
  */
113
- updateBuyerPassengersDetails(buyerDetails: PersonDetails | null, noSSN?: boolean, options?: ApiCallOptions): Promise<ErrorResponse | boolean>;
113
+ updateBuyerPassengersDetails(buyerDetails: PersonDetails | null, options?: ApiCallOptions): Promise<ErrorResponse | boolean>;
114
114
  /**
115
115
  * @description This method allows to add a reduction to the whole cart or to a single trip in the cart.
116
116
  * @param request The information about the reduction to add
@@ -385,7 +385,7 @@ var ServiceBooking = /** @class */ (function (_super) {
385
385
  * It should be null if the buyer data cannot be specified (see {@link GetBuyerPassengersDetailsResponse.buyerDataStatus}).
386
386
  * @returns An {@link ErrorResponse} object in case of error, true otherwise.
387
387
  */
388
- ServiceBooking.prototype.updateBuyerPassengersDetails = function (buyerDetails, noSSN, options) {
388
+ ServiceBooking.prototype.updateBuyerPassengersDetails = function (buyerDetails, options) {
389
389
  return __awaiter(this, void 0, void 0, function () {
390
390
  var buyerPassengersDetails, request, url;
391
391
  var _this = this;
@@ -401,8 +401,7 @@ var ServiceBooking = /** @class */ (function (_super) {
401
401
  request = {
402
402
  cartGuid: this.cart.guid,
403
403
  buyer: buyerDetails,
404
- passengers: [],
405
- noSSN: noSSN !== null && noSSN !== void 0 ? noSSN : false
404
+ passengers: []
406
405
  };
407
406
  url = "".concat(this.config.API_ENDPOINT, "/v3_booking/carts/details");
408
407
  return [2 /*return*/, this.callPostApi(url, request, options).then(function (response) {
@@ -124,7 +124,7 @@ export declare class TplBooking extends Booking {
124
124
  * with the subscription. This parameter is required if the cart contains a subscription.
125
125
  * @returns An {@link ErrorResponse} object in case of error, true otherwise.
126
126
  */
127
- updateBuyerPassengersDetails(buyerDetails: PersonDetails | null, subscriptionPersonCode?: string, noSSN?: boolean, options?: ApiCallOptions): Promise<ErrorResponse | boolean>;
127
+ updateBuyerPassengersDetails(buyerDetails: PersonDetails | null, subscriptionPersonCode?: string, options?: ApiCallOptions): Promise<ErrorResponse | boolean>;
128
128
  /**
129
129
  * @description This method allows to add a reduction to the whole cart or to a single trip in the cart.
130
130
  * @param request The information about the reduction to add
@@ -440,7 +440,7 @@ var TplBooking = /** @class */ (function (_super) {
440
440
  * with the subscription. This parameter is required if the cart contains a subscription.
441
441
  * @returns An {@link ErrorResponse} object in case of error, true otherwise.
442
442
  */
443
- TplBooking.prototype.updateBuyerPassengersDetails = function (buyerDetails, subscriptionPersonCode, noSSN, options) {
443
+ TplBooking.prototype.updateBuyerPassengersDetails = function (buyerDetails, subscriptionPersonCode, options) {
444
444
  return __awaiter(this, void 0, void 0, function () {
445
445
  var buyerPassengersDetails, request, url;
446
446
  var _this = this;
@@ -466,8 +466,7 @@ var TplBooking = /** @class */ (function (_super) {
466
466
  personCode: subscriptionPersonCode
467
467
  }
468
468
  ]
469
- : [],
470
- noSSN: noSSN !== null && noSSN !== void 0 ? noSSN : false
469
+ : []
471
470
  };
472
471
  url = "".concat(this.config.API_ENDPOINT, "/v3_booking/carts/details");
473
472
  return [2 /*return*/, this.callPostApi(url, request, options).then(function (response) {
@@ -18,6 +18,10 @@ export type CreateUpdateCartRequest = {
18
18
  cartBooking: CartBooking;
19
19
  /** The return booking to be added to the cart (e.g. for MLP). */
20
20
  returnCartBooking?: CartBooking;
21
+ /** Whether the buyer has opposed to the collection of the SSN for this cart (possible in TPL). */
22
+ noSSN?: boolean;
23
+ /** The payment method that the final customer is using to pay. Required when using {@link CreateUpdateCartRequest.noSSN} */
24
+ customerPaymentMethod?: PaymentMethods.CASH | PaymentMethods.CARD;
21
25
  };
22
26
  export type CartBooking = {
23
27
  /** A record containing tariff ids as keys and their respective quantities as values. */
@@ -122,6 +126,10 @@ export type Cart = {
122
126
  * The first element of the list is the default cash in method (and the preferred by the seller).
123
127
  */
124
128
  cashInMethods: PaymentMethods[];
129
+ /**
130
+ * Whether the cart is not associated with a specific SSN.
131
+ */
132
+ noSSN: boolean;
125
133
  };
126
134
  /** The type that {@link Cart.stepsToStatus} assumes once parsed to a map */
127
135
  export type processedStepsToStatus = Map<Booking.BookingSteps, [boolean, boolean, boolean]>;
@@ -21,8 +21,6 @@ export type Person = {
21
21
  export type PersonDetails = Person & {
22
22
  /** The social security number of the buyer, if provided. */
23
23
  socialSecurityNumber: string | null;
24
- /** Whether the person has opposed to tax deduction. */
25
- noSSN: boolean;
26
24
  };
27
25
  export declare const DEFAULT_PERSON: Person;
28
26
  export declare const initializePerson: (person?: Person | undefined | null) => Person;
@@ -93,8 +91,6 @@ export type GetBuyerPassengersDetailsResponse = {
93
91
  buyerSSNOption: PersonDataFieldStatus;
94
92
  /** An array of {@link GetPassenger} objects representing the passengers. */
95
93
  passengers: GetPassenger[] | null;
96
- /** Whether the buyer has opposed to tax deduction for this cart. */
97
- noSSN: boolean | null;
98
94
  };
99
95
  /**
100
96
  * @description Represents the type of the passengers array in {@link EditPassengersDetailsRequest}.
@@ -118,9 +114,4 @@ export type EditPassengersDetailsRequest = {
118
114
  * It should be null if the buyer data cannot be specified (see {@link GetBuyerPassengersDetailsResponse.buyerDataStatus}).
119
115
  */
120
116
  buyer: PersonDetails | null;
121
- /**
122
- * Whether the buyer has opposed to tax deduction.
123
- * This should be scoped to the cart, and is different from the preference saved for each buyer, which should only act as the default
124
- */
125
- noSSN: boolean | null;
126
117
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mts-booking-library",
3
- "version": "2.4.7",
3
+ "version": "2.4.9",
4
4
  "description": "Library for using MyTicketSolution Booking API",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",