feat : refund
This commit is contained in:
31
app/Service/ServiceTrait/Api/PayFinishTrait.php
Normal file
31
app/Service/ServiceTrait/Api/PayFinishTrait.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\Service\ServiceTrait\Api;
|
||||
|
||||
use App\Constants\Common\PayCode;
|
||||
use App\Exception\ErrException;
|
||||
use Psr\Container\ContainerExceptionInterface;
|
||||
use Psr\Container\NotFoundExceptionInterface;
|
||||
|
||||
trait PayFinishTrait
|
||||
{
|
||||
|
||||
/**
|
||||
* 操作微信订单
|
||||
* @return void
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
protected function manageWxOrder(): void
|
||||
{
|
||||
$this->payInfo->status = PayCode::FINISH_PAY;
|
||||
$this->payInfo->wx_transaction_id = $this->callbackData['transaction_id'];
|
||||
$this->payInfo->notify_json = json_encode($this->callbackData);
|
||||
|
||||
if (!$this->orderInfo->save()) {
|
||||
$this->log->debug(__CLASS__.':Function:manageWxOrder:更新充值订单的状态失败:'.$this->payInfo->id);
|
||||
throw new ErrException('更新充值订单的状态失败');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user