123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- <?php
- namespace App\Jobs;
- use App\Exceptions\ApiException;
- use App\Services\Pay\OrderService;
- use Illuminate\Bus\Queueable;
- use Illuminate\Queue\SerializesModels;
- use Illuminate\Queue\InteractsWithQueue;
- use Illuminate\Contracts\Queue\ShouldQueue;
- use Illuminate\Foundation\Bus\Dispatchable;
- /**
- * Class OrderCloseJob
- * @package App\Jobs
- */
- class OrderCloseJob implements ShouldQueue
- {
- use Dispatchable;
- use InteractsWithQueue;
- use Queueable;
- use SerializesModels;
- /**
- * Create a new job instance.
- *
- * @param int $order_id
- */
- public function __construct($order_id)
- {
- $this->order_id = $order_id;
- }
- private $order_id;
- /**
- * Execute the job.
- *
- * @return void
- */
- public function handle()
- {
- $orderService = new OrderService();
- try {
- $result = $orderService->closeOrder($this->order_id);
- } catch (ApiException $e) {
- } catch (\Exception $e) {
- }
- }
- }
|