TP-65692 | Payment Link fix (#959)

This commit is contained in:
Mantri Ramkishor
2024-09-30 18:21:40 +05:30
committed by GitHub
3 changed files with 35 additions and 6 deletions

View File

@@ -134,8 +134,8 @@ def reactNativeArchitectures() {
return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"]
}
def VERSION_CODE = 198
def VERSION_NAME = "2.13.10"
def VERSION_CODE = 199
def VERSION_NAME = "2.13.11"
android {
ndkVersion rootProject.ext.ndkVersion

View File

@@ -1,7 +1,7 @@
{
"name": "AV_APP",
"version": "2.13.10",
"buildNumber": "198",
"version": "2.13.11",
"buildNumber": "199",
"private": true,
"scripts": {
"android:dev": "yarn move:dev && react-native run-android",

View File

@@ -7,7 +7,11 @@ import TextInput, { TextInputMaskType } from '../../../RN-UI-LIB/src/components/
import { GenericStyles } from '../../../RN-UI-LIB/src/styles';
import { COLORS } from '../../../RN-UI-LIB/src/styles/colors';
import { formatAmount } from '../../../RN-UI-LIB/src/utlis/amount';
import { PaymentType, generatePaymentLinkAction } from '../../action/paymentActions';
import {
PaymentType,
generatePaymentLinkAction,
getForeclosureAmount,
} from '../../action/paymentActions';
import { CLICKSTREAM_EVENT_NAMES } from '../../common/Constants';
import {
copyToClipboard,
@@ -28,6 +32,9 @@ import { ITelephoneNumbers } from '@reducers/telephoneNumbersSlice';
import PressableChip from '@rn-ui-lib/components/PressableChip';
import { PAYMENT_LINK_CHANNELS } from './Constants';
import { getCommunicationChannelType } from './utils';
import { dateFormat } from '@rn-ui-lib/utils/dates';
import { IForeclosureBreakup } from './ForeclosureBreakupAccordion';
import { DEFAULT_FORECLOSURE_BREAKUP } from './Foreclosure';
interface IOnlinePayment {
caseId: string;
@@ -63,6 +70,20 @@ const OnlinePayment: React.FC<IOnlinePayment> = ({
const [showQrCodeModal, setShowQrCodeModal] = React.useState<boolean>(false);
const [paymentLink, setPaymentLink] = useState('');
const [isLoading, setIsLoading] = useState(false);
const [foreClosureDetails, setForeClosureDetails] = useState<IForeclosureBreakup>(
DEFAULT_FORECLOSURE_BREAKUP
);
useEffect(() => {
const getForeCLosureDetails = async () => {
const foreclosureAmount = await getForeclosureAmount(
caseDetail?.loanAccountNumber,
dateFormat(new Date(), 'YYYY-MM-DD')
);
setForeClosureDetails(foreclosureAmount);
};
getForeCLosureDetails();
}, []);
useEffect(() => {
if (paymentLink && generateClicked) {
@@ -116,6 +137,9 @@ const OnlinePayment: React.FC<IOnlinePayment> = ({
maxAmount
)}`;
break;
case 'validate':
errorMessage = 'Please enter a valid amount';
break;
}
const isPaymentButtonDisabled = !isValid || !isOnline;
@@ -237,7 +261,12 @@ const OnlinePayment: React.FC<IOnlinePayment> = ({
required: true,
min: 1,
max: maxAmount,
validate: (value) => isValidAmountEntered(Number(value)),
validate: (value) => {
const amountVal = Number(value);
if (amountVal !== foreClosureDetails?.totalAmount)
return isValidAmountEntered(amountVal) && Number.isInteger(amountVal);
return isValidAmountEntered(amountVal);
},
}}
/>
</View>