add error handler for payment request

This commit is contained in:
smanylov
2026-04-02 11:29:15 +07:00
parent 2878f546ee
commit 9b83ba3176
6 changed files with 16 additions and 7 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "no-copy-frontend", "name": "no-copy-frontend",
"version": "0.76.0", "version": "0.77.0",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "next dev -p 2999", "dev": "next dev -p 2999",
+7
View File
@@ -378,6 +378,10 @@ export async function createPayoutRequest(
throw JSON.parse(responseText)?.message; throw JSON.parse(responseText)?.message;
} }
if (response.status === 409) {
throw 'insufficient-funds-to-receive-payment'
}
if (response.ok) { if (response.ok) {
const parsed = await response.json(); const parsed = await response.json();
console.log(parsed); console.log(parsed);
@@ -403,6 +407,9 @@ export async function createPayoutRequest(
case 'Min sum for pay 1000': case 'Min sum for pay 1000':
typedError = 'min-sum-for-payout-1000'; typedError = 'min-sum-for-payout-1000';
break; break;
case 'insufficient-funds-to-receive-payment':
typedError = 'insufficient-funds-to-receive-payment';
break;
default: default:
typedError = 'payment-error'; typedError = 'payment-error';
} }
@@ -550,7 +550,7 @@ export default function VerificationUploadSection({
</div> </div>
</div> </div>
{ {/* {
(fileType === 'image' && file.preview) && ( (fileType === 'image' && file.preview) && (
<div <div
className="image-preview-wrapper" className="image-preview-wrapper"
@@ -565,7 +565,7 @@ export default function VerificationUploadSection({
</div> </div>
) )
} } */}
{ {
file.status === 'pending' && ( file.status === 'pending' && (
@@ -16,12 +16,12 @@ export default function SettingUserVerification() {
Верификация юзера Верификация юзера
</h3> </h3>
<form> <form>
{/* <VerificationUploadSection {/* <VerificationUploadSection
fileType="image" fileType="image"
allowedExtensions={allFilesExtensions.images} allowedExtensions={allFilesExtensions.images}
maxFileSize={allFilesExtensions.maxFileSize} maxFileSize={allFilesExtensions.maxFileSize}
/> */} /> */}
{/* <button type="submit" className="btn btn-primary"> {/* <button type="submit" className="btn btn-primary">
загрузить загрузить
</button> */} </button> */}
</form> </form>
+2 -1
View File
@@ -389,7 +389,8 @@
"deselect": "Deselect", "deselect": "Deselect",
"select-all": "Select all", "select-all": "Select all",
"text-area-error-fill-complaint-text": "Fill out the complaint text", "text-area-error-fill-complaint-text": "Fill out the complaint text",
"to-view-a-file-match-click-on-the-card-from-the-list": "To view a file match, click on the card from the list" "to-view-a-file-match-click-on-the-card-from-the-list": "To view a file match, click on the card from the list",
"insufficient-funds-to-receive-payment": "Insufficient funds to receive payment"
}, },
"Login-register-form": { "Login-register-form": {
"and": "and", "and": "and",
+2 -1
View File
@@ -389,7 +389,8 @@
"deselect": "Снять выделение", "deselect": "Снять выделение",
"select-all": "Выбрать все", "select-all": "Выбрать все",
"text-area-error-fill-complaint-text": "Заполните текст жалобы", "text-area-error-fill-complaint-text": "Заполните текст жалобы",
"to-view-a-file-match-click-on-the-card-from-the-list": "Для просмотра совпадения по файлу нажмите на карточку из списка" "to-view-a-file-match-click-on-the-card-from-the-list": "Для просмотра совпадения по файлу нажмите на карточку из списка",
"insufficient-funds-to-receive-payment": "Недостаточно средств получения выплаты"
}, },
"Login-register-form": { "Login-register-form": {
"and": "и", "and": "и",