Passed
Pull Request — master (#913)
by Songda
01:55
created

QueryPlugin::assembly()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 16
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 10
c 0
b 0
f 0
dl 0
loc 16
rs 9.9332
cc 1
nc 1
nop 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yansongda\Pay\Plugin\Unipay\QrCode;
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://open.unionpay.com/tjweb/acproduct/APIList?acpAPIId=792&apiservId=468&version=V2.2&bussType=0
14
 */
15
class QueryPlugin implements PluginInterface
16
{
17
    public function assembly(Rocket $rocket, Closure $next): Rocket
18
    {
19
        Logger::debug('[Unipay][QrCode][QueryPlugin] 插件开始装载', ['rocket' => $rocket]);
20
21
        $rocket->mergePayload([
22
            '_url' => 'gateway/api/backTransReq.do',
23
            '_sandbox_url' => 'https://101.231.204.80:5000/gateway/api/backTransReq.do',
24
            'bizType' => '000000',
25
            'accessType' => '0',
26
            'txnType' => '00',
27
            'txnSubType' => '00',
28
        ]);
29
30
        Logger::info('[Unipay][QrCode][QueryPlugin] 插件装载完毕', ['rocket' => $rocket]);
31
32
        return $next($rocket);
33
    }
34
}
35