add error handler for payment request
This commit is contained in:
@@ -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';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user