Passed
Push — master ( bd56ba...e02069 )
by Songda
09:11 queued 07:22
created

AgreementUnsignPlugin   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A assembly() 0 15 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yansongda\Pay\Plugin\Alipay\User;
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/02fkap?ref=api&scene=90766afb41f74df6ae1676e89625ebac
14
 */
15
class AgreementUnsignPlugin implements PluginInterface
16
{
17
    public function assembly(Rocket $rocket, Closure $next): Rocket
18
    {
19
        Logger::info('[alipay][AgreementUnsignPlugin] 插件开始装载', ['rocket' => $rocket]);
20
21
        $rocket->mergePayload([
22
            'method' => 'alipay.user.agreement.unsign',
23
            'biz_content' => array_merge(
24
                ['personal_product_code' => 'CYCLE_PAY_AUTH_P'],
25
                $rocket->getParams()
26
            ),
27
        ]);
28
29
        Logger::info('[alipay][AgreementUnsignPlugin] 插件装载完毕', ['rocket' => $rocket]);
30
31
        return $next($rocket);
32
    }
33
}
34