Completed
Push — master ( 56c44b...57c31b )
by Songda
05:33 queued 11s
created

WapPayPlugin::apply()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 14

Duplication

Lines 14
Ratio 100 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 3
dl 14
loc 14
rs 9.7998
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yansongda\Pay\Plugin\Alipay\Trade;
6
7
use Closure;
8
use Yansongda\Pay\Contract\PluginInterface;
9
use Yansongda\Pay\Packer\ResponsePacker;
10
use Yansongda\Pay\Rocket;
11
12
class WapPayPlugin implements PluginInterface
13
{
14
    public function assembly(Rocket $rocket, Closure $next): Rocket
15
    {
16
        $rocket->setDirection(ResponsePacker::class)
17
            ->mergePayload([
18
            'method' => 'alipay.trade.wap.pay',
19
            'biz_content' => array_merge(
20
                [
21
                    'product_code' => 'QUICK_WAP_PAY',
22
                ],
23
                $rocket->getParams(),
24
            ),
0 ignored issues
show
Bug introduced by
This code did not parse for me. Apparently, there is an error somewhere around this line:

Syntax error, unexpected ')'
Loading history...
25
        ]);
26
27
        return $next($rocket);
28
    }
29
}
30