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