@pisell/private-materials 6.8.23 → 6.8.24

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.
@@ -680,9 +680,10 @@ var Footer = function Footer(props) {
680
680
  setCheckoutLoading(false);
681
681
  setPaymentCallback(function () {
682
682
  return function (paymentResult) {
683
+ var _paymentResult$respon;
683
684
  console.log('Payment result:', paymentResult);
684
685
  setIsPaymentModalOpen(false);
685
- if ((paymentResult === null || paymentResult === void 0 ? void 0 : paymentResult.status) === 'success') {
686
+ if ((paymentResult === null || paymentResult === void 0 ? void 0 : paymentResult.status) === 'success' || (paymentResult === null || paymentResult === void 0 || (_paymentResult$respon = paymentResult.response) === null || _paymentResult$respon === void 0 || (_paymentResult$respon = _paymentResult$respon.data) === null || _paymentResult$respon === void 0 ? void 0 : _paymentResult$respon.payment_status) === 'paid') {
686
687
  var _window5;
687
688
  console.log('Payment completed successfully');
688
689
  (_window5 = window) === null || _window5 === void 0 || (_window5 = _window5.shopApi) === null || _window5 === void 0 || (_window5 = _window5.bookingTicket) === null || _window5 === void 0 || _window5.clearAllCart();
@@ -500,18 +500,18 @@ var Footer = (props) => {
500
500
  setIsPaymentModalOpen(true);
501
501
  setCheckoutLoading(false);
502
502
  setPaymentCallback(() => (paymentResult) => {
503
- var _a3, _b3, _c3, _d2, _e2, _f2;
503
+ var _a3, _b3, _c3, _d2, _e2, _f2, _g2, _h2;
504
504
  console.log("Payment result:", paymentResult);
505
505
  setIsPaymentModalOpen(false);
506
- if ((paymentResult == null ? void 0 : paymentResult.status) === "success") {
506
+ if ((paymentResult == null ? void 0 : paymentResult.status) === "success" || ((_b3 = (_a3 = paymentResult == null ? void 0 : paymentResult.response) == null ? void 0 : _a3.data) == null ? void 0 : _b3.payment_status) === "paid") {
507
507
  console.log("Payment completed successfully");
508
- (_b3 = (_a3 = window == null ? void 0 : window.shopApi) == null ? void 0 : _a3.bookingTicket) == null ? void 0 : _b3.clearAllCart();
508
+ (_d2 = (_c3 = window == null ? void 0 : window.shopApi) == null ? void 0 : _c3.bookingTicket) == null ? void 0 : _d2.clearAllCart();
509
509
  setPaymentModalData(null);
510
510
  setPaymentCallback(null);
511
511
  } else if ((paymentResult == null ? void 0 : paymentResult.status) === "cancelled") {
512
512
  console.log("Payment cancelled");
513
513
  if (res == null ? void 0 : res.order_id) {
514
- (_d2 = (_c3 = window == null ? void 0 : window.shopApi) == null ? void 0 : _c3.booking) == null ? void 0 : _d2.voidBooking(res.order_id);
514
+ (_f2 = (_e2 = window == null ? void 0 : window.shopApi) == null ? void 0 : _e2.booking) == null ? void 0 : _f2.voidBooking(res.order_id);
515
515
  }
516
516
  setPaymentModalData(null);
517
517
  setPaymentCallback(null);
@@ -519,7 +519,7 @@ var Footer = (props) => {
519
519
  console.log("Payment status:", paymentResult == null ? void 0 : paymentResult.status);
520
520
  setPaymentModalData(null);
521
521
  setPaymentCallback(null);
522
- (_f2 = (_e2 = window == null ? void 0 : window.shopApi) == null ? void 0 : _e2.bookingTicket) == null ? void 0 : _f2.clearAllCart();
522
+ (_h2 = (_g2 = window == null ? void 0 : window.shopApi) == null ? void 0 : _g2.bookingTicket) == null ? void 0 : _h2.clearAllCart();
523
523
  }
524
524
  });
525
525
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/private-materials",
3
- "version": "6.8.23",
3
+ "version": "6.8.24",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -76,10 +76,10 @@
76
76
  "react-infinite-scroll-component": "^6.1.0",
77
77
  "react-resizable": "^3.0.5",
78
78
  "styled-components": "^6.0.0-rc.3",
79
- "@pisell/icon": "0.0.11",
80
- "@pisell/utils": "3.0.2",
81
79
  "@pisell/date-picker": "3.0.7",
82
- "@pisell/materials": "6.8.6"
80
+ "@pisell/icon": "0.0.11",
81
+ "@pisell/materials": "6.8.6",
82
+ "@pisell/utils": "3.0.2"
83
83
  },
84
84
  "peerDependencies": {
85
85
  "react": "^18.0.0",