| Conditions | 4 |
| Paths | 2 |
| Total Lines | 17 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 4.25 |
| Changes | 3 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 25 | 11 | public function stamp(StampingCommand $command): StampingResult |
|
| 26 | { |
||
| 27 | 11 | $soapCaller = $this->settings()->createCallerForService(Services::stamping()); |
|
| 28 | // Finkok, repeat to fix bad webservice behavior of remote stamp method |
||
| 29 | // This will not be fixed according to Finkok |
||
| 30 | do { |
||
| 31 | 11 | $rawResponse = $soapCaller->call('stamp', [ |
|
| 32 | 11 | 'xml' => $command->xml(), |
|
| 33 | 11 | ]); |
|
| 34 | 11 | $result = new StampingResult('stampResult', $rawResponse); |
|
| 35 | 11 | if (null !== $result->alerts()->findByErrorCode('307') && '' === $result->uuid()) { |
|
| 36 | usleep(200000); // 0.2 seconds |
||
| 37 | continue; |
||
| 38 | } |
||
| 39 | 11 | break; |
|
| 40 | } while (true); |
||
| 41 | 11 | return $result; |
|
| 42 | } |
||
| 44 |