| Total Complexity | 7 |
| Total Lines | 53 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 16 | class CompletePurchaseRequest extends AbstractCompletePurchaseRequest |
||
| 17 | { |
||
| 18 | use HasModelRequest; |
||
|
|
|||
| 19 | |||
| 20 | /** |
||
| 21 | * @inheritdoc |
||
| 22 | */ |
||
| 23 | public function getData() |
||
| 24 | { |
||
| 25 | $return = parent::getData(); |
||
| 26 | // Add model only if has data |
||
| 27 | if (count($return) && $this->validateModel()) { |
||
| 28 | $return['model'] = $this->getModel(); |
||
| 29 | } |
||
| 30 | |||
| 31 | return $return; |
||
| 32 | } |
||
| 33 | |||
| 34 | /** |
||
| 35 | * @inheritDoc |
||
| 36 | */ |
||
| 37 | public function getModelIdFromRequest() |
||
| 42 | } |
||
| 43 | |||
| 44 | /** |
||
| 45 | * @return bool|mixed |
||
| 46 | * @throws \Exception |
||
| 47 | */ |
||
| 48 | protected function parseNotification() |
||
| 49 | { |
||
| 50 | if ($this->validateModel()) { |
||
| 51 | $model = $this->getModel(); |
||
| 52 | $this->updateParametersFromModel($model); |
||
| 53 | } |
||
| 54 | |||
| 55 | return parent::parseNotification(); |
||
| 56 | } |
||
| 57 | |||
| 58 | /** |
||
| 59 | * @param IsPurchasableModelTrait $model |
||
| 60 | * |
||
| 61 | * @throws \Exception |
||
| 62 | */ |
||
| 63 | protected function updateParametersFromModel($model) |
||
| 69 | } |
||
| 70 | } |
||
| 71 |