Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 77 additions & 0 deletions app/Jobs/ProcessPaymentGatewayRefundJob.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<?php namespace App\Jobs;
/*
* Copyright 2025 OpenStack Foundation
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
**/
use App\Services\Model\ISummitOrderService;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Facades\Log;
use models\summit\SummitAttendeeTicketRefundRequest;
use models\summit\SummitOrder;

final class ProcessPaymentGatewayRefundJob implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;

public int $tries = 2;

// no timeout
public int $timeout = 0;
/*
/**
* @var int
*/
private int $order_id;

/**
* @var int
*/
private int $request_id;

/**
* @param SummitOrder $order
* @param SummitAttendeeTicketRefundRequest $request
*/
public function __construct(SummitOrder $order, SummitAttendeeTicketRefundRequest $request)
{
$this->request_id = $request->getId();
$this->order_id = $order->getId();
}

/**
* @param ISummitOrderService $service
* @return void
*/
public function handle(ISummitOrderService $service):void
{
Log::debug
(
sprintf
(
"ProcessPaymentGatewayRefundJob::handle order id %s request id %s",
$this->order_id,
$this->request_id
)
);

$service->processPaymentGatewayRefundRequest($this->order_id, $this->request_id);
}

public function failed(\Throwable $exception)
{
Log::error($exception);
}

}
7 changes: 7 additions & 0 deletions app/Services/Model/ISummitOrderService.php
Original file line number Diff line number Diff line change
Expand Up @@ -436,4 +436,11 @@ public function delegateTicket(Summit $summit, int $order_id, int $ticket_id,Mem
* @return void
*/
public function ingestPaymentInfoForRegistrationOrders():void;

/**
* @param int $order_id
* @param int $request_id
* @return void
*/
public function processPaymentGatewayRefundRequest(int $order_id, int $request_id):void;
}
Loading