@hmcts/ccpay-web-component 6.0.0-beta14 → 6.0.0-beta17

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.
@@ -1,5 +1,4 @@
1
1
  import { _throw } from 'rxjs/observable/throw';
2
- import { v4 } from 'uuid';
3
2
  import { BehaviorSubject } from 'rxjs';
4
3
  import { HttpClient, HttpHeaders, HttpClientModule } from '@angular/common/http';
5
4
  import { catchError } from 'rxjs/operators';
@@ -1100,7 +1099,9 @@ var PaymentViewService = /** @class */ (function () {
1100
1099
  function (serviceRef, body) {
1101
1100
  /** @type {?} */
1102
1101
  var url = this.paymentLibService.API_ROOT + "/service-request/" + serviceRef + "/card-payments";
1103
- body['return-url'] = this.paymentLibService.CARDPAYMENTRETURNURL + "/payment";
1102
+ /** @type {?} */
1103
+ var rurl = this.paymentLibService.CARDPAYMENTRETURNURL.replace('.prod', '');
1104
+ body['return-url'] = rurl + "/payment";
1104
1105
  return this.https.post(url, body).pipe(catchError(this.errorHandlerService.handleError));
1105
1106
  };
1106
1107
  /**
@@ -1114,7 +1115,9 @@ var PaymentViewService = /** @class */ (function () {
1114
1115
  * @return {?}
1115
1116
  */
1116
1117
  function (serviceRef, body) {
1117
- body['idempotency_key'] = v4();
1118
+ /** @type {?} */
1119
+ var randomKey = 'idam-key-' + Math.random().toString().split('.').join('-');
1120
+ body['idempotency_key'] = randomKey;
1118
1121
  /** @type {?} */
1119
1122
  var url = this.paymentLibService.API_ROOT + "/service-request/" + serviceRef + "/pba-payments";
1120
1123
  return this.https.post(url, body);
@@ -3480,17 +3483,13 @@ var CaseTransactionsComponent = /** @class */ (function () {
3480
3483
  }
3481
3484
  }));
3482
3485
  }
3483
- _this.orderPendingPayments = (_this.orderFeesTotal - _this.orderRemissionTotal) - _this.orderTotalPayments;
3484
- if (_this.orderPendingPayments <= 0.00) {
3485
- _this.orderStatus = 'Paid';
3486
+ // this.orderPendingPayments = (this.orderFeesTotal - this.orderRemissionTotal) - this.orderTotalPayments;
3487
+ if (paymentGroup.service_request_status === 'Paid') {
3488
+ _this.orderStatus = paymentGroup.service_request_status;
3486
3489
  _this.orderAddBtnEnable = false;
3487
3490
  }
3488
- else if (_this.orderFeesTotal > 0 && (_this.orderTotalPayments > 0 || _this.orderRemissionTotal > 0) && (_this.orderTotalPayments < _this.orderPendingPayments)) {
3489
- _this.orderStatus = 'Partially paid';
3490
- _this.orderAddBtnEnable = true;
3491
- }
3492
- else {
3493
- _this.orderStatus = 'Not paid';
3491
+ else if (paymentGroup.service_request_status === 'Partially paid' || paymentGroup.service_request_status === 'Not paid') {
3492
+ _this.orderStatus = paymentGroup.service_request_status;
3494
3493
  _this.orderAddBtnEnable = true;
3495
3494
  }
3496
3495
  //this.orderLevelFees.push({orderRefId:paymentGroup['payment_group_reference'],orderTotalFees: this.orderFeesTotal,orderStatus: this.orderStatus,orderParty:'Santosh', orderCCDEvent:'Case Creation',orderCreated: new Date(), orderAddBtnEnable: this.orderAddBtnEnable}); this.cpoDetails['createdTimestamp']
@@ -3580,18 +3579,17 @@ var CaseTransactionsComponent = /** @class */ (function () {
3580
3579
  }));
3581
3580
  }
3582
3581
  }
3582
+ _this.orderStatus = orderDetail.service_request_status;
3583
3583
  }));
3584
- this.orderPendingPayments = (this.orderFeesTotal - this.orderRemissionTotal) - this.orderTotalPayments;
3584
+ //this.orderPendingPayments = (this.orderFeesTotal - this.orderRemissionTotal) - this.orderTotalPayments;
3585
3585
  // this.orderRef = orderReferenceObj.orderRefId;
3586
- if (this.orderPendingPayments <= 0.00) {
3587
- this.orderStatus = 'Paid';
3588
- }
3589
- else if (this.orderFeesTotal > 0 && (this.orderTotalPayments > 0 || this.orderRemissionTotal > 0) && (this.orderTotalPayments < this.orderPendingPayments)) {
3590
- this.orderStatus = 'Partially paid';
3591
- }
3592
- else {
3593
- this.orderStatus = 'Not paid';
3594
- }
3586
+ // if (this.orderPendingPayments <= 0.00) {
3587
+ // this.orderStatus = 'Paid';
3588
+ // } else if (this.orderFeesTotal > 0 && (this.orderTotalPayments > 0 || this.orderRemissionTotal > 0) && (this.orderTotalPayments < this.orderPendingPayments)) {
3589
+ // this.orderStatus = 'Partially paid'
3590
+ // } else {
3591
+ // this.orderStatus = 'Not paid'
3592
+ // }
3595
3593
  if (this.cpoDetails !== null) {
3596
3594
  this.orderParty = this.cpoDetails['responsibleParty'];
3597
3595
  this.orderCreated = this.cpoDetails['createdTimestamp'];
@@ -9620,7 +9618,12 @@ var PbaPaymentComponent = /** @class */ (function () {
9620
9618
  * @return {?}
9621
9619
  */
9622
9620
  function (r) {
9623
- _this.pbaAccountrPaymentResult = JSON.parse(r).data;
9621
+ try {
9622
+ _this.pbaAccountrPaymentResult = JSON.parse(r);
9623
+ }
9624
+ catch (e) {
9625
+ _this.pbaAccountrPaymentResult = r;
9626
+ }
9624
9627
  _this.isPBAAccountPaymentSuccess = true;
9625
9628
  }), (/**
9626
9629
  * @param {?} e