mts-booking-library 1.2.12 → 1.2.13

Sign up to get free protection for your applications and to get access to all the features.
@@ -286,13 +286,13 @@ var Booking = /** @class */ (function () {
286
286
  paymentMethodToSet = paymentMethod;
287
287
  if (!(paymentMethod === Payment_1.PaymentMethods.ZERO_COST)) return [3 /*break*/, 2];
288
288
  return [4 /*yield*/, this.addReduction({ tripId: 0, reduction: 1, isPercentage: true }).then(function (response) {
289
+ if (typeof response === "boolean" && response) {
290
+ // Reduction was successfully added. Set payment method to CASH
291
+ paymentMethodToSet = Payment_1.PaymentMethods.CASH;
292
+ }
289
293
  if ((0, ErrorResponse_1.objectIsMTSErrorResponse)(response)) {
290
294
  return response;
291
295
  }
292
- else {
293
- // Request was successful. Set payment method to CASH
294
- paymentMethodToSet = Payment_1.PaymentMethods.CASH;
295
- }
296
296
  })];
297
297
  case 1:
298
298
  _e.sent();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mts-booking-library",
3
- "version": "1.2.12",
3
+ "version": "1.2.13",
4
4
  "description": "Library for use MyTicketSolution Booking API",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",