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

RefundPlugin::getUri()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

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