mirror of
https://gitee.com/technical-laohu/mpay_v2_webman.git
synced 2026-05-17 06:20:25 +08:00
feat: 完善支付通道和收款监听链路
新增 ChannelNotifyPayloadInterface 等支付插件通知契约,规范 pay_no 定位和插件返回校验。 新增微信、支付宝、收钱吧、Postar 个人收款插件适配,支持余额识别与备注识别。 新增 receipt-watcher 后端进程、Redis 队列 job 和平台事件监听,覆盖收款流水通知、商户通知、退款派发、转账派发与清算完成。 补齐个人收款监听相关系统配置、仓储、服务费冻结明细、订单后台操作和通道测试能力。 重构支付单创建、回调、费用、风控、结算和通道统计链路,统一状态流转与幂等处理。
This commit is contained in:
@@ -5,6 +5,7 @@ namespace app\http\admin\controller\payment;
|
||||
use app\common\base\BaseController;
|
||||
use app\http\admin\validation\PaymentChannelValidator;
|
||||
use app\service\payment\config\PaymentChannelService;
|
||||
use app\service\payment\config\PaymentChannelTestService;
|
||||
use support\Request;
|
||||
use support\Response;
|
||||
|
||||
@@ -14,6 +15,7 @@ use support\Response;
|
||||
* 负责支付通道的列表、详情、新增、修改和删除。
|
||||
*
|
||||
* @property PaymentChannelService $paymentChannelService 支付渠道服务
|
||||
* @property PaymentChannelTestService $paymentChannelTestService 支付通道测试服务
|
||||
*/
|
||||
class PaymentChannelController extends BaseController
|
||||
{
|
||||
@@ -21,10 +23,12 @@ class PaymentChannelController extends BaseController
|
||||
* 构造方法。
|
||||
*
|
||||
* @param PaymentChannelService $paymentChannelService 支付渠道服务
|
||||
* @param PaymentChannelTestService $paymentChannelTestService 支付通道测试服务
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(
|
||||
protected PaymentChannelService $paymentChannelService
|
||||
protected PaymentChannelService $paymentChannelService,
|
||||
protected PaymentChannelTestService $paymentChannelTestService
|
||||
) {
|
||||
}
|
||||
|
||||
@@ -157,6 +161,25 @@ class PaymentChannelController extends BaseController
|
||||
|
||||
return $this->success($this->paymentChannelService->searchOptions($request->all(), $page, $pageSize));
|
||||
}
|
||||
|
||||
/**
|
||||
* 发起当前通道测试支付。
|
||||
*
|
||||
* @param Request $request 请求对象
|
||||
* @param string $id 支付渠道ID
|
||||
* @return Response 响应对象
|
||||
*/
|
||||
public function test(Request $request, string $id): Response
|
||||
{
|
||||
$data = $this->validated(
|
||||
array_merge($request->all(), ['id' => (int) $id]),
|
||||
PaymentChannelValidator::class,
|
||||
'test'
|
||||
);
|
||||
$data['client_ip'] = (string) $request->getRealIp();
|
||||
|
||||
return $this->success($this->paymentChannelTestService->submit((int) $data['id'], $data));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user