Mini API: avatar, wallet payout/withdraw, stale-payment auto-cancel.
Deploy Ladill Mini / deploy (push) Successful in 48s
Deploy Ladill Mini / deploy (push) Successful in 48s
Adds account avatar upload (multipart proxy to identity), wallet payout-account + withdrawal endpoints, and a hourly mini:cancel-stale-payments command that cancels payments pending beyond 6h (new MiniPayment::STATUS_CANCELED). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
c39e38cbe0
commit
af1f197059
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Models\MiniPayment;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
/**
|
||||
* Cancels Mini payments left pending longer than MiniPayment::STALE_PENDING_HOURS.
|
||||
* Scheduled hourly (routes/console.php).
|
||||
*/
|
||||
class CancelStalePayments extends Command
|
||||
{
|
||||
protected $signature = 'mini:cancel-stale-payments';
|
||||
|
||||
protected $description = 'Cancel Ladill Mini payments stuck pending beyond the stale window.';
|
||||
|
||||
public function handle(): int
|
||||
{
|
||||
$cutoff = now()->subHours(MiniPayment::STALE_PENDING_HOURS);
|
||||
|
||||
$count = MiniPayment::query()
|
||||
->where('status', MiniPayment::STATUS_PENDING)
|
||||
->where('created_at', '<', $cutoff)
|
||||
->update([
|
||||
'status' => MiniPayment::STATUS_CANCELED,
|
||||
'updated_at' => now(),
|
||||
]);
|
||||
|
||||
$this->info("Canceled {$count} stale pending payment(s).");
|
||||
|
||||
return self::SUCCESS;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user