AppPayPlugin::assembly()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 7
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 13
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yansongda\Pay\Plugin\Alipay\V2\Fund\PCreditPayInstallment;
6
7
use Closure;
8
use Yansongda\Artful\Contract\PluginInterface;
9
use Yansongda\Artful\Direction\ResponseDirection;
10
use Yansongda\Artful\Logger;
11
use Yansongda\Artful\Rocket;
12
13
/**
14
 * @see https://opendocs.alipay.com/open/02np8z?pathHash=994a1e7d&ref=api
15
 */
16
class AppPayPlugin implements PluginInterface
17
{
18
    public function assembly(Rocket $rocket, Closure $next): Rocket
19
    {
20
        Logger::debug('[Alipay][Fund][PCreditPayInstallment][AppPayPlugin] 插件开始装载', ['rocket' => $rocket]);
21
22
        $rocket->setDirection(ResponseDirection::class)
23
            ->mergePayload([
24
                'method' => 'alipay.trade.app.pay',
25
                'biz_content' => $rocket->getParams(),
26
            ]);
27
28
        Logger::info('[Alipay][Fund][PCreditPayInstallment][AppPayPlugin] 插件装载完毕', ['rocket' => $rocket]);
29
30
        return $next($rocket);
31
    }
32
}
33