init
- 框架初始化 - 安装插件 - 修复PHP8.4报错
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Plugin\Alipay;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Pay\Contract\PluginInterface;
|
||||
use Yansongda\Pay\Logger;
|
||||
use Yansongda\Pay\Rocket;
|
||||
|
||||
abstract class GeneralPlugin implements PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||
{
|
||||
Logger::debug('[alipay][GeneralPlugin] 通用插件开始装载', ['rocket' => $rocket]);
|
||||
|
||||
$this->doSomethingBefore($rocket);
|
||||
|
||||
$rocket->mergePayload([
|
||||
'method' => $this->getMethod(),
|
||||
'biz_content' => $rocket->getParams(),
|
||||
]);
|
||||
|
||||
Logger::info('[alipay][GeneralPlugin] 通用插件装载完毕', ['rocket' => $rocket]);
|
||||
|
||||
return $next($rocket);
|
||||
}
|
||||
|
||||
protected function doSomethingBefore(Rocket $rocket): void
|
||||
{
|
||||
}
|
||||
|
||||
abstract protected function getMethod(): string;
|
||||
}
|
||||
Reference in New Issue
Block a user