Return insufficient_wallet when Transfer billing fails for zero balance.
Deploy Ladill Transfer / deploy (push) Successful in 29s
Deploy Ladill Transfer / deploy (push) Successful in 29s
Expose a stable error_code on chunked upload finalize so webmail can prompt wallet top-up instead of a generic upload failure. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Support;
|
||||
|
||||
use RuntimeException;
|
||||
|
||||
class TransferWalletErrors
|
||||
{
|
||||
public const CODE_INSUFFICIENT_WALLET = 'insufficient_wallet';
|
||||
|
||||
public static function isInsufficientBalance(RuntimeException $e): bool
|
||||
{
|
||||
$message = strtolower($e->getMessage());
|
||||
|
||||
return str_contains($message, 'insufficient wallet')
|
||||
|| str_contains($message, 'top up');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user