AppPayPlugin   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
c 1
b 0
f 0
dl 0
loc 15
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A assembly() 0 13 1
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