Merge branch 'main' of https://github.com/VividTruthKeeper/react-halkbank
This commit is contained in:
commit
28b110f632
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"files": {
|
||||
"main.css": "/static/css/main.148e73e6.css",
|
||||
"main.js": "/static/js/main.a831ae15.js",
|
||||
"main.js": "/static/js/main.71160969.js",
|
||||
"static/media/logo-transp.svg": "/static/media/logo-transp.66d6235f12fb5d9a6264c592bce58c5a.svg",
|
||||
"static/media/logo-bg.jpg": "/static/media/logo-bg.1d55df78b7376108f96c.jpg",
|
||||
"static/media/credit-card.jpg": "/static/media/credit-card.ff2990f7d50439a8f34d.jpg",
|
||||
|
|
@ -69,6 +69,6 @@
|
|||
},
|
||||
"entrypoints": [
|
||||
"static/css/main.148e73e6.css",
|
||||
"static/js/main.a831ae15.js"
|
||||
"static/js/main.71160969.js"
|
||||
]
|
||||
}
|
||||
|
|
@ -1 +1 @@
|
|||
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1"/><meta name="theme-color" content="#000000"/><meta name="Content-Security-Policy" content="default-src https://shahsyotag.halkbank.gov.tm 'self'; content-src 'self' https://shahsyotag.halkbank.gov.tm; script-src 'self' www.google.com www.gstatic.com; style-src 'self' https: 'unsafe-inline'; frame-src www.google.com;"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><title>Shahsy Otag</title><script defer="defer" src="/static/js/main.a831ae15.js"></script><link href="/static/css/main.148e73e6.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script src="//www.google.com/recaptcha/api.js" nonce="{NONCE}" async defer="defer"></script></body></html>
|
||||
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1"/><meta name="theme-color" content="#000000"/><meta name="Content-Security-Policy" content="default-src https://shahsyotag.halkbank.gov.tm 'self'; content-src 'self' https://shahsyotag.halkbank.gov.tm; script-src 'self' www.google.com www.gstatic.com; style-src 'self' https: 'unsafe-inline'; frame-src www.google.com;"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><title>Shahsy Otag</title><script defer="defer" src="/static/js/main.71160969.js"></script><link href="/static/css/main.148e73e6.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script src="//www.google.com/recaptcha/api.js" nonce="{NONCE}" async defer="defer"></script></body></html>
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -1,13 +1,13 @@
|
|||
// IMPORT MODULES
|
||||
import React, { useState, useContext } from 'react';
|
||||
import { LanguageContext } from '../../backend/LanguageContext';
|
||||
import { UserContext } from '../../backend/UserContext';
|
||||
import { useForm } from 'react-hook-form';
|
||||
import { z } from 'zod';
|
||||
import { zodResolver } from '@hookform/resolvers/zod';
|
||||
import React, { useState, useContext } from "react";
|
||||
import { LanguageContext } from "../../backend/LanguageContext";
|
||||
import { UserContext } from "../../backend/UserContext";
|
||||
import { useForm } from "react-hook-form";
|
||||
import { z } from "zod";
|
||||
import { zodResolver } from "@hookform/resolvers/zod";
|
||||
// IMPORT IMAGES
|
||||
import next from '../../icons/next.svg';
|
||||
import next_reverse from '../../icons/next-reverse.svg';
|
||||
import next from "../../icons/next.svg";
|
||||
import next_reverse from "../../icons/next-reverse.svg";
|
||||
// import arrow from "../../icons/arrow.svg";
|
||||
|
||||
const schema = z.object({
|
||||
|
|
@ -30,7 +30,7 @@ const AcceptStage = ({
|
|||
userDataRes,
|
||||
}) => {
|
||||
const { locale } = useContext(LanguageContext);
|
||||
const userToken = localStorage.getItem('userToken');
|
||||
const userToken = localStorage.getItem("userToken");
|
||||
|
||||
const handleCardDetails = (e) => {
|
||||
setCardDetails(e.target.value);
|
||||
|
|
@ -46,8 +46,8 @@ const AcceptStage = ({
|
|||
} = useForm({
|
||||
resolver: zodResolver(schema),
|
||||
defaultValues: {
|
||||
amount: recepientAmount ? recepientAmount : 'Loading',
|
||||
duration: creditDuration ? creditDuration : 'loading',
|
||||
amount: recepientAmount ? recepientAmount : "Loading",
|
||||
duration: creditDuration ? creditDuration : "loading",
|
||||
},
|
||||
});
|
||||
|
||||
|
|
@ -58,9 +58,9 @@ const AcceptStage = ({
|
|||
const response = await fetch(
|
||||
`https://shahsyotag.halkbank.gov.tm/onlineloancre-services/api/loancre`,
|
||||
{
|
||||
method: 'POST',
|
||||
method: "POST",
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify({
|
||||
clientRecipient: {
|
||||
|
|
@ -70,7 +70,7 @@ const AcceptStage = ({
|
|||
name: borrowerData.name,
|
||||
surname: borrowerData.surname,
|
||||
availableAmount: borrowerData.availableAmount,
|
||||
clientType: 'recipient',
|
||||
clientType: "recipient",
|
||||
signRecipient: borrowerData.signRecipient,
|
||||
},
|
||||
clientGuarantor: isGuranter
|
||||
|
|
@ -81,7 +81,7 @@ const AcceptStage = ({
|
|||
name: guaranterData.name,
|
||||
surname: guaranterData.surname,
|
||||
availableAmount: guaranterData.availableAmount,
|
||||
clientType: 'guarantor',
|
||||
clientType: "guarantor",
|
||||
signGuarantor: guaranterData.signGuarantor,
|
||||
}
|
||||
: null,
|
||||
|
|
@ -90,7 +90,7 @@ const AcceptStage = ({
|
|||
mrtIsInsuarance: isGuranter ? 0 : 1,
|
||||
termInYears: creditDuration,
|
||||
}),
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
if (!response.ok) {
|
||||
|
|
@ -114,12 +114,18 @@ const AcceptStage = ({
|
|||
|
||||
const sendData = async (requestBody) => {
|
||||
try {
|
||||
const headers = { Accept: 'application/json', Authorization: `Bearer ${userToken}` };
|
||||
const response = await fetch('https://shahsyotag.halkbank.gov.tm/app/api/quick_loans', {
|
||||
method: 'POST',
|
||||
headers: headers,
|
||||
body: JSON.stringify(requestBody),
|
||||
});
|
||||
const headers = {
|
||||
Accept: "application/json",
|
||||
Authorization: `Bearer ${userToken}`,
|
||||
};
|
||||
const response = await fetch(
|
||||
"https://shahsyotag.halkbank.gov.tm/app/api/quick_loans",
|
||||
{
|
||||
method: "POST",
|
||||
headers: headers,
|
||||
body: JSON.stringify(requestBody),
|
||||
}
|
||||
);
|
||||
|
||||
const jsonedResponse = await response.json();
|
||||
setAcceptedMessage(jsonedResponse.message);
|
||||
|
|
@ -142,19 +148,23 @@ const AcceptStage = ({
|
|||
<section className="imm-cs-1">
|
||||
<h1 className="cs-2-title">Error...</h1>
|
||||
<div className="cu-bottom cd-2-title">
|
||||
<button type="button" className="sign-btn reg-btn" onClick={() => setStage(7)}>
|
||||
<button
|
||||
type="button"
|
||||
className="sign-btn reg-btn"
|
||||
onClick={() => setStage(7)}
|
||||
>
|
||||
<div>
|
||||
<div className="btn-img">
|
||||
<img src={next_reverse} alt="logout" />
|
||||
</div>
|
||||
<h3>
|
||||
{locale === 'TKM'
|
||||
? 'Yza'
|
||||
: locale === 'РУС'
|
||||
? 'Назад'
|
||||
: locale === 'ENG'
|
||||
? 'Back'
|
||||
: 'Yza'}
|
||||
{locale === "TKM"
|
||||
? "Yza"
|
||||
: locale === "РУС"
|
||||
? "Назад"
|
||||
: locale === "ENG"
|
||||
? "Back"
|
||||
: "Yza"}
|
||||
</h3>
|
||||
</div>
|
||||
</button>
|
||||
|
|
@ -175,50 +185,55 @@ const AcceptStage = ({
|
|||
<section className="imm-cs-1">
|
||||
<form onSubmit={handleSubmit(onSubmit)}>
|
||||
<h2 className="cs-2-title">
|
||||
{locale === 'TKM'
|
||||
? 'Karzyň kalkulýatory'
|
||||
: locale === 'РУС'
|
||||
? 'Подтвердите данные'
|
||||
: locale === 'ENG'
|
||||
? 'Loan calculator'
|
||||
: 'Karzyň kalkulýatory'}
|
||||
{locale === "TKM"
|
||||
? "Karzyň kalkulýatory"
|
||||
: locale === "РУС"
|
||||
? "Подтвердите данные"
|
||||
: locale === "ENG"
|
||||
? "Loan calculator"
|
||||
: "Karzyň kalkulýatory"}
|
||||
</h2>
|
||||
<div className="imm-credit-form-wrapper">
|
||||
<div className="input-block">
|
||||
<label htmlFor="amount">
|
||||
{locale === 'TKM'
|
||||
? 'At'
|
||||
: locale === 'РУС'
|
||||
? 'Сумма'
|
||||
: locale === 'ENG'
|
||||
? 'amount'
|
||||
: 'At'}
|
||||
{locale === "TKM"
|
||||
? "At"
|
||||
: locale === "РУС"
|
||||
? "Сумма"
|
||||
: locale === "ENG"
|
||||
? "amount"
|
||||
: "At"}
|
||||
</label>
|
||||
<input {...register('amount')} type="text" id="amount" disabled />
|
||||
<input {...register("amount")} type="text" id="amount" disabled />
|
||||
{errors.amount && <span>{errors.amount.message}</span>}
|
||||
</div>
|
||||
<div className="input-block">
|
||||
<label htmlFor="surname">
|
||||
{locale === 'TKM'
|
||||
? 'At'
|
||||
: locale === 'РУС'
|
||||
? 'Срок'
|
||||
: locale === 'ENG'
|
||||
? 'duration'
|
||||
: 'At'}
|
||||
{locale === "TKM"
|
||||
? "At"
|
||||
: locale === "РУС"
|
||||
? "Срок"
|
||||
: locale === "ENG"
|
||||
? "duration"
|
||||
: "At"}
|
||||
</label>
|
||||
<input {...register('duration')} type="text" id="duration" disabled />
|
||||
<input
|
||||
{...register("duration")}
|
||||
type="text"
|
||||
id="duration"
|
||||
disabled
|
||||
/>
|
||||
{errors.duration && <span>{errors.duration.message}</span>}
|
||||
</div>
|
||||
<div className="input-block">
|
||||
<label htmlFor="code">
|
||||
{locale === 'TKM'
|
||||
? 'At'
|
||||
: locale === 'РУС'
|
||||
? 'Номер карты'
|
||||
: locale === 'ENG'
|
||||
? 'amount'
|
||||
: 'At'}
|
||||
{locale === "TKM"
|
||||
? "At"
|
||||
: locale === "РУС"
|
||||
? "Номер карты"
|
||||
: locale === "ENG"
|
||||
? "amount"
|
||||
: "At"}
|
||||
</label>
|
||||
<input
|
||||
value={cardDetails}
|
||||
|
|
@ -234,19 +249,23 @@ const AcceptStage = ({
|
|||
</div>
|
||||
</div>
|
||||
<div className="cu-bottom cd-2-title">
|
||||
<button type="button" className="sign-btn reg-btn" onClick={() => setStage(7)}>
|
||||
<button
|
||||
type="button"
|
||||
className="sign-btn reg-btn"
|
||||
onClick={() => setStage(7)}
|
||||
>
|
||||
<div>
|
||||
<div className="btn-img">
|
||||
<img src={next_reverse} alt="logout" />
|
||||
</div>
|
||||
<h3>
|
||||
{locale === 'TKM'
|
||||
? 'Yza'
|
||||
: locale === 'РУС'
|
||||
? 'Назад'
|
||||
: locale === 'ENG'
|
||||
? 'Back'
|
||||
: 'Yza'}
|
||||
{locale === "TKM"
|
||||
? "Yza"
|
||||
: locale === "РУС"
|
||||
? "Назад"
|
||||
: locale === "ENG"
|
||||
? "Back"
|
||||
: "Yza"}
|
||||
</h3>
|
||||
</div>
|
||||
</button>
|
||||
|
|
@ -254,16 +273,17 @@ const AcceptStage = ({
|
|||
type="submit"
|
||||
className="sign-btn cu-btn"
|
||||
disabled={cardDetails.length !== 23 && !isLoading ? true : false}
|
||||
onClick={onSubmit}>
|
||||
onClick={onSubmit}
|
||||
>
|
||||
<div>
|
||||
<h3>
|
||||
{locale === 'TKM'
|
||||
? 'Dowam et'
|
||||
: locale === 'РУС'
|
||||
? 'Подтвердить '
|
||||
: locale === 'ENG'
|
||||
? 'Proceed'
|
||||
: 'Dowam et'}
|
||||
{locale === "TKM"
|
||||
? "Dowam et"
|
||||
: locale === "РУС"
|
||||
? "Подтвердить "
|
||||
: locale === "ENG"
|
||||
? "Proceed"
|
||||
: "Dowam et"}
|
||||
</h3>
|
||||
<div className="btn-img">
|
||||
<img src={next} alt="logout" />
|
||||
|
|
|
|||
|
|
@ -53,7 +53,10 @@ const CardRegistration = ({ borrowerData, setStage, setPaymentLink, setPaymentDe
|
|||
|
||||
const sendData = async () => {
|
||||
try {
|
||||
const headers = { Accept: 'application/json', Authorization: `Bearer ${userToken}` };
|
||||
const headers = {
|
||||
Accept: 'application/json',
|
||||
Authorization: `Bearer ${userToken}`,
|
||||
};
|
||||
const response = await fetch(
|
||||
'https://shahsyotag.halkbank.gov.tm/app/api/online_credit_card',
|
||||
{
|
||||
|
|
@ -80,9 +83,7 @@ const CardRegistration = ({ borrowerData, setStage, setPaymentLink, setPaymentDe
|
|||
|
||||
const jsonedResponse = await response.json();
|
||||
|
||||
console.log(jsonedResponse);
|
||||
|
||||
sendPaymentRequest(jsonedResponse);
|
||||
sendPaymentRequest(jsonedResponse.url);
|
||||
|
||||
setPaymentLink(jsonedResponse);
|
||||
} catch (error) {
|
||||
|
|
|
|||
|
|
@ -1,33 +1,33 @@
|
|||
// IMPORT MODULES
|
||||
import React, { useEffect, useRef, useState, useContext } from 'react';
|
||||
import { LanguageContext } from '../../backend/LanguageContext';
|
||||
import React, { useEffect, useRef, useState, useContext } from "react";
|
||||
import { LanguageContext } from "../../backend/LanguageContext";
|
||||
|
||||
import axios from 'axios';
|
||||
import axios from "axios";
|
||||
|
||||
// IMPORT IMAGES
|
||||
import exit from '../../icons/exit.svg';
|
||||
import { ReactComponent as Lines } from '../../icons/lines.svg';
|
||||
import { ReactComponent as Img1 } from '../../icons/credit1.svg';
|
||||
import { ReactComponent as Img2 } from '../../icons/credit2.svg';
|
||||
import { ReactComponent as Img3 } from '../../icons/credit3.svg';
|
||||
import { ReactComponent as Img4 } from '../../icons/credit4.svg';
|
||||
import { ReactComponent as Img5 } from '../../icons/credit5.svg';
|
||||
import { ReactComponent as Img6 } from '../../icons/credit6.svg';
|
||||
import exit from "../../icons/exit.svg";
|
||||
import { ReactComponent as Lines } from "../../icons/lines.svg";
|
||||
import { ReactComponent as Img1 } from "../../icons/credit1.svg";
|
||||
import { ReactComponent as Img2 } from "../../icons/credit2.svg";
|
||||
import { ReactComponent as Img3 } from "../../icons/credit3.svg";
|
||||
import { ReactComponent as Img4 } from "../../icons/credit4.svg";
|
||||
import { ReactComponent as Img5 } from "../../icons/credit5.svg";
|
||||
import { ReactComponent as Img6 } from "../../icons/credit6.svg";
|
||||
|
||||
// IMPORT COMPONENTS
|
||||
import BorrowerStage from '../ImmediateCreditsStages/BorrowerStage';
|
||||
import BorrowerInfo from '../ImmediateCreditsStages/BorrowerInfo';
|
||||
import GuaranterStage from '../ImmediateCreditsStages/GuaranterStage';
|
||||
import GuaranterInfo from '../ImmediateCreditsStages/GuaranterInfo';
|
||||
import NotAUser from '../ImmediateCreditsStages/NotAUser';
|
||||
import CalculateStage from '../ImmediateCreditsStages/CalculateStage';
|
||||
import AcceptStage from '../ImmediateCreditsStages/AcceptStage';
|
||||
import PhoneAccept from '../ImmediateCreditsStages/PhoneAccept';
|
||||
import CardDetails from '../ImmediateCreditsStages/CardDetails';
|
||||
import LoanAccepted from '../ImmediateCreditsStages/LoanAccepted';
|
||||
import CardRegistration from '../ImmediateCreditsStages/CardRegistration';
|
||||
import PaymentDetails from '../ImmediateCreditsStages/PaymentDetails';
|
||||
import PaymentSuccess from '../ImmediateCreditsStages/PaymentSuccess';
|
||||
import BorrowerStage from "../ImmediateCreditsStages/BorrowerStage";
|
||||
import BorrowerInfo from "../ImmediateCreditsStages/BorrowerInfo";
|
||||
import GuaranterStage from "../ImmediateCreditsStages/GuaranterStage";
|
||||
import GuaranterInfo from "../ImmediateCreditsStages/GuaranterInfo";
|
||||
import NotAUser from "../ImmediateCreditsStages/NotAUser";
|
||||
import CalculateStage from "../ImmediateCreditsStages/CalculateStage";
|
||||
import AcceptStage from "../ImmediateCreditsStages/AcceptStage";
|
||||
import PhoneAccept from "../ImmediateCreditsStages/PhoneAccept";
|
||||
import CardDetails from "../ImmediateCreditsStages/CardDetails";
|
||||
import LoanAccepted from "../ImmediateCreditsStages/LoanAccepted";
|
||||
import CardRegistration from "../ImmediateCreditsStages/CardRegistration";
|
||||
import PaymentDetails from "../ImmediateCreditsStages/PaymentDetails";
|
||||
import PaymentSuccess from "../ImmediateCreditsStages/PaymentSuccess";
|
||||
|
||||
const ImmediateCreditModal = ({
|
||||
modalOpen,
|
||||
|
|
@ -46,8 +46,8 @@ const ImmediateCreditModal = ({
|
|||
const [loading, setLoading] = useState();
|
||||
const [error, setError] = useState();
|
||||
|
||||
const [errMessage, setErrMessage] = useState('');
|
||||
const [acceptedMessage, setAcceptedMessage] = useState('');
|
||||
const [errMessage, setErrMessage] = useState("");
|
||||
const [acceptedMessage, setAcceptedMessage] = useState("");
|
||||
|
||||
const [borrowerData, setBorrowerData] = useState();
|
||||
const [guaranterData, setGuaranterData] = useState();
|
||||
|
|
@ -57,32 +57,37 @@ const ImmediateCreditModal = ({
|
|||
const [maxAmount, setMaxAmount] = useState();
|
||||
const [recepientAmount, setRecepientAmount] = useState(0);
|
||||
const [creditDuration, setCreditDuration] = useState(1);
|
||||
const [phoneNumber, setPhoneNumber] = useState('');
|
||||
const [cardDetails, setCardDetails] = useState('');
|
||||
const [phoneNumber, setPhoneNumber] = useState("");
|
||||
const [cardDetails, setCardDetails] = useState("");
|
||||
|
||||
const [userDataRes, setUserDataRes] = useState();
|
||||
const [paymentLink, setPaymentLink] = useState('');
|
||||
const [paymentLink, setPaymentLink] = useState("");
|
||||
|
||||
const [paymentDetails, setPaymentDetails] = useState();
|
||||
const [submitCardDetails, setSumbitCardDetails] = useState();
|
||||
|
||||
console.log(paymentDetails);
|
||||
|
||||
return (
|
||||
<section className={modalOpen ? 'modal credit-modal active' : 'modal credit-modal'}>
|
||||
<section
|
||||
className={modalOpen ? "modal credit-modal active" : "modal credit-modal"}
|
||||
>
|
||||
<div className="modal-container">
|
||||
<div className="modal-inner" ref={window}>
|
||||
<div className="modal-window">
|
||||
<div className="modal-top">
|
||||
<h2>
|
||||
{locale === 'TKM'
|
||||
? 'Çalt karz almak üçin onlaýn-ýüzlenme'
|
||||
: 'Онлайн-заявка для получения быстрого кредита'}
|
||||
{locale === "TKM"
|
||||
? "Çalt karz almak üçin onlaýn-ýüzlenme"
|
||||
: "Онлайн-заявка для получения быстрого кредита"}
|
||||
</h2>
|
||||
<button
|
||||
type="button"
|
||||
className="exit-btn"
|
||||
onClick={() => {
|
||||
setModalOpen(false);
|
||||
}}>
|
||||
}}
|
||||
>
|
||||
<div>
|
||||
<img src={exit} alt="exit" />
|
||||
</div>
|
||||
|
|
@ -93,73 +98,81 @@ const ImmediateCreditModal = ({
|
|||
<div className="icon-block active">
|
||||
<Img4 className="modal-icon" />
|
||||
<h3 className="icon-title">
|
||||
{locale === 'TKM'
|
||||
? 'Karz üçin maglumat'
|
||||
: locale === 'РУС'
|
||||
? 'Заполните данные'
|
||||
: locale === 'ENG'
|
||||
? 'Loan details'
|
||||
: 'Karz üçin maglumat'}
|
||||
{locale === "TKM"
|
||||
? "Karz üçin maglumat"
|
||||
: locale === "РУС"
|
||||
? "Заполните данные"
|
||||
: locale === "ENG"
|
||||
? "Loan details"
|
||||
: "Karz üçin maglumat"}
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
<div className={stage > 1 ? 'line-block active' : 'line-block'}>
|
||||
<div className={stage > 1 ? "line-block active" : "line-block"}>
|
||||
<Lines className="lines" />
|
||||
<Lines className="lines" />
|
||||
</div>
|
||||
|
||||
<div className={stage > 1 ? 'icon-block active' : 'icon-block'}>
|
||||
<div className={stage > 1 ? "icon-block active" : "icon-block"}>
|
||||
<Img3 className="modal-icon" />
|
||||
<h3 className="icon-title">
|
||||
{locale === 'TKM'
|
||||
? 'Şahsy maglumatlar'
|
||||
: locale === 'РУС'
|
||||
? 'Подтвердите личные данные'
|
||||
: locale === 'ENG'
|
||||
? 'Personal data'
|
||||
: 'Şahsy maglumatlar'}
|
||||
{locale === "TKM"
|
||||
? "Şahsy maglumatlar"
|
||||
: locale === "РУС"
|
||||
? "Подтвердите личные данные"
|
||||
: locale === "ENG"
|
||||
? "Personal data"
|
||||
: "Şahsy maglumatlar"}
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
<div className={stage > 2 ? 'line-block active' : 'line-block'}>
|
||||
<div className={stage > 2 ? "line-block active" : "line-block"}>
|
||||
<Lines className="lines" />
|
||||
<Lines className="lines" />
|
||||
</div>
|
||||
|
||||
{isGuranter && (
|
||||
<>
|
||||
<div className={stage > 3 ? 'icon-block active' : 'icon-block'}>
|
||||
<div
|
||||
className={stage > 3 ? "icon-block active" : "icon-block"}
|
||||
>
|
||||
<Img4 className="modal-icon" />
|
||||
<h3 className="icon-title">
|
||||
{locale === 'TKM'
|
||||
? 'Karz üçin maglumat'
|
||||
: locale === 'РУС'
|
||||
? 'Заполните данные поручитель'
|
||||
: locale === 'ENG'
|
||||
? 'Loan details'
|
||||
: 'Karz üçin maglumat'}
|
||||
{locale === "TKM"
|
||||
? "Karz üçin maglumat"
|
||||
: locale === "РУС"
|
||||
? "Заполните данные поручитель"
|
||||
: locale === "ENG"
|
||||
? "Loan details"
|
||||
: "Karz üçin maglumat"}
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
<div className={stage > 3 ? 'line-block active' : 'line-block'}>
|
||||
<div
|
||||
className={stage > 3 ? "line-block active" : "line-block"}
|
||||
>
|
||||
<Lines className="lines" />
|
||||
<Lines className="lines" />
|
||||
</div>
|
||||
|
||||
<div className={stage > 4 ? 'icon-block active' : 'icon-block'}>
|
||||
<div
|
||||
className={stage > 4 ? "icon-block active" : "icon-block"}
|
||||
>
|
||||
<Img3 className="modal-icon" />
|
||||
<h3 className="icon-title">
|
||||
{locale === 'TKM'
|
||||
? 'Şahsy maglumatlar'
|
||||
: locale === 'РУС'
|
||||
? 'Подтвердите данные поручителя'
|
||||
: locale === 'ENG'
|
||||
? 'Personal data'
|
||||
: 'Şahsy maglumatlar'}
|
||||
{locale === "TKM"
|
||||
? "Şahsy maglumatlar"
|
||||
: locale === "РУС"
|
||||
? "Подтвердите данные поручителя"
|
||||
: locale === "ENG"
|
||||
? "Personal data"
|
||||
: "Şahsy maglumatlar"}
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
<div className={stage > 4 ? 'line-block active' : 'line-block'}>
|
||||
<div
|
||||
className={stage > 4 ? "line-block active" : "line-block"}
|
||||
>
|
||||
<Lines className="lines" />
|
||||
<Lines className="lines" />
|
||||
</div>
|
||||
|
|
@ -220,56 +233,56 @@ const ImmediateCreditModal = ({
|
|||
<div className="icon-block active">
|
||||
<Img4 className="modal-icon" />
|
||||
<h3 className="icon-title">
|
||||
{locale === 'TKM'
|
||||
? 'Karz üçin maglumat'
|
||||
: locale === 'РУС'
|
||||
? 'Заполните данные'
|
||||
: locale === 'ENG'
|
||||
? 'Loan details'
|
||||
: 'Karz üçin maglumat'}
|
||||
{locale === "TKM"
|
||||
? "Karz üçin maglumat"
|
||||
: locale === "РУС"
|
||||
? "Заполните данные"
|
||||
: locale === "ENG"
|
||||
? "Loan details"
|
||||
: "Karz üçin maglumat"}
|
||||
</h3>
|
||||
</div>
|
||||
) : stage >= 2 ? (
|
||||
<div className="icon-block active">
|
||||
<Img3 className="modal-icon" />
|
||||
<h3 className="icon-title">
|
||||
{locale === 'TKM'
|
||||
? 'Karzyň kalkulýatory'
|
||||
: locale === 'РУС'
|
||||
? 'Подтвердите личные данные'
|
||||
: locale === 'ENG'
|
||||
? 'Loan calculator'
|
||||
: 'Karzyň kalkulýatory'}
|
||||
{locale === "TKM"
|
||||
? "Karzyň kalkulýatory"
|
||||
: locale === "РУС"
|
||||
? "Подтвердите личные данные"
|
||||
: locale === "ENG"
|
||||
? "Loan calculator"
|
||||
: "Karzyň kalkulýatory"}
|
||||
</h3>
|
||||
</div>
|
||||
) : stage === 4 && isGuranter ? (
|
||||
<div className="icon-block active">
|
||||
<Img3 className="modal-icon" />
|
||||
<h3 className="icon-title">
|
||||
{locale === 'TKM'
|
||||
? 'Şahsy maglumatlar'
|
||||
: locale === 'РУС'
|
||||
? 'Заполните данные поручителя'
|
||||
: locale === 'ENG'
|
||||
? 'Personal data'
|
||||
: 'Şahsy maglumatlar'}
|
||||
{locale === "TKM"
|
||||
? "Şahsy maglumatlar"
|
||||
: locale === "РУС"
|
||||
? "Заполните данные поручителя"
|
||||
: locale === "ENG"
|
||||
? "Personal data"
|
||||
: "Şahsy maglumatlar"}
|
||||
</h3>
|
||||
</div>
|
||||
) : stage >= 5 && isGuranter ? (
|
||||
<div className="icon-block active">
|
||||
<Img4 className="modal-icon" />
|
||||
<h3 className="icon-title">
|
||||
{locale === 'TKM'
|
||||
? 'Karz üçin maglumat'
|
||||
: locale === 'РУС'
|
||||
? 'Подтвердите данные поручителя'
|
||||
: locale === 'ENG'
|
||||
? 'Loan details'
|
||||
: 'Karz üçin maglumat'}
|
||||
{locale === "TKM"
|
||||
? "Karz üçin maglumat"
|
||||
: locale === "РУС"
|
||||
? "Подтвердите данные поручителя"
|
||||
: locale === "ENG"
|
||||
? "Loan details"
|
||||
: "Karz üçin maglumat"}
|
||||
</h3>
|
||||
</div>
|
||||
) : (
|
||||
''
|
||||
""
|
||||
)}
|
||||
</div>
|
||||
|
||||
|
|
@ -294,7 +307,11 @@ const ImmediateCreditModal = ({
|
|||
borrowerData={borrowerData}
|
||||
/>
|
||||
) : stage === 3 ? (
|
||||
<NotAUser setStage={setStage} stage={stage} errMessage={errMessage} />
|
||||
<NotAUser
|
||||
setStage={setStage}
|
||||
stage={stage}
|
||||
errMessage={errMessage}
|
||||
/>
|
||||
) : stage === 4 ? (
|
||||
<GuaranterStage
|
||||
setStage={setStage}
|
||||
|
|
@ -314,7 +331,11 @@ const ImmediateCreditModal = ({
|
|||
guaranterData={guaranterData}
|
||||
/>
|
||||
) : stage === 6 ? (
|
||||
<NotAUser setStage={setStage} stage={stage} errMessage={errMessage} />
|
||||
<NotAUser
|
||||
setStage={setStage}
|
||||
stage={stage}
|
||||
errMessage={errMessage}
|
||||
/>
|
||||
) : stage === 7 ? (
|
||||
<CalculateStage
|
||||
isGuranter={isGuranter}
|
||||
|
|
@ -352,7 +373,11 @@ const ImmediateCreditModal = ({
|
|||
creditDuration={creditDuration}
|
||||
/>
|
||||
) : stage === 10 ? (
|
||||
<NotAUser setStage={setStage} stage={stage} errMessage={errMessage} />
|
||||
<NotAUser
|
||||
setStage={setStage}
|
||||
stage={stage}
|
||||
errMessage={errMessage}
|
||||
/>
|
||||
) : stage === 11 ? (
|
||||
<LoanAccepted
|
||||
setModalOpen={setModalOpen}
|
||||
|
|
@ -385,9 +410,12 @@ const ImmediateCreditModal = ({
|
|||
submitCardDetails={submitCardDetails}
|
||||
/>
|
||||
) : stage === 15 ? (
|
||||
<PaymentSuccess setStage={setStage} setModalOpen={setModalOpen} />
|
||||
<PaymentSuccess
|
||||
setStage={setStage}
|
||||
setModalOpen={setModalOpen}
|
||||
/>
|
||||
) : (
|
||||
''
|
||||
""
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -84,6 +84,29 @@ const ImmediateCredit = () => {
|
|||
} catch (error) {}
|
||||
};
|
||||
|
||||
const fetchCard = async () => {
|
||||
try {
|
||||
const response = await fetch(
|
||||
`https://shahsyotag.halkbank.gov.tm/app/api/check-payment-credit-card`,
|
||||
{
|
||||
method: 'get',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify({
|
||||
paymentId: 1,
|
||||
orderId: 1231,
|
||||
status: '1',
|
||||
}),
|
||||
},
|
||||
);
|
||||
|
||||
const jsonedResponse = await response.json();
|
||||
|
||||
setCardData(jsonedResponse);
|
||||
} catch (error) {}
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
fetchData();
|
||||
}, []);
|
||||
|
|
|
|||
Loading…
Reference in New Issue