| 1 | <?php |
||||||
| 2 | |||||||
| 3 | namespace ByTIC\Payments\Mobilpay\Message\Traits; |
||||||
| 4 | |||||||
| 5 | use ByTIC\Payments\Gateways\Providers\AbstractGateway\Message\Traits\HasGatewayRequestTrait; |
||||||
| 6 | use ByTIC\Payments\Gateways\Providers\AbstractGateway\Message\Traits\HasModelRequest; |
||||||
| 7 | use ByTIC\Payments\Mobilpay\Gateway; |
||||||
| 8 | |||||||
| 9 | /** |
||||||
| 10 | * Trait CompletePurchaseRequestTrait |
||||||
| 11 | * @package ByTIC\Payments\Mobilpay\Message\Traits |
||||||
| 12 | */ |
||||||
| 13 | trait CompletePurchaseRequestTrait |
||||||
| 14 | { |
||||||
| 15 | use HasGatewayRequestTrait; |
||||||
| 16 | use HasModelRequest; |
||||||
| 17 | |||||||
| 18 | |||||||
| 19 | /** |
||||||
| 20 | * @return bool|mixed |
||||||
| 21 | * @throws \Exception |
||||||
| 22 | */ |
||||||
| 23 | protected function parseNotification() |
||||||
| 24 | { |
||||||
| 25 | if ($this->validateModel()) { |
||||||
| 26 | $model = $this->getModel(); |
||||||
| 27 | $this->updateParametersFromPurchase($model); |
||||||
| 28 | } |
||||||
| 29 | |||||||
| 30 | return parent::parseNotification(); |
||||||
| 31 | } |
||||||
| 32 | |||||||
| 33 | /** |
||||||
| 34 | * @param Gateway $modelGateway |
||||||
| 35 | */ |
||||||
| 36 | protected function updateParametersFromGateway($modelGateway) |
||||||
| 37 | { |
||||||
| 38 | $this->setSignature($modelGateway->getSignature()); |
||||||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||||||
| 39 | $this->setCertificate($modelGateway->getCertificate()); |
||||||
|
0 ignored issues
–
show
It seems like
setCertificate() must be provided by classes using this trait. How about adding it as abstract method to this trait?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||||
| 40 | $this->setPrivateKey($modelGateway->getPrivateKey()); |
||||||
|
0 ignored issues
–
show
It seems like
setPrivateKey() must be provided by classes using this trait. How about adding it as abstract method to this trait?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||||
| 41 | } |
||||||
| 42 | } |
||||||
| 43 |