Conditions | 2 |
Paths | 2 |
Total Lines | 14 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
41 | public function getCode() |
||
42 | { |
||
43 | $data = [ |
||
44 | 'suite_id' => $this->getSuiteId(), |
||
45 | ]; |
||
46 | |||
47 | $result = $this->parseJSON('json', [self::GET_PRE_AUTH_CODE, $data]); |
||
48 | |||
49 | if (empty($result['pre_auth_code'])) { |
||
50 | throw new InvalidArgumentException('Invalid response.'); |
||
51 | } |
||
52 | |||
53 | return $result['pre_auth_code']; |
||
54 | } |
||
55 | } |
||
56 |