This commit is contained in:
Kakabay 2024-04-03 18:08:52 +05:00
parent 74d4075f8f
commit d81f004296
1 changed files with 6 additions and 7 deletions

View File

@ -78,6 +78,7 @@ const PhoneAccept = ({
}
if (jsonedResponse.status === 'ok' && jsonedResponse['final-url'].includes('status=1')) {
console.log(jsonedResponse['final-url']);
setInvalidData(false);
checkPayment();
} else if (
@ -93,10 +94,6 @@ const PhoneAccept = ({
const checkPayment = async () => {
try {
const headers = {
'Content-Type': 'application/json',
};
const response = await fetch(
`https://shahsyotag.halkbank.gov.tm/app/api/check-payment-credit-card?paymentId=${paymentLink.id}&orderId=${paymentDetails['md-order']}&status=1`,
);
@ -107,7 +104,9 @@ const PhoneAccept = ({
const jsonedResponse = await response.json();
if (jsonedResponse.ErrorCode === '0') {
if (jsonedResponse.status.ErrorCode === '0') {
console.log('success');
sendCode();
}
} catch (error) {
@ -116,6 +115,8 @@ const PhoneAccept = ({
};
const sendCode = async () => {
console.log('startred');
try {
const response = await fetch('https://shahsyotag.halkbank.gov.tm/sendOTP', {
method: 'POST',
@ -125,8 +126,6 @@ const PhoneAccept = ({
}),
});
const jsonedResponse = await response.json();
if (!response.ok) {
throw new Error(`HTTP error! Status: ${response.status}`);
}