Conditions | 1 |
Paths | 1 |
Total Lines | 14 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 1 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
20 | 6 | public function createToken(string $transactionId, array $guzzleOptions = []): string |
|
21 | { |
||
22 | 6 | $parameters = ['transactionId' => $transactionId]; |
|
23 | |||
24 | 6 | $response = $this->client->post( |
|
25 | 6 | $this->client->getApiUrl()->withPath('/acquiring/v1/cards/tokens'), |
|
26 | 6 | array_merge_recursive( |
|
27 | 2 | [RequestOptions::JSON => $parameters], |
|
28 | 6 | $this->client->authenticateWithBearerToken(), |
|
29 | $guzzleOptions |
||
30 | ) |
||
31 | ); |
||
32 | |||
33 | 3 | return strval($response['token'] ?? ''); |
|
34 | } |
||
36 |