Changeset View
Changeset View
Standalone View
Standalone View
src/app/Console/Commands/WalletCharge.php
Show First 20 Lines • Show All 53 Lines • ▼ Show 20 Lines | public function handle() | ||||
"Charged wallet {$wallet->id} for user {$wallet->owner->email} with {$charge}" | "Charged wallet {$wallet->id} for user {$wallet->owner->email} with {$charge}" | ||||
); | ); | ||||
// Top-up the wallet if auto-payment enabled for the wallet | // Top-up the wallet if auto-payment enabled for the wallet | ||||
\App\Jobs\WalletCharge::dispatch($wallet); | \App\Jobs\WalletCharge::dispatch($wallet); | ||||
} | } | ||||
if ($wallet->balance < 0) { | if ($wallet->balance < 0) { | ||||
// Check the account balance, send notifications, suspend, delete | // Check the account balance, send notifications, (suspend, delete,) degrade | ||||
// Also sends reminders to the degraded account owners | |||||
\App\Jobs\WalletCheck::dispatch($wallet); | \App\Jobs\WalletCheck::dispatch($wallet); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
} | } |