Issues (5)

Security Analysis    not enabled

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

  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.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  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.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  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.
  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.
  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.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
  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.
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  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.
  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.
  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.
  Header Injection
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 (1 issue)

Severity
1
<?php
2
3
4
namespace Omnipay\MyCard\Message;
5
6
7
class AbstractRequest extends \Omnipay\Common\Message\AbstractRequest
8
{
9
10
    // 用戶在廠商端的伺服器編號,不可輸入中文
11
    protected $serverId = '';
12
13
14
    // 用戶在廠商端的會員唯一識別編號
15
    protected $accountId = '';
16
17
18
    // 付費方式: 此參數非必填,參數為空時將依 交易金額(Amount)和幣別 (Currency)判斷可用的付費方式 呈現給用戶選擇
19
    protected $paymentType = '';
20
21
22
    // 品項代碼: 此參數非必填,參數為空時將依 交易金額(Amount)和幣別 (Currency)判斷可用的付費方式 呈現給用戶選擇
23
    protected $itemCode = '';
24
25
26
    protected $endpoint = [
27
        'live' => [
28
            'b2b'      => 'https://b2b.mycard520.com.tw',
29
            'redirect' => 'https://www.mycard520.com.tw',
30
        ],
31
        'test' => [
32
            'b2b'      => 'https://test.b2b.mycard520.com.tw',
33
            'redirect' => 'https://test.mycard520.com.tw',
34
        ]
35
    ];
36
37
38
    public function getEndpoint($type = '')
39
    {
40
        $mode = $this->getTestMode() ? 'test' : 'live';
41
        return $this->endpoint[$mode][$type];
42
    }
43
44
45
    public function getAppId()
46
    {
47
        return $this->getParameter('appId');
48
    }
49
50
51
    public function setAppId($value)
52
    {
53
        return $this->setParameter('appId', $value);
54
    }
55
56
57
    public function getAppKey()
58
    {
59
        return $this->getParameter('appKey');
60
    }
61
62
63
    public function setAppKey($value)
64
    {
65
        return $this->setParameter('appKey', $value);
66
    }
67
68
69
    public function setAmount($value)
70
    {
71
        return $this->setParameter('amount', sprintf('%.2f', $value), $value);
0 ignored issues
show
The call to Omnipay\Common\Message\A...Request::setParameter() has too many arguments starting with $value. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

71
        return $this->/** @scrutinizer ignore-call */ setParameter('amount', sprintf('%.2f', $value), $value);

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.

Loading history...
72
    }
73
74
75
    public function getTradeType()
76
    {
77
        return $this->getParameter('tradeType');
78
    }
79
80
81
    public function setTradeType($value)
82
    {
83
        return $this->setParameter('tradeType', $value);
84
    }
85
86
87
    public function getServerId()
88
    {
89
        return $this->getParameter('serverId');
90
    }
91
92
93
    public function setServerId($value)
94
    {
95
        return $this->setParameter('serverId', $value);
96
    }
97
98
99
    public function getAccountId()
100
    {
101
        return $this->getParameter('accountId');
102
    }
103
104
105
    public function setAccountId($value)
106
    {
107
        return $this->setParameter('accountId', $value);
108
    }
109
110
111
    public function getPaymentType()
112
    {
113
        return $this->getParameter('paymentType');
114
    }
115
116
117
    public function setPaymentType($value)
118
    {
119
        return $this->setParameter('paymentType', $value);
120
    }
121
122
123
    public function getItemCode()
124
    {
125
        return $this->getParameter('itemCode');
126
    }
127
128
129
    public function setItemCode($value)
130
    {
131
        return $this->setParameter('itemCode', $value);
132
    }
133
134
135
    public function getData()
136
    {
137
    }
138
139
140
    public function sendData($data)
141
    {
142
    }
143
144
}