Conditions | 2 |
Paths | 2 |
Total Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
28 | public function pay($endpoint, array $payload): Collection |
||
29 | { |
||
30 | if (empty(json_decode($payload['biz_content'], true)['buyer_id'])) { |
||
31 | throw new \Yansongda\Pay\Exceptions\InvalidArgumentException('buyer_id required'); |
||
32 | } |
||
33 | |||
34 | $payload['method'] = $this->getMethod(); |
||
35 | $payload['sign'] = Support::generateSign($payload); |
||
36 | |||
37 | Events::dispatch(Events::PAY_STARTED, new Events\PayStarted('Alipay', 'Mini', $endpoint, $payload)); |
||
38 | |||
39 | return Support::requestApi($payload); |
||
40 | } |
||
41 | |||
54 |