<?php

namespace App\Jobs;

use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use App\Http\Controllers\API\Redis\CheckArrivalCl;

class CheckArrival implements ShouldQueue
{
    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;

    public string $hash;
    public int $price;
    public string $address;
    public string $to;

    /**
     * Create a new job instance.
     *
     * @return void
     */
    public function __construct(string $hash, int $price, string $address, string $to)
    {
        $this->queue = "{check-arrival}";
        $this->hash = $hash;
        $this->price = $price;
        $this->address = $address;
        $this->to = $to;
    }

    /**
     * Execute the job.
     *
     * @return void
     */
    public function handle()
    {
        # 处理 支付到账模块
        app(CheckArrivalCl::class)->check($this->hash, $this->price, $this->address, $this->to);
    }


}
