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
+7
View File
@@ -378,6 +378,10 @@ export async function createPayoutRequest(
throw JSON.parse(responseText)?.message;
}
if (response.status === 409) {
throw 'insufficient-funds-to-receive-payment'
}
if (response.ok) {
const parsed = await response.json();
console.log(parsed);
@@ -403,6 +407,9 @@ export async function createPayoutRequest(
case 'Min sum for pay 1000':
typedError = 'min-sum-for-payout-1000';
break;
case 'insufficient-funds-to-receive-payment':
typedError = 'insufficient-funds-to-receive-payment';
break;
default:
typedError = 'payment-error';
}