Issues (10)

Message/Traits/CompletePurchaseRequestTrait.php (1 issue)

Labels
Severity
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
It seems like getApiKey() 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 ignore-call  annotation

25
        $json = Helper::decrypt($dataResult, $this->/** @scrutinizer ignore-call */ getApiKey());
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