Passed
Push — master ( 15fcb4...112125 )
by Songda
02:54 queued 56s
created

H5InitPlugin::assembly()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 17
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

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