Files
ladill-transfer/app/Support/TransferWalletErrors.php
T
isaaccladandCursor 151c15cb85
Deploy Ladill Transfer / deploy (push) Successful in 29s
Return insufficient_wallet when Transfer billing fails for zero balance.
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>
2026-06-08 17:13:19 +00:00

19 lines
401 B
PHP

<?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');
}
}