| Conditions | 1 |
| Paths | 1 |
| Total Lines | 13 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 1 |
| Changes | 0 | ||
| 1 | <?php |
||
| 26 | 1 | public function getToken(): array |
|
| 27 | { |
||
| 28 | 1 | $authUri = $this->config->get('airtel-money.authorization.token_uri'); |
|
| 29 | |||
| 30 | 1 | $response = $this->http->request('POST', $authUri, [ |
|
| 31 | 1 | 'json' => [ |
|
| 32 | 1 | 'client_id' => $this->config->get('airtel-money.client_id'), |
|
| 33 | 1 | 'client_secret' => $this->config->get('airtel-money.client_secret'), |
|
| 34 | 1 | 'grant_type' => 'client_credentials', |
|
| 35 | 1 | ], |
|
| 36 | 1 | ]); |
|
| 37 | |||
| 38 | 1 | return json_decode((string) $response->getBody(), true); |
|
| 39 | } |
||
| 41 |