Update source into github
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace App\Jobs\Payment;
|
||||
|
||||
use App\Http\Services\Telegram;
|
||||
use App\Models\Customer;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class GetPaymentMessage implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
protected int $customerId;
|
||||
protected float $amount;
|
||||
|
||||
public function __construct(int $customerId, float $amount)
|
||||
{
|
||||
$this->customerId = $customerId;
|
||||
$this->amount = $amount;
|
||||
}
|
||||
|
||||
public function handle(): void
|
||||
{
|
||||
$customer = Customer::find($this->customerId);
|
||||
if ($customer) {
|
||||
app(Telegram::class)->SendCustomerRecharge($customer, $this->amount);
|
||||
// app(Discord::class)->SendCustomerRecharge($customer, $this->amount);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user