Issues (5)

Security Analysis    not enabled

This project does not seem to handle request data directly as such no vulnerable execution paths were found.

  Cross-Site Scripting
Cross-Site Scripting enables an attacker to inject code into the response of a web-request that is viewed by other users. It can for example be used to bypass access controls, or even to take over other users' accounts.
  File Exposure
File Exposure allows an attacker to gain access to local files that he should not be able to access. These files can for example include database credentials, or other configuration files.
  File Manipulation
File Manipulation enables an attacker to write custom data to files. This potentially leads to injection of arbitrary code on the server.
  Object Injection
Object Injection enables an attacker to inject an object into PHP code, and can lead to arbitrary code execution, file exposure, or file manipulation attacks.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  File Inclusion
File Inclusion enables an attacker to inject custom files into PHP's file loading mechanism, either explicitly passed to include, or for example via PHP's auto-loading mechanism.
  Command Injection
Command Injection enables an attacker to inject a shell command that is execute with the privileges of the web-server. This can be used to expose sensitive data, or gain access of your server.
  SQL Injection
SQL Injection enables an attacker to execute arbitrary SQL code on your database server gaining access to user data, or manipulating user data.
  XPath Injection
XPath Injection enables an attacker to modify the parts of XML document that are read. If that XML document is for example used for authentication, this can lead to further vulnerabilities similar to SQL Injection.
  LDAP Injection
LDAP Injection enables an attacker to inject LDAP statements potentially granting permission to run unauthorized queries, or modify content inside the LDAP tree.
  Header Injection
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  XML Injection
XML Injection enables an attacker to read files on your local filesystem including configuration files, or can be abused to freeze your web-server process.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
Unfortunately, the security analysis is currently not available for your project. If you are a non-commercial open-source project, please contact support to gain access.

src/Message/AbstractRequest.php (2 issues)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
/*
4
 * WebMoney driver for the Omnipay PHP payment processing library
5
 *
6
 * @link      https://github.com/ck-developer/omnipay-payline
7
 * @package   omnipay-payline
8
 * @license   MIT
9
 * @copyright Copyright (c) 2016 Claude Khedhiri <[email protected]>
10
 */
11
12
namespace Omnipay\Payline\Message;
13
14
use Symfony\Component\HttpFoundation\Request as HttpRequest;
15
16
/**
17
 * Abstract Request.
18
 */
19
abstract class AbstractRequest extends \Omnipay\Common\Message\AbstractRequest
20
{
21
    /**
22
     * AbstractRequest constructor.
23
     *
24
     * @param \SoapClient $httpClient
25
     * @param HttpRequest $httpRequest
26
     */
27 33
    public function __construct(\SoapClient $httpClient, HttpRequest $httpRequest)
0 ignored issues
show
You have injected the Request via parameter $httpRequest. This is generally not recommended as there might be multiple instances during a request cycle (f.e. when using sub-requests). Instead, it is recommended to inject the RequestStack and retrieve the current request each time you need it via getCurrentRequest().
Loading history...
28
    {
29 33
        $this->initialize();
30 33
        $this->httpClient = $httpClient;
0 ignored issues
show
Documentation Bug introduced by
It seems like $httpClient of type object<SoapClient> is incompatible with the declared type object<Guzzle\Http\ClientInterface> of property $httpClient.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
31 33
        $this->httpRequest = $httpRequest;
32 33
    }
33
34
    /**
35
     * @return string
36
     */
37 12
    public function getMerchantId()
38
    {
39 12
        return $this->getParameter('merchantId');
40
    }
41
42
    /**
43
     * @param string $merchantId
44
     *
45
     * @return $this
46
     */
47 33
    public function setMerchantId($merchantId)
48
    {
49 33
        return $this->setParameter('merchantId', $merchantId);
50
    }
51
52
    /**
53
     * @return string
54
     */
55 12
    public function getAccessKey()
56
    {
57 12
        return $this->getParameter('accessKey');
58
    }
59
60
    /**
61
     * @param string $accessKey
62
     *
63
     * @return $this
64
     */
65 33
    public function setAccessKey($accessKey)
66
    {
67 33
        return $this->setParameter('accessKey', $accessKey);
68
    }
69
70
    /**
71
     * @return string
72
     */
73 18
    public function getContractNumber()
74
    {
75 18
        return $this->getParameter('contractNumber');
76
    }
77
78
    /**
79
     * @param string $contractNumber
80
     *
81
     * @return $this
82
     */
83 33
    public function setContractNumber($contractNumber)
84
    {
85 33
        return $this->setParameter('contractNumber', $contractNumber);
86 2
    }
87
88
    /**
89
     * @return string
90
     */
91 12
    public function getProxyHost()
92
    {
93 12
        return $this->getParameter('proxyHost');
94
    }
95
96
    /**
97
     * @param string $proxyHost
98
     *
99
     * @return $this
100
     */
101 33
    public function setProxyHost($proxyHost)
102
    {
103 33
        return $this->setParameter('proxyHost', $proxyHost);
104
    }
105
106
    /**
107
     * @return string
108
     */
109 12
    public function getProxyPort()
110
    {
111 12
        return $this->getParameter('proxyPort');
112
    }
113
114
    /**
115
     * @param string $proxyPort
116
     *
117
     * @return $this
118
     */
119 33
    public function setProxyPort($proxyPort)
120
    {
121 33
        return $this->setParameter('proxyPort', $proxyPort);
122
    }
123
124
    /**
125
     * @return string
126
     */
127 12
    public function getProxyLogin()
128
    {
129 12
        return $this->getParameter('proxyLogin');
130
    }
131
132
    /**
133
     * @param string $proxyLogin
134
     *
135
     * @return $this
136
     */
137 33
    public function setProxyLogin($proxyLogin)
138
    {
139 33
        return $this->setParameter('proxyLogin', $proxyLogin);
140
    }
141
142
    /**
143
     * @return string
144
     */
145 12
    public function getProxyPassword()
146
    {
147 12
        return $this->getParameter('proxyPassword');
148
    }
149
150
    /**
151
     * @param string $proxyPassword
152
     *
153
     * @return $this
154
     */
155 33
    public function setProxyPassword($proxyPassword)
156
    {
157 33
        return $this->setParameter('proxyPassword', $proxyPassword);
158
    }
159
160
    public function getMethod()
161
    {
162
        return $this->getParameter('method');
163
    }
164
165 6
    protected function getBaseData()
166
    {
167
        $data = array(
168 6
            'payment' => array('contractNumber' => $this->getContractNumber()),
169 6
            'returnURL' => '',
170 6
            'cancelURL' => '',
171 6
            'notificationURL' => '',
172 4
        );
173 6
        return $data;
174
    }
175
176 9
    public function sendData($data)
177
    {
178 9
        $response = $this->httpClient->{$this->getMethod()}($data);
179
180 9
        return $this->createResponse($response);
181
    }
182
183
    /**
184
     * Get the response from request.
185
     *
186
     * @param \stdClass $data
187
     *
188
     * @return AbstractResponse
189
     */
190
    abstract protected function createResponse($data);
191
}
192