Conditions | 1 |
Paths | 1 |
Total Lines | 14 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
21 | public function toPay(string $gateway, array $payload) : Response |
||
22 | { |
||
23 | $key = $this->config->get('private_key'); |
||
24 | $content = array_merge( |
||
25 | Arr::get($payload, 'biz_content'), |
||
26 | Constant::ALI_PAY_APP_PRO_CODE |
||
27 | ); |
||
28 | self::check($content); |
||
29 | $payload['method'] = Constant::ALI_PAY_APP_PAY; |
||
30 | $payload['biz_content'] = json_encode($content); |
||
31 | $payload['sign'] = self::generateSign($payload, $key); |
||
32 | $body = http_build_query($payload); |
||
33 | |||
34 | return Response::create($body); |
||
35 | } |
||
37 |