| 1 | <?php |
||
| 2 | |||
| 3 | namespace ByTIC\Omnipay\Twispay\Message\Traits; |
||
| 4 | |||
| 5 | use ByTIC\Omnipay\Common\Message\Traits\GatewayNotificationRequestTrait; |
||
| 6 | use ByTIC\Omnipay\Twispay\Helper; |
||
| 7 | |||
| 8 | /** |
||
| 9 | * Trait CompletePurchaseRequestTrait |
||
| 10 | * @package ByTIC\Omnipay\Twispay\Message\Traits |
||
| 11 | */ |
||
| 12 | trait CompletePurchaseRequestTrait |
||
| 13 | { |
||
| 14 | use GatewayNotificationRequestTrait; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * @return bool|mixed |
||
| 18 | */ |
||
| 19 | protected function parseNotification() |
||
| 20 | { |
||
| 21 | $dataResult = $this->hasPOST('opensslResult') |
||
| 22 | ? $this->httpRequest->request->get('opensslResult') |
||
| 23 | : $this->httpRequest->request->get('result'); |
||
| 24 | |||
| 25 | $json = Helper::decrypt($dataResult, $this->getApiKey()); |
||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||
| 26 | $data = json_decode($json, true); |
||
| 27 | return $data; |
||
| 28 | } |
||
| 29 | |||
| 30 | /** |
||
| 31 | * @return mixed |
||
| 32 | */ |
||
| 33 | protected function isValidNotification() |
||
| 34 | { |
||
| 35 | return $this->hasGet('id') && ($this->hasPOST('opensslResult') || $this->hasPOST('result')); |
||
| 36 | } |
||
| 37 | } |
||
| 38 |