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

PosPreAuthPlugin   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A assembly() 0 16 1
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=797&apiservId=468&version=V2.2&bussType=0
14
 */
15
class PosPreAuthPlugin implements PluginInterface
16
{
17
    public function assembly(Rocket $rocket, Closure $next): Rocket
18
    {
19
        Logger::debug('[Unipay][QrCode][PosPreAuthPlugin] 插件开始装载', ['rocket' => $rocket]);
20
21
        $rocket->mergePayload([
22
            '_url' => 'gateway/api/backTransReq.do',
23
            'bizType' => '000201',
24
            'accessType' => '0',
25
            'txnType' => '02',
26
            'txnSubType' => '04',
27
            'channelType' => '08',
28
        ]);
29
30
        Logger::info('[Unipay][QrCode][PosPreAuthPlugin] 插件装载完毕', ['rocket' => $rocket]);
31
32
        return $next($rocket);
33
    }
34
}
35