| Total Complexity | 7 |
| Total Lines | 39 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | class GetSatStatusService |
||
| 11 | { |
||
| 12 | /** @var FinkokSettings */ |
||
| 13 | private $settings; |
||
| 14 | |||
| 15 | 4 | public function __construct(FinkokSettings $settings) |
|
| 16 | { |
||
| 17 | 4 | $this->settings = $settings; |
|
| 18 | } |
||
| 19 | |||
| 20 | 3 | public function settings(): FinkokSettings |
|
| 23 | } |
||
| 24 | |||
| 25 | 3 | public function query(GetSatStatusCommand $command): GetSatStatusResult |
|
| 26 | { |
||
| 27 | 3 | $soapCaller = $this->settings()->createCallerForService(Services::cancel()); |
|
| 28 | 3 | $rawResponse = $soapCaller->call('get_sat_status', [ |
|
| 29 | 3 | 'taxpayer_id' => $command->rfcIssuer(), |
|
| 30 | 3 | 'rtaxpayer_id' => $command->rfcRecipient(), |
|
| 31 | 3 | 'uuid' => $command->uuid(), |
|
| 32 | 3 | 'total' => $command->total(), |
|
| 33 | 3 | ]); |
|
| 34 | 3 | return new GetSatStatusResult($rawResponse); |
|
| 35 | } |
||
| 36 | |||
| 37 | 1 | public function queryUntilFoundOrTime(GetSatStatusCommand $command, int $waitSeconds = 120): GetSatStatusResult |
|
| 49 | } |
||
| 50 | } |
||
| 51 |