function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
var _excluded = ["customAction"];
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
import React, { useEffect, useRef, useState } from 'react';
import { locales } from '@pisell/utils';
import { PisellModal, PisellToast } from '@pisell/materials';
import useEngineContext from "../../../hooks/useEngineContext";
import { request } from "../../../utils";
import { updateNextStep, useContextData } from "../store";
import { PayStatus, StatusEnum } from "../const";
import { useStoreRef } from "../hooks";
import { usePayment } from "../aggregatePayment";
import payLog from "../utils/payLog";
import { EPaymentStatus } from "../aggregatePayment/types";
import { parseMX51Params } from "./utils";
import { CANCEL_ACTION_TIMEOUT, EButtonKeyType } from "./types";
import Action from "./Action";
import { useDispatch, updateStatus, updateCustom, updateState } from "../store";
import { useFail } from "../hooks";
import { getInitState } from "../manufacturer";
import { getPayParams } from "../helper";
/**
 * @title 是否需要使用 POS 打印收据
 * @param setting 设置
 */
var shouldPrintReceiptOnPos = function shouldPrintReceiptOnPos(setting) {
  // 兼容老数据，明确为false才表示使用POS打印
  if (typeof setting === 'boolean') {
    return setting === false;
  }
  // 数字0表示使用POS打印
  if (typeof setting === 'number') {
    return setting === 0;
  }
  // 兼容：字符串0表示使用POS打印
  if (typeof setting === 'string') {
    return setting === '0';
  }
  return false;
};
var AggregatePayment = function AggregatePayment(_ref) {
  var onChange = _ref.onChange;
  // 设置request
  var context = useEngineContext();
  var utils = context.appHelper.utils || {};
  request.setRequest(utils === null || utils === void 0 ? void 0 : utils.request);

  // 数据源
  var _useContextData = useContextData(),
    title = _useContextData.title,
    custom = _useContextData.custom,
    status = _useContextData.status,
    eftpos = _useContextData.eftpos,
    mode = _useContextData.mode,
    name = _useContextData.name,
    symbol = _useContextData.symbol,
    amount = _useContextData.amount,
    order_id = _useContextData.order_id;
  var _useStoreRef = useStoreRef(),
    statusRef = _useStoreRef.statusRef,
    numRef = _useStoreRef.numRef,
    netRef = _useStoreRef.netRef,
    modeRef = _useStoreRef.modeRef,
    deviceRef = _useStoreRef.deviceRef,
    orderIdRef = _useStoreRef.orderIdRef,
    amountRef = _useStoreRef.amountRef,
    payRef = _useStoreRef.payRef;
  var dispatch = useDispatch();
  var fail = useFail(0);
  var failRef = useRef(fail);
  var _useState = useState(false),
    _useState2 = _slicedToArray(_useState, 2),
    receiptModalShow = _useState2[0],
    setReceiptModalShow = _useState2[1];
  var _useState3 = useState(null),
    _useState4 = _slicedToArray(_useState3, 2),
    receiptModalData = _useState4[0],
    setReceiptModalData = _useState4[1];
  // 取消按钮点击后需要禁用
  var _useState5 = useState(false),
    _useState6 = _slicedToArray(_useState5, 2),
    cancelDisabled = _useState6[0],
    setCancelDisabled = _useState6[1];
  var clickLockedRef = useRef(false);
  var clickUnlockTimerRef = useRef(null);
  // 操作行为超时
  var actionTimeoutRef = useRef(null);
  var clearRef = useRef(null);
  useEffect(function () {
    failRef.current = fail;
  }, [fail]);

  // 当前组件数据
  var initRef = useRef(false);
  var unloadRef = useRef(false);

  /**
   * 更新到加载状态
   */
  var updateToLoading = function updateToLoading(title) {
    dispatch(updateStatus(StatusEnum.Loading));
    dispatch(updateState({
      title: title || locales.getText('page.eftpos-pay.text.loading')(modeRef.current)
    }));
  };
  var payment = usePayment({
    paymentCode: 'EFTPOS_MX51',
    paymentNum: numRef.current || '',
    shouldContinue: function shouldContinue() {
      return !(unloadRef.current || !netRef.current);
    },
    config: {
      hasQueryInterval: false,
      // 不开启轮询间隔
      globalQueryTimeout: 1000 * 60 * 2,
      // 全局轮询超时时间2分钟
      requestDelaySeconds: 130 // 接口兜底查询时间130秒
    },
    callback: function callback(_instance, response) {
      var _data$data;
      console.log('callback  =>>>>>> ', response);
      var _ref2 = response || {},
        status = _ref2.status,
        data = _ref2.data;
      var _ref3 = (data === null || data === void 0 || (_data$data = data.data) === null || _data$data === void 0 ? void 0 : _data$data.external_unified_response) || {},
        transaction = _ref3.transaction,
        action = _ref3.action;
      var transformedData = parseMX51Params(transaction, status, data);
      console.log('event_transformedData =>>>>>> ', transformedData);
      dispatch(updateCustom({
        customAction: transformedData
      }));
      // 是否需要清除操作行为超时定时器：非loading态都需要清除
      var needClearActionTimeout = true;
      if (status === EPaymentStatus.Processing) {
        if (action === 'signature') {
          var _transformedData$auto;
          // 签名，需要停止轮询
          dispatch(updateStatus(StatusEnum.Question));
          // 更新标题
          dispatch(updateState({
            title: (transformedData === null || transformedData === void 0 ? void 0 : transformedData.message) || ''
          }));
          _instance.stop();
          // 如果存在签名票自动打印，需要触发打印
          if (transformedData !== null && transformedData !== void 0 && (_transformedData$auto = transformedData.autoAction) !== null && _transformedData$auto !== void 0 && _transformedData$auto.includes('PRINT_MERCHANT_RECEIPT')) {
            var merchantReceipt = (transformedData === null || transformedData === void 0 ? void 0 : transformedData.merchantReceipt) || '';
            onChange('print', merchantReceipt ? [merchantReceipt] : []);
          }
        } else {
          needClearActionTimeout = false;
          updateToLoading();
        }
      } else if (status === EPaymentStatus.Success) {
        handleSuccess(data);
      } else if (status === EPaymentStatus.Failed) {
        // 失败分为两种情况：MX51返回失败信息 和 后端返回失败信息
        if (transformedData) {
          // 渲染需要走自定义
          dispatch(updateStatus('fail'));
          dispatch(updateState({
            title: (transformedData === null || transformedData === void 0 ? void 0 : transformedData.message) || ''
          }));
        } else {
          handleFail(data);
        }
      }
      if (needClearActionTimeout) {
        if (actionTimeoutRef.current) {
          payLog.log('清除操作行为超时定时器');
          clearTimeout(actionTimeoutRef.current);
          actionTimeoutRef.current = null;
        }
      }
    }
  });

  // 页面初始化处理
  useEffect(function () {
    // 支付检测
    console.log('mx51页面初始化', statusRef.current);
    if (statusRef.current === StatusEnum.Success || statusRef.current === StatusEnum.Fail || statusRef.current === StatusEnum.Question) {
      return;
    }
    if (initRef.current) {
      return;
    }
    initRef.current = true;

    // 存在支付流水号
    if (numRef.current) {
      console.log('payment.query');
      payment.query();
      return;
    }
    payment.run();
  }, []);

  // 页面卸载处理
  useEffect(function () {
    return function () {
      console.log('页面卸载');
      unloadRef.current = true;
      // 清除操作行为超时定时器
      if (actionTimeoutRef.current) {
        clearTimeout(actionTimeoutRef.current);
        actionTimeoutRef.current = null;
      }
      if (clearRef.current) {
        clearTimeout(clearRef.current);
        clearRef.current = null;
      }
      if (clickUnlockTimerRef.current) {
        clearTimeout(clickUnlockTimerRef.current);
        clickUnlockTimerRef.current = null;
      }
    };
  }, []);

  /**
   * 触发支付失败流程：交由 useFail 统一处理失败/重试逻辑
   */
  var handleFail = function handleFail(errorData) {
    var _errorData$data, _failRef$current;
    var _ref4 = (errorData === null || errorData === void 0 || (_errorData$data = errorData.data) === null || _errorData$data === void 0 ? void 0 : _errorData$data.external_unified_response) || {},
      message = _ref4.message,
      response_code = _ref4.response_code;
    var _code = "".concat(response_code || '') || PayStatus.PaymentFailed;
    var _message = message || (errorData === null || errorData === void 0 ? void 0 : errorData.message) || '';
    console.log('handleFail =>>>> ', errorData, _code, _message);
    (_failRef$current = failRef.current) === null || _failRef$current === void 0 || _failRef$current.call(failRef, {
      code: _code,
      message: _message
    }, true);
  };

  /**
   * 处理支付成功流程
   * 1. 判定设置中是否需要打印商户收据和客户收据，如果需要则自动打印
   * 2. 展示success页面，构建成功参数，并在1秒触发成功回调
   */
  var handleSuccess = function handleSuccess(res) {
    var _res$data, _deviceRef$current;
    var receipt = [];
    var _ref5 = (res === null || res === void 0 || (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.external_unified_response) || {},
      transaction = _ref5.transaction,
      external_service_fee = _ref5.external_service_fee;
    var _ref6 = transaction || {},
      merchant_receipt = _ref6.merchant_receipt,
      customer_receipt = _ref6.customer_receipt;
    // 刷卡机的手续费
    var card_reader_surcharge = external_service_fee || 0;
    var deviceSetting = (_deviceRef$current = deviceRef.current) === null || _deviceRef$current === void 0 ? void 0 : _deviceRef$current.setting;
    // 商家小票是否需要使用 POS 打印
    var shouldPrintMerchantReceiptOnPos = shouldPrintReceiptOnPos(deviceSetting === null || deviceSetting === void 0 ? void 0 : deviceSetting.print_merchant_receipt);
    // 客户小票是否需要使用 POS 打印
    var shouldPrintCustomerReceiptOnPos = shouldPrintReceiptOnPos(deviceSetting === null || deviceSetting === void 0 ? void 0 : deviceSetting.prompt_customer_receipt);
    if (shouldPrintMerchantReceiptOnPos && merchant_receipt) {
      receipt.push(merchant_receipt);
    }
    if (shouldPrintCustomerReceiptOnPos && customer_receipt) {
      receipt.push(customer_receipt);
    }
    dispatch(updateNextStep());
    dispatch(updateCustom({
      card_reader_surcharge: card_reader_surcharge,
      receipt: receipt
    }));

    // 更新支付状态与文案
    dispatch(updateState({
      status: 'success',
      title: locales.getText('page.eftpos-pay.text.successful')(modeRef.current)
    }));
    clearRef.current = setTimeout(function () {
      var params = getPayParams({
        mode: modeRef.current,
        amount: amountRef.current,
        order_id: orderIdRef.current,
        number: numRef.current,
        device: deviceRef.current,
        pay: payRef.current,
        custom: {
          card_reader_surcharge: card_reader_surcharge,
          receipt: receipt
        }
      }, 'success');
      onChange('success', _objectSpread(_objectSpread({}, params), {}, {
        receipt: receipt
      }));
    }, 1000);
  };

  // 取消支付
  var onCancel = function onCancel(element) {
    console.log('onCancel', element);
    setCancelDisabled(true);
    payment.action({
      submit_url: element === null || element === void 0 ? void 0 : element.submitUrl
    });
    // 取消操作超时后自动停止，并构建Timeout失败
    actionTimeoutRef.current = setTimeout(function () {
      var _payment$_instance, _payment$_instance$st, _failRef$current2;
      payLog.log('取消操作超时，前往标记支付');
      payment === null || payment === void 0 || (_payment$_instance = payment._instance) === null || _payment$_instance === void 0 || (_payment$_instance$st = _payment$_instance.stop) === null || _payment$_instance$st === void 0 || _payment$_instance$st.call(_payment$_instance);
      // 构建Timeout失败，允许标记状态
      (_failRef$current2 = failRef.current) === null || _failRef$current2 === void 0 || _failRef$current2.call(failRef, {
        code: PayStatus.Timeout
      }, true);
    }, CANCEL_ACTION_TIMEOUT);
  };

  // 拒绝签名
  var onDecline = function onDecline(element) {
    payment.action({
      submit_url: element === null || element === void 0 ? void 0 : element.submitUrl
    });
  };

  // 接受签名
  var onAccept = function onAccept(element) {
    payment.action({
      submit_url: element === null || element === void 0 ? void 0 : element.submitUrl
    });
  };

  // 打印商户收据
  var onPrintMerchantReceipt = function onPrintMerchantReceipt(element) {
    onChange('print', element !== null && element !== void 0 && element.receipt ? [element === null || element === void 0 ? void 0 : element.receipt] : []);
    setReceiptModalShow(true);
    setReceiptModalData(element === null || element === void 0 ? void 0 : element.receipt);
  };

  // 打印客户收据
  var onPrintCustomerReceipt = function onPrintCustomerReceipt(element) {
    onChange('print', element !== null && element !== void 0 && element.receipt ? [element === null || element === void 0 ? void 0 : element.receipt] : []);
    setReceiptModalShow(true);
    setReceiptModalData(element === null || element === void 0 ? void 0 : element.receipt);
  };

  // 重试交易
  var onRetry = function onRetry(element) {
    onChange('page', 'pay');
    var _ref7 = custom || {},
      customAction = _ref7.customAction,
      restCustom = _objectWithoutProperties(_ref7, _excluded);
    var _params = _objectSpread(_objectSpread({}, restCustom), {}, {
      // 自定义参数需要重新传递
      mode: mode,
      name: name,
      symbol: symbol,
      amount: amount,
      order_id: order_id,
      number: ''
    });
    dispatch(updateState(getInitState(eftpos, _params)));
  };

  // 交易完成
  var onTransactionComplete = function onTransactionComplete(element) {
    var _ref8 = element._extra || {},
      paymentStatus = _ref8.paymentStatus,
      response = _ref8.response,
      merchantReceipt = _ref8.merchantReceipt,
      customerReceipt = _ref8.customerReceipt;
    if (paymentStatus === EPaymentStatus.Success) {
      var _response$data, _deviceRef$current2;
      var receipt = [];
      // 刷卡机的手续费
      var card_reader_surcharge = (response === null || response === void 0 || (_response$data = response.data) === null || _response$data === void 0 || (_response$data = _response$data.external_unified_response) === null || _response$data === void 0 ? void 0 : _response$data.external_service_fee) || 0;
      var deviceSetting = (_deviceRef$current2 = deviceRef.current) === null || _deviceRef$current2 === void 0 ? void 0 : _deviceRef$current2.setting;
      // 商家小票是否需要使用 POS 打印
      var shouldPrintMerchantReceiptOnPos = shouldPrintReceiptOnPos(deviceSetting === null || deviceSetting === void 0 ? void 0 : deviceSetting.print_merchant_receipt);
      // 客户小票是否需要使用 POS 打印
      var shouldPrintCustomerReceiptOnPos = shouldPrintReceiptOnPos(deviceSetting === null || deviceSetting === void 0 ? void 0 : deviceSetting.prompt_customer_receipt);
      if (shouldPrintMerchantReceiptOnPos && merchantReceipt) {
        receipt.push(merchantReceipt);
      }
      if (shouldPrintCustomerReceiptOnPos && customerReceipt) {
        receipt.push(customerReceipt);
      }
      var _params2 = getPayParams({
        mode: modeRef.current,
        amount: amountRef.current,
        order_id: orderIdRef.current,
        number: numRef.current,
        device: deviceRef.current,
        pay: payRef.current,
        custom: {
          card_reader_surcharge: card_reader_surcharge,
          receipt: receipt
        }
      }, 'success');
      onChange('success', _objectSpread(_objectSpread({}, _params2), {}, {
        receipt: receipt
      }));
    } else {
      onChange('fail', {
        order_id: orderIdRef.current,
        number: numRef.current,
        uniquePaymentNumber: numRef.current,
        device: deviceRef.current
      });
    }
  };

  // 提交到API
  var onSubmitToAPI = function onSubmitToAPI(element, extra) {
    var inputValues = (extra === null || extra === void 0 ? void 0 : extra.inputValues) || {};
    payment.action({
      submit_url: element === null || element === void 0 ? void 0 : element.submitUrl,
      payload: _objectSpread({}, inputValues)
    }, {
      needResponse: true
    });
  };
  var onNormalClick = function onNormalClick(element, config) {
    // 如果存在submit_url，则提交到API
    if (element !== null && element !== void 0 && element.submitUrl) {
      console.log('onNormalClick_submit_url', element === null || element === void 0 ? void 0 : element.submitUrl);
      payment.action({
        submit_url: element === null || element === void 0 ? void 0 : element.submitUrl
      }, config);
    } else {
      console.log('onNormalClick_no_submit_url', element);
    }
  };
  var shouldLockElementClick = function shouldLockElementClick(element) {
    var lockKeys = [EButtonKeyType.DeclineSignature, EButtonKeyType.ApproveSignature, EButtonKeyType.RetryTransaction, EButtonKeyType.SubmitToAPI, EButtonKeyType.CallTestFunction];
    return lockKeys.includes(element.key);
  };
  var lockElementClick = function lockElementClick() {
    clickLockedRef.current = true;
    clickUnlockTimerRef.current = setTimeout(function () {
      clickLockedRef.current = false;
      clickUnlockTimerRef.current = null;
    }, 1000);
  };

  // 点击元素
  var onElementClick = function onElementClick(element, extra) {
    if (shouldLockElementClick(element)) {
      if (clickLockedRef.current) {
        payLog.log("\u5FFD\u7565\u91CD\u590D\u70B9\u51FB".concat((element === null || element === void 0 ? void 0 : element.key) || '未知', "\u6309\u94AE"));
        return;
      }
      // 锁定点击
      lockElementClick();
      // 清除action data
      dispatch(updateCustom({
        customAction: {}
      }));
      // 更新为加载状态
      updateToLoading();
    }
    console.log('onElementClick', element, extra);
    payLog.log("\u70B9\u51FB".concat((element === null || element === void 0 ? void 0 : element.key) || '未知', "\u6309\u94AE"));
    switch (element.key) {
      case EButtonKeyType.CancelTransaction:
        onCancel(element);
        break;
      case EButtonKeyType.DeclineSignature:
        onDecline(element);
        break;
      case EButtonKeyType.ApproveSignature:
        onAccept(element);
        break;
      case EButtonKeyType.PrintMerchantReceipt:
        onPrintMerchantReceipt(element);
        break;
      case EButtonKeyType.PrintCustomerReceipt:
        onPrintCustomerReceipt(element);
        break;
      case EButtonKeyType.RetryTransaction:
        onRetry(element);
        break;
      case EButtonKeyType.TransactionComplete:
        onTransactionComplete(element);
        break;
      case EButtonKeyType.SubmitToAPI:
        // MX51审核，需要返回结果
        onSubmitToAPI(element, extra);
        break;
      case EButtonKeyType.CallTestFunction:
        // MX51审核，需要直接弹一个toast
        PisellToast({
          content: 'Test'
        });
        break;
      default:
        onNormalClick(element);
        break;
    }
  };
  var onCloseReceiptModal = function onCloseReceiptModal() {
    setReceiptModalShow(false);
    setReceiptModalData(null);
  };
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
    className: "pisell-lowcode__eft-pay-body"
  }, status === StatusEnum.Question ? /*#__PURE__*/React.createElement("div", {
    className: "pisell-lowcode__eft-pay-title",
    style: {
      textAlign: 'center'
    }
  }, title) : null, status !== StatusEnum.Success ? /*#__PURE__*/React.createElement(Action, {
    data: custom === null || custom === void 0 ? void 0 : custom.customAction,
    onClick: onElementClick,
    cancelDisabled: cancelDisabled,
    isLoading: status === StatusEnum.Loading
  }) : null), receiptModalShow ? /*#__PURE__*/React.createElement(PisellModal, {
    open: receiptModalShow,
    onCancel: onCloseReceiptModal,
    maskClosable: true,
    footer: null
  }, /*#__PURE__*/React.createElement("div", {
    style: {
      padding: '16px',
      display: 'flex',
      alignItems: 'center',
      justifyContent: 'center'
    }
  }, /*#__PURE__*/React.createElement("span", {
    style: {
      display: 'inline-block',
      whiteSpace: 'pre-wrap',
      fontFamily: 'monospace',
      backgroundColor: '#fff'
    }
  }, receiptModalData))) : null);
};
export default AggregatePayment;