QueryCallbackPlugin::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\Wechat\V3\Extend\Complaints;
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://pay.weixin.qq.com/docs/merchant/apis/consumer-complaint/complaint-notifications/query-complaint-notifications.html
14
 * @see https://pay.weixin.qq.com/docs/partner/apis/consumer-complaint/complaint-notifications/query-complaint-notifications.html
15
 */
16
class QueryCallbackPlugin implements PluginInterface
17
{
18
    public function assembly(Rocket $rocket, Closure $next): Rocket
19
    {
20
        Logger::debug('[Wechat][Extend][Complaints][QueryCallbackPlugin] 插件开始装载', ['rocket' => $rocket]);
21
22
        $rocket->setPayload([
23
            '_method' => 'GET',
24
            '_url' => 'v3/merchant-service/complaint-notifications',
25
            '_service_url' => 'v3/merchant-service/complaint-notifications',
26
        ]);
27
28
        Logger::info('[Wechat][Extend][Complaints][QueryCallbackPlugin] 插件装载完毕', ['rocket' => $rocket]);
29
30
        return $next($rocket);
31
    }
32
}
33