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