Added Payment QR Code model Close Funtionalies

This commit is contained in:
Srinath 2026-03-26 11:38:21 +05:30
parent fea68be6fe
commit 719a84c01c
1 changed files with 39 additions and 15 deletions

View File

@ -61,6 +61,7 @@ import {
import { import {
getConfigType, getConfigType,
getPreferenceData, getPreferenceData,
PostCancelPayment,
PreferenceData, PreferenceData,
PutPendingPaymentList, PutPendingPaymentList,
} from '../../../Features/BookingScreen/BookingData/BookingData'; } from '../../../Features/BookingScreen/BookingData/BookingData';
@ -1092,6 +1093,15 @@ const KioskPayment = (props) => {
}, 2000); }, 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 handleDevice = async (paymentDetails, option) => {
const paymentDeviceDetails = await dispatch( const paymentDeviceDetails = await dispatch(
@ -2342,6 +2352,7 @@ const KioskPayment = (props) => {
handleCancel={() => setShowCancelConfirm(true)} handleCancel={() => setShowCancelConfirm(true)}
footer={false} footer={false}
width={500} width={500}
destroyOnClose={true}
children={ children={
<> <>
<PaymentGatewayEmbedded <PaymentGatewayEmbedded
@ -2359,14 +2370,27 @@ const KioskPayment = (props) => {
} }
/> />
{showCancelConfirm && ( {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 <Modal
open={showCancelConfirm} open={showCancelConfirm}
title="Cancel Payment" title="Cancel Payment"
onOk={() => { onOk={() => {
paymentGatewayRef.current?.clearPolling();
setBusinessUPI(false);
setShowCancelConfirm(false); setShowCancelConfirm(false);
ClearAllGlobalStateDatas(); CancelPayment()
}} }}
onCancel={() => setShowCancelConfirm(false)} onCancel={() => setShowCancelConfirm(false)}
okText="Yes" okText="Yes"