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