Conditions | 1 |
Paths | 1 |
Total Lines | 17 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 1.0156 |
Changes | 0 |
1 | <?php |
||
25 | 3 | public function toPay(string $gateway, array $payload) : Response |
|
26 | { |
||
27 | 3 | $key = $this->config->get('private_key'); |
|
28 | 3 | $content = array_merge( |
|
29 | 3 | Arr::get($payload, 'biz_content'), |
|
30 | 3 | Constant::ALI_PAY_WEB_PRO_CODE |
|
31 | ); |
||
32 | 3 | self::check($content); |
|
33 | 3 | $payload['method'] = Constant::ALI_PAY_WEB_PAY; |
|
34 | 3 | $payload['biz_content'] = json_encode($content); |
|
35 | 3 | $payload['sign'] = self::generateSign($payload, $key); |
|
36 | |||
37 | Log::debug('Web order:', [$gateway, $payload]); |
||
38 | |||
39 | $body = $this->buildRequestForm($gateway, $payload); |
||
40 | |||
41 | return Response::create($body); |
||
42 | } |
||
44 |