Merge pull request 'srinath' (#313) from srinath into main
Reviewed-on: Pozomind/pozo-retail-app#313
This commit is contained in:
commit
286fefede5
|
|
@ -1416,6 +1416,13 @@ export const getOtherServiceTicket = createAsyncThunk(
|
|||
}
|
||||
}
|
||||
);
|
||||
// post /cancelPayment
|
||||
export const PostCancelPayment = createAsyncThunk(
|
||||
'BookingData/cancelPayment',
|
||||
async (postData) => {
|
||||
return await axiosRetailInstanceData.post(`/cancelPayment`, postData);
|
||||
}
|
||||
);
|
||||
export const PostBlockSlots = createAsyncThunk(
|
||||
'BookingData/PostBlockSlots',
|
||||
async (postData) => {
|
||||
|
|
@ -1444,6 +1451,7 @@ export const getPaymentStatusForBusinessUPI = createAsyncThunk(
|
|||
}
|
||||
);
|
||||
|
||||
|
||||
export const getCurrentOrderid = createAsyncThunk(
|
||||
'BookingData/getcurrentorderid',
|
||||
|
||||
|
|
|
|||
|
|
@ -127,6 +127,7 @@ import {
|
|||
changeSearchedData,
|
||||
GlobalSelectedCustDisable,
|
||||
GlobalOrderStatus,
|
||||
PostCancelPayment,
|
||||
} from '../../../../../Features/BookingScreen/BookingData/BookingData';
|
||||
import FeaturesFunctionalities from '../../BookingFunctionality/FeaturesFunctionalities';
|
||||
import {
|
||||
|
|
@ -1392,6 +1393,15 @@ export default function BST1Payment() {
|
|||
: AddBookingDetails(BookingType, true);
|
||||
}
|
||||
};
|
||||
// PostCancelPayment
|
||||
const CancelPayment = async () => {
|
||||
const response = await dispatch(PostCancelPayment({OrderId: businessUPIOrderId})).unwrap()
|
||||
if (response?.data?.statusCode) {
|
||||
ClearAllGlobalStateDatas();
|
||||
CustomerDisplay();
|
||||
setBusinessUPI(false);
|
||||
}
|
||||
}
|
||||
const financialYearError = async () => {
|
||||
setMessageType('error');
|
||||
setMessageData('Financial Year-Based Sales Not Yet Started');
|
||||
|
|
@ -4728,6 +4738,7 @@ export default function BST1Payment() {
|
|||
handleCancel={() => setShowCancelConfirm(true)}
|
||||
footer={false}
|
||||
width={500}
|
||||
destroyOnClose={true}
|
||||
children={
|
||||
<>
|
||||
<PaymentGatewayEmbedded
|
||||
|
|
@ -4744,14 +4755,27 @@ export default function BST1Payment() {
|
|||
}
|
||||
/>
|
||||
{showCancelConfirm && (
|
||||
// <Modal
|
||||
// open={showCancelConfirm}
|
||||
// title="Cancel Payment"
|
||||
// onOk={() => {
|
||||
// setBusinessUPI(false);
|
||||
// setShowCancelConfirm(false);
|
||||
// ClearAllGlobalStateDatas();
|
||||
// CustomerDisplay();
|
||||
// }}
|
||||
// onCancel={() => setShowCancelConfirm(false)}
|
||||
// okText="Yes"
|
||||
// cancelText="No"
|
||||
// >
|
||||
// Do you want to cancel the payment?
|
||||
// </Modal>
|
||||
<Modal
|
||||
open={showCancelConfirm}
|
||||
title="Cancel Payment"
|
||||
onOk={() => {
|
||||
setBusinessUPI(false);
|
||||
setShowCancelConfirm(false);
|
||||
ClearAllGlobalStateDatas();
|
||||
CustomerDisplay();
|
||||
CancelPayment()
|
||||
}}
|
||||
onCancel={() => setShowCancelConfirm(false)}
|
||||
okText="Yes"
|
||||
|
|
|
|||
|
|
@ -141,6 +141,7 @@ import {
|
|||
changePreviousOrderOfferDetail,
|
||||
GlobalAllBookingType,
|
||||
changeSearchedData,
|
||||
PostCancelPayment,
|
||||
} from '../../../../../Features/BookingScreen/BookingData/BookingData';
|
||||
import { PrintStyleFunction } from '../../../../paymentpdfPage/PrintStyleFunction.js';
|
||||
import FeaturesFunctionalities from '../../BookingFunctionality/FeaturesFunctionalities';
|
||||
|
|
@ -1574,7 +1575,15 @@ const BSBillingTable3Pay = () => {
|
|||
: AddBookingDetails(BookingType, true);
|
||||
}
|
||||
};
|
||||
|
||||
// PostCancelPayment
|
||||
const CancelPayment = async () => {
|
||||
const response = await dispatch(PostCancelPayment({OrderId: businessUPIOrderId})).unwrap()
|
||||
if (response?.data?.statusCode) {
|
||||
ClearAllGlobalStateDatas();
|
||||
CustomerDisplay();
|
||||
setBusinessUPI(false);
|
||||
}
|
||||
}
|
||||
const financialYearError = async () => {
|
||||
setMessageType('error');
|
||||
setMessageData('Financial Year-Based Sales Not Yet Started');
|
||||
|
|
@ -4919,6 +4928,7 @@ const BSBillingTable3Pay = () => {
|
|||
open={businessUPI}
|
||||
handleCancel={() => setShowCancelConfirm(true)}
|
||||
footer={false}
|
||||
destroyOnClose={true}
|
||||
width={500}
|
||||
children={
|
||||
<>
|
||||
|
|
@ -4936,14 +4946,27 @@ const BSBillingTable3Pay = () => {
|
|||
}
|
||||
/>
|
||||
{showCancelConfirm && (
|
||||
// <Modal
|
||||
// open={showCancelConfirm}
|
||||
// title="Cancel Payment"
|
||||
// onOk={() => {
|
||||
// setBusinessUPI(false);
|
||||
// setShowCancelConfirm(false);
|
||||
// ClearAllGlobalStateDatas();
|
||||
// CustomerDisplay();
|
||||
// }}
|
||||
// onCancel={() => setShowCancelConfirm(false)}
|
||||
// okText="Yes"
|
||||
// cancelText="No"
|
||||
// >
|
||||
// Do you want to cancel the payment?
|
||||
// </Modal>
|
||||
<Modal
|
||||
open={showCancelConfirm}
|
||||
title="Cancel Payment"
|
||||
onOk={() => {
|
||||
setBusinessUPI(false);
|
||||
setShowCancelConfirm(false);
|
||||
ClearAllGlobalStateDatas();
|
||||
CustomerDisplay();
|
||||
CancelPayment()
|
||||
}}
|
||||
onCancel={() => setShowCancelConfirm(false)}
|
||||
okText="Yes"
|
||||
|
|
|
|||
|
|
@ -109,6 +109,7 @@ import {
|
|||
GlobalUnpaidListData,
|
||||
PaymentGatewayGetdetail,
|
||||
PostBookingData,
|
||||
PostCancelPayment,
|
||||
PostPaymentdevice,
|
||||
PreferenceData,
|
||||
PutBookingData,
|
||||
|
|
@ -1214,6 +1215,15 @@ const StandardTablePayment = () => {
|
|||
}
|
||||
};
|
||||
|
||||
// PostCancelPayment
|
||||
const CancelPayment = async () => {
|
||||
const response = await dispatch(PostCancelPayment({OrderId: businessUPIOrderId})).unwrap()
|
||||
if (response?.data?.statusCode) {
|
||||
ClearAllGlobalStateDatas();
|
||||
CustomerDisplay();
|
||||
setBusinessUPI(false);
|
||||
}
|
||||
}
|
||||
const Otherserviceprint = async () => {
|
||||
if (OtherServicesPrintDetails?.length > 0) {
|
||||
const style = await PrintStyleFunction('OtherServices1');
|
||||
|
|
@ -4191,6 +4201,7 @@ const StandardTablePayment = () => {
|
|||
handleCancel={() => setShowCancelConfirm(true)}
|
||||
footer={false}
|
||||
width={600}
|
||||
destroyOnClose={true}
|
||||
className={'ModalPaymentGatewayEmbedded'}
|
||||
children={
|
||||
<>
|
||||
|
|
@ -4209,15 +4220,28 @@ const StandardTablePayment = () => {
|
|||
}
|
||||
/>
|
||||
{showCancelConfirm && (
|
||||
// <Modal
|
||||
// open={showCancelConfirm}
|
||||
// title="Cancel Payment"
|
||||
// onOk={() => {
|
||||
// paymentGatewayRef.current?.clearPolling();
|
||||
// setBusinessUPI(false);
|
||||
// setShowCancelConfirm(false);
|
||||
// ClearAllGlobalStateDatas();
|
||||
// CustomerDisplay();
|
||||
// }}
|
||||
// onCancel={() => setShowCancelConfirm(false)}
|
||||
// okText="Yes"
|
||||
// cancelText="No"
|
||||
// >
|
||||
// Do you want to cancel the payment?
|
||||
// </Modal>
|
||||
<Modal
|
||||
open={showCancelConfirm}
|
||||
title="Cancel Payment"
|
||||
onOk={() => {
|
||||
paymentGatewayRef.current?.clearPolling();
|
||||
setBusinessUPI(false);
|
||||
setShowCancelConfirm(false);
|
||||
ClearAllGlobalStateDatas();
|
||||
CustomerDisplay();
|
||||
CancelPayment()
|
||||
}}
|
||||
onCancel={() => setShowCancelConfirm(false)}
|
||||
okText="Yes"
|
||||
|
|
|
|||
|
|
@ -128,6 +128,7 @@ import {
|
|||
changePreviousOrderOfferDetail,
|
||||
GlobalPaymentTrigger,
|
||||
changeSearchedData,
|
||||
PostCancelPayment,
|
||||
} from '../../../../Features/BookingScreen/BookingData/BookingData';
|
||||
import { PrintStyleFunction } from '../../../paymentpdfPage/PrintStyleFunction.js';
|
||||
import {
|
||||
|
|
@ -1294,6 +1295,16 @@ const BSC1Payment = (props) => {
|
|||
}
|
||||
};
|
||||
|
||||
// PostCancelPayment
|
||||
const CancelPayment = async () => {
|
||||
const response = await dispatch(PostCancelPayment({OrderId: businessUPIOrderId})).unwrap()
|
||||
if (response?.data?.statusCode) {
|
||||
ClearAllGlobalStateDatas();
|
||||
CustomerDisplay();
|
||||
setBusinessUPI(false);
|
||||
}
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
const handleKeyPress = (event) => {
|
||||
if (event.key === 'F4' && isButtonActive() && !isF4Pressed.current) {
|
||||
|
|
@ -4993,6 +5004,7 @@ const BSC1Payment = (props) => {
|
|||
handleCancel={() => setShowCancelConfirm(true)}
|
||||
footer={false}
|
||||
width={500}
|
||||
destroyOnClose={true}
|
||||
children={
|
||||
<>
|
||||
<PaymentGatewayEmbedded
|
||||
|
|
@ -5009,14 +5021,27 @@ const BSC1Payment = (props) => {
|
|||
}
|
||||
/>
|
||||
{showCancelConfirm && (
|
||||
// <Modal
|
||||
// open={showCancelConfirm}
|
||||
// title="Cancel Payment"
|
||||
// onOk={() => {
|
||||
// setBusinessUPI(false);
|
||||
// setShowCancelConfirm(false);
|
||||
// ClearAllGlobalStateDatas();
|
||||
// CustomerDisplay();
|
||||
// }}
|
||||
// onCancel={() => setShowCancelConfirm(false)}
|
||||
// okText="Yes"
|
||||
// cancelText="No"
|
||||
// >
|
||||
// Do you want to cancel the payment?
|
||||
// </Modal>
|
||||
<Modal
|
||||
open={showCancelConfirm}
|
||||
title="Cancel Payment"
|
||||
onOk={() => {
|
||||
setBusinessUPI(false);
|
||||
setShowCancelConfirm(false);
|
||||
ClearAllGlobalStateDatas();
|
||||
CustomerDisplay();
|
||||
CancelPayment()
|
||||
}}
|
||||
onCancel={() => setShowCancelConfirm(false)}
|
||||
okText="Yes"
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { useEffect, useRef, useState, useImperativeHandle, forwardRef } from 'react';
|
||||
import { useDispatch } from 'react-redux';
|
||||
import { getPaymentStatusForBusinessUPI } from '../../../../Features/BookingScreen/BookingData/BookingData';
|
||||
import { getPaymentStatusForBusinessUPI, PostCancelPayment } from '../../../../Features/BookingScreen/BookingData/BookingData';
|
||||
|
||||
const PaymentGatewayEmbedded = forwardRef(({
|
||||
orderId,
|
||||
|
|
@ -65,6 +65,7 @@ const PaymentGatewayEmbedded = forwardRef(({
|
|||
|
||||
if (data.status === 'TIMEOUT') {
|
||||
// Stop polling and mark as timed out
|
||||
dispatch(PostCancelPayment({OrderId: orderId})).unwrap()
|
||||
setTimedOut(true);
|
||||
setShowTimeout(true);
|
||||
if (intervalRef.current) {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import React, { useCallback, useEffect, useState } from 'react';
|
||||
import { Popconfirm, Drawer, Badge } from 'antd';
|
||||
import { Popconfirm, Drawer, Badge, Modal } from 'antd';
|
||||
import { QuestionCircleOutlined } from '@ant-design/icons';
|
||||
import { useDispatch, useSelector } from 'react-redux';
|
||||
import { IoIosArrowForward } from 'react-icons/io';
|
||||
|
|
@ -43,7 +43,7 @@ import KioskPayment from '../Payment/KioskPaymentWithModal';
|
|||
import { ApplicationPreferences } from '../../../Features/BrachLogin/BranchLogin';
|
||||
import { FaAngleUp, FaCircleCheck } from 'react-icons/fa6';
|
||||
import { FaAngleDown } from 'react-icons/fa';
|
||||
import { PostBookingData } from '../../../Features/BookingScreen/BookingData/BookingData';
|
||||
import { PostBookingData, PostCancelPayment } from '../../../Features/BookingScreen/BookingData/BookingData';
|
||||
import {
|
||||
generateRandomKey,
|
||||
getSession,
|
||||
|
|
@ -129,6 +129,7 @@ const selfKioskFooter = (props) => {
|
|||
const [chairInformation, setChairInformation] = useState();
|
||||
const [TableINformation, setTableINformation] = useState();
|
||||
const [paymentUrl, setpaymentUrl] = useState(null);
|
||||
const [showCancelConfirm, setShowCancelConfirm] = useState(null);
|
||||
const [TransctionId, setTransctionId] = useState(null);
|
||||
const [paymentGatewayAccess, setPaymentGatewayAccess] = useState([]);
|
||||
// let chairInformation = getSession('table');
|
||||
|
|
@ -939,6 +940,15 @@ const selfKioskFooter = (props) => {
|
|||
setMessageType(null);
|
||||
}, []);
|
||||
|
||||
// PostCancelPayment
|
||||
const CancelPayment = async () => {
|
||||
const response = await dispatch(PostCancelPayment({OrderId: TransctionId})).unwrap()
|
||||
if (response?.data?.statusCode) {
|
||||
// setBusinessUPI(false);
|
||||
setpaymentUrl(null)
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Messages
|
||||
|
|
@ -1462,7 +1472,8 @@ const selfKioskFooter = (props) => {
|
|||
<button
|
||||
className="paymentclose-btn"
|
||||
onClick={() => {
|
||||
setpaymentUrl(null);
|
||||
// setpaymentUrl(null);
|
||||
setShowCancelConfirm(true);
|
||||
}}
|
||||
>
|
||||
✖
|
||||
|
|
@ -1476,6 +1487,21 @@ const selfKioskFooter = (props) => {
|
|||
></iframe>
|
||||
</div>
|
||||
)}
|
||||
{showCancelConfirm && (
|
||||
<Modal
|
||||
open={showCancelConfirm}
|
||||
title="Cancel Payment"
|
||||
onOk={() => {
|
||||
setShowCancelConfirm(false);
|
||||
CancelPayment()
|
||||
}}
|
||||
onCancel={() => setShowCancelConfirm(false)}
|
||||
okText="Yes"
|
||||
cancelText="No"
|
||||
>
|
||||
Do you want to cancel the payment?
|
||||
</Modal>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -61,6 +61,7 @@ import {
|
|||
import {
|
||||
getConfigType,
|
||||
getPreferenceData,
|
||||
PostCancelPayment,
|
||||
PreferenceData,
|
||||
PutPendingPaymentList,
|
||||
} from '../../../Features/BookingScreen/BookingData/BookingData';
|
||||
|
|
@ -1092,6 +1093,15 @@ const KioskPayment = (props) => {
|
|||
}, 2000);
|
||||
}
|
||||
};
|
||||
// PostCancelPayment
|
||||
const CancelPayment = async () => {
|
||||
const response = await dispatch(PostCancelPayment({OrderId: businessUPIOrderId})).unwrap()
|
||||
if (response?.data?.statusCode) {
|
||||
ClearAllGlobalStateDatas();
|
||||
CustomerDisplay();
|
||||
setBusinessUPI(false);
|
||||
}
|
||||
}
|
||||
|
||||
const handleDevice = async (paymentDetails, option) => {
|
||||
const paymentDeviceDetails = await dispatch(
|
||||
|
|
@ -2342,6 +2352,7 @@ const KioskPayment = (props) => {
|
|||
handleCancel={() => setShowCancelConfirm(true)}
|
||||
footer={false}
|
||||
width={500}
|
||||
destroyOnClose={true}
|
||||
children={
|
||||
<>
|
||||
<PaymentGatewayEmbedded
|
||||
|
|
@ -2359,14 +2370,27 @@ const KioskPayment = (props) => {
|
|||
}
|
||||
/>
|
||||
{showCancelConfirm && (
|
||||
// <Modal
|
||||
// open={showCancelConfirm}
|
||||
// title="Cancel Payment"
|
||||
// onOk={() => {
|
||||
// paymentGatewayRef.current?.clearPolling();
|
||||
// setBusinessUPI(false);
|
||||
// setShowCancelConfirm(false);
|
||||
// ClearAllGlobalStateDatas();
|
||||
// }}
|
||||
// onCancel={() => setShowCancelConfirm(false)}
|
||||
// okText="Yes"
|
||||
// cancelText="No"
|
||||
// >
|
||||
// Do you want to cancel the payment?
|
||||
// </Modal>
|
||||
<Modal
|
||||
open={showCancelConfirm}
|
||||
title="Cancel Payment"
|
||||
onOk={() => {
|
||||
paymentGatewayRef.current?.clearPolling();
|
||||
setBusinessUPI(false);
|
||||
setShowCancelConfirm(false);
|
||||
ClearAllGlobalStateDatas();
|
||||
CancelPayment()
|
||||
}}
|
||||
onCancel={() => setShowCancelConfirm(false)}
|
||||
okText="Yes"
|
||||
|
|
|
|||
Loading…
Reference in New Issue