| Total Complexity | 7 |
| Total Lines | 61 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 12 | class CrefoPayOmsStatusMapper implements CrefoPayOmsStatusMapperInterface |
||
| 13 | { |
||
| 14 | /** |
||
| 15 | * @var \SprykerEco\Zed\CrefoPay\CrefoPayConfig |
||
| 16 | */ |
||
| 17 | protected $config; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * @param \SprykerEco\Zed\CrefoPay\CrefoPayConfig $config |
||
| 21 | */ |
||
| 22 | public function __construct(CrefoPayConfig $config) |
||
| 23 | { |
||
| 24 | $this->config = $config; |
||
| 25 | } |
||
| 26 | |||
| 27 | /** |
||
| 28 | * @param string $apiStatus |
||
| 29 | * |
||
| 30 | * @return string|null |
||
| 31 | */ |
||
| 32 | public function mapNotificationTransactionStatusToOmsStatus(string $apiStatus): ?string |
||
| 33 | { |
||
| 34 | $statuses = $this->getNotificationTransactionToOmsStatusMapping(); |
||
| 35 | |||
| 36 | if (!isset($statuses[$apiStatus])) { |
||
| 37 | return null; |
||
| 38 | } |
||
| 39 | |||
| 40 | return $statuses[$apiStatus]; |
||
| 41 | } |
||
| 42 | |||
| 43 | /** |
||
| 44 | * @param string $apiStatus |
||
| 45 | * |
||
| 46 | * @return string|null |
||
| 47 | */ |
||
| 48 | public function mapNotificationOrderStatusToOmsStatus(string $apiStatus): ?string |
||
| 57 | } |
||
| 58 | |||
| 59 | /** |
||
| 60 | * @return string[] |
||
| 61 | */ |
||
| 62 | protected function getNotificationTransactionToOmsStatusMapping(): array |
||
| 65 | } |
||
| 66 | |||
| 67 | /** |
||
| 68 | * @return string[] |
||
| 69 | */ |
||
| 70 | protected function getNotificationOrderToOmsStatusMapping(): array |
||
| 73 | } |
||
| 74 | } |
||
| 75 |