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\merchant;
|
||||
use app\common\base\BaseController;
|
||||
use app\http\admin\validation\MerchantApiCredentialValidator;
|
||||
use app\http\admin\validation\MerchantValidator;
|
||||
use app\service\merchant\auth\MerchantAuthService;
|
||||
use app\service\merchant\MerchantService;
|
||||
use support\Request;
|
||||
use support\Response;
|
||||
@@ -25,7 +26,8 @@ class MerchantController extends BaseController
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(
|
||||
protected MerchantService $merchantService
|
||||
protected MerchantService $merchantService,
|
||||
protected MerchantAuthService $merchantAuthService
|
||||
) {
|
||||
}
|
||||
|
||||
@@ -127,6 +129,34 @@ class MerchantController extends BaseController
|
||||
return $this->success($this->merchantService->resetPassword((int) $data['id'], (string) $data['password']));
|
||||
}
|
||||
|
||||
/**
|
||||
* 签发商户后台临时登录令牌。
|
||||
*
|
||||
* 该入口只在管理后台登录态下可用,用于客服或运营从商户工作台直接进入当前商户后台。
|
||||
*
|
||||
* @param Request $request 请求对象
|
||||
* @param string $id 商户ID
|
||||
* @return Response 响应对象
|
||||
*/
|
||||
public function loginToken(Request $request, string $id): Response
|
||||
{
|
||||
$data = $this->validated(['id' => (int) $id], MerchantValidator::class, 'loginToken');
|
||||
$merchant = $this->merchantService->ensureMerchantEnabled((int) $data['id']);
|
||||
$issued = $this->merchantAuthService->issueToken(
|
||||
(int) $merchant->id,
|
||||
3600,
|
||||
(string) $request->getRealIp(),
|
||||
(string) $request->header('user-agent', '')
|
||||
);
|
||||
|
||||
return $this->success([
|
||||
'token' => (string) $issued['token'],
|
||||
'expires_in' => (int) $issued['expires_in'],
|
||||
'merchant_id' => (int) $merchant->id,
|
||||
'merchant_no' => (string) $merchant->merchant_no,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成或重置商户 API 凭证。
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user