AppInitPlugin::assembly()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 18
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 9
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 18
rs 9.9666
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yansongda\Pay\Plugin\Alipay\V2\Member\FaceVerification;
6
7
use Closure;
8
use Yansongda\Artful\Contract\PluginInterface;
9
use Yansongda\Artful\Logger;
10
use Yansongda\Artful\Rocket;
11
12
/**
13
 * @see https://opendocs.alipay.com/open/04jg6r?pathHash=0572cc86&ref=api&scene=common
14
 */
15
class AppInitPlugin implements PluginInterface
16
{
17
    public function assembly(Rocket $rocket, Closure $next): Rocket
18
    {
19
        Logger::debug('[Alipay][Member][FaceVerification][AppInitPlugin] 插件开始装载', ['rocket' => $rocket]);
20
21
        $rocket->mergePayload([
22
            'method' => 'datadigital.fincloud.generalsaas.face.verification.initialize',
23
            'biz_content' => array_merge(
24
                [
25
                    'biz_code' => 'DATA_DIGITAL_BIZ_CODE_FACE_VERIFICATION',
26
                    'identity_type' => 'CERT_INFO',
27
                ],
28
                $rocket->getParams(),
29
            ),
30
        ]);
31
32
        Logger::info('[Alipay][Member][FaceVerification][AppInitPlugin] 插件装载完毕', ['rocket' => $rocket]);
33
34
        return $next($rocket);
35
    }
36
}
37