1+ <?php namespace App \Jobs ;
2+ /*
3+ * Copyright 2025 OpenStack Foundation
4+ * Licensed under the Apache License, Version 2.0 (the "License");
5+ * you may not use this file except in compliance with the License.
6+ * You may obtain a copy of the License at
7+ * http://www.apache.org/licenses/LICENSE-2.0
8+ * Unless required by applicable law or agreed to in writing, software
9+ * distributed under the License is distributed on an "AS IS" BASIS,
10+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+ * See the License for the specific language governing permissions and
12+ * limitations under the License.
13+ **/
14+ use App \Services \Model \ISummitOrderService ;
15+ use Illuminate \Bus \Queueable ;
16+ use Illuminate \Contracts \Queue \ShouldQueue ;
17+ use Illuminate \Foundation \Bus \Dispatchable ;
18+ use Illuminate \Queue \InteractsWithQueue ;
19+ use Illuminate \Queue \SerializesModels ;
20+ use Illuminate \Support \Facades \Log ;
21+ use models \summit \SummitAttendeeTicketRefundRequest ;
22+ use models \summit \SummitOrder ;
23+
24+ final class ProcessPaymentGatewayRefundJob implements ShouldQueue
25+ {
26+ use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
27+
28+ public int $ tries = 2 ;
29+
30+ // no timeout
31+ public int $ timeout = 0 ;
32+ /*
33+ /**
34+ * @var int
35+ */
36+ private int $ order_id ;
37+
38+ /**
39+ * @var int
40+ */
41+ private int $ request_id ;
42+
43+ /**
44+ * @param SummitOrder $order
45+ * @param SummitAttendeeTicketRefundRequest $request
46+ */
47+ public function __construct (SummitOrder $ order , SummitAttendeeTicketRefundRequest $ request )
48+ {
49+ $ this ->request_id = $ request ->getId ();
50+ $ this ->order_id = $ order ->getId ();
51+ }
52+
53+ /**
54+ * @param ISummitOrderService $service
55+ * @return void
56+ */
57+ public function handle (ISummitOrderService $ service ):void
58+ {
59+ Log::debug
60+ (
61+ sprintf
62+ (
63+ "ProcessPaymentGatewayRefundJob::handle order id %s request id %s " ,
64+ $ this ->order_id ,
65+ $ this ->request_id
66+ )
67+ );
68+
69+ $ service ->processPaymentGatewayRefundRequest ($ this ->order_id , $ this ->request_id );
70+ }
71+
72+ public function failed (\Throwable $ exception )
73+ {
74+ Log::error ($ exception );
75+ }
76+
77+ }
0 commit comments