Files
hyperf_service/app/Service/Amqp/Refund/FullRefundOrderService.php
2025-03-21 15:14:43 +08:00

54 lines
1.1 KiB
PHP

<?php
/**
* This service file is part of item.
*
* @author ctexthuang
* @contact ctexthuang@qq.com
*/
declare(strict_types=1);
namespace App\Service\Amqp\Refund;
use App\Constants\Common\OrderCode;
use Exception;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;
class FullRefundOrderService extends BaseRefundOrderService
{
/**
* @var int
*/
protected int $orderType = OrderCode::ORDER_TYPE_GOOD;
/**
* @return void
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
* @throws Exception
*/
public function handle(): void
{
try {
$this->getOrderInfo();
$this->checkGoodOrder();
$this->getPayOrder();
$this->getRefundAmount();
$this->insertRefundOrder();
$this->refund();
$this->updateRefund();
} catch (Exception $e) {
$errArr = explode(":", $e->getMessage());
$errMsg = $errArr[0];
$this->updateError($errMsg);
throw new Exception($e->getMessage());
}
}
}