This project does not seem to handle request data directly as such no vulnerable execution paths were found.
include
, or for example
via PHP's auto-loading mechanism.
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 | * Payment object representing a DirectCredit payment. |
||
5 | * @author Nicolaas [at] sunnysideup.co.nz |
||
6 | * @package payment |
||
7 | */ |
||
8 | View Code Duplication | class DirectCreditPayment extends EcommercePayment |
|
0 ignored issues
–
show
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.
You can fix this by adding a namespace to your class: namespace YourVendor;
class YourClass { }
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries. ![]() |
|||
9 | { |
||
10 | |||
11 | /** |
||
12 | * Message shown before payment is made |
||
13 | * @var String |
||
14 | */ |
||
15 | private static $before_payment_message = ""; |
||
0 ignored issues
–
show
|
|||
16 | |||
17 | /** |
||
18 | * Message shown after payment is made |
||
19 | * @var String |
||
20 | */ |
||
21 | private static $after_payment_message = ""; |
||
0 ignored issues
–
show
|
|||
22 | |||
23 | /** |
||
24 | * Default Status for Payment |
||
25 | * @var String |
||
26 | */ |
||
27 | private static $default_status = "Pending"; |
||
0 ignored issues
–
show
|
|||
28 | |||
29 | |||
30 | /** |
||
31 | * Process the DirectCredit payment method |
||
32 | */ |
||
33 | public function processPayment($data, $form) |
||
34 | { |
||
35 | $this->Status = Config::inst()->get("DirectCreditPayment", "default_status"); |
||
0 ignored issues
–
show
The property
Status does not seem to exist. Did you mean default_status ?
An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name. If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading. ![]() |
|||
36 | $this->Message = Config::inst()->get("DirectCreditPayment", "after_payment_message"); |
||
0 ignored issues
–
show
The property
Message does not seem to exist. Did you mean before_payment_message ?
An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name. If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading. ![]() |
|||
37 | $this->write(); |
||
38 | return EcommercePayment_Success::create(); |
||
39 | } |
||
40 | |||
41 | public function getPaymentFormFields() |
||
42 | { |
||
43 | return new FieldList( |
||
44 | new LiteralField($this->ClassName.'_BeforeMessage', '<div id="'.$this->ClassName.'_BeforeMessage">' . Config::inst()->get("DirectCreditPayment", "before_payment_message") . '</div>'), |
||
45 | new HiddenField($this->ClassName, $this->ClassName, 0) |
||
46 | ); |
||
47 | } |
||
48 | |||
49 | public function getPaymentFormRequirements() |
||
50 | { |
||
51 | return null; |
||
52 | } |
||
53 | } |
||
54 | |||
55 | View Code Duplication | class DirectCreditPayment_ViaCreditCart extends EcommercePayment |
|
0 ignored issues
–
show
This class seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. ![]() PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.
You can fix this by adding a namespace to your class: namespace YourVendor;
class YourClass { }
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries. ![]() |
|||
56 | { |
||
57 | |||
58 | /** |
||
59 | * Message shown before payment is made |
||
60 | * @var String |
||
61 | */ |
||
62 | private static $before_payment_message = ""; |
||
0 ignored issues
–
show
|
|||
63 | |||
64 | /** |
||
65 | * Message shown after payment is made |
||
66 | * @var String |
||
67 | */ |
||
68 | private static $after_payment_message = ""; |
||
0 ignored issues
–
show
|
|||
69 | |||
70 | /** |
||
71 | * Default Status for Payment |
||
72 | * @var String |
||
73 | */ |
||
74 | private static $default_status = "Pending"; |
||
0 ignored issues
–
show
|
|||
75 | |||
76 | /** |
||
77 | * Process the DirectCredit payment method |
||
78 | */ |
||
79 | public function processPayment($data, $form) |
||
80 | { |
||
81 | $this->Status = Config::inst()->get("DirectCreditPayment_ViaCreditCart", "default_status"); |
||
0 ignored issues
–
show
The property
Status does not seem to exist. Did you mean default_status ?
An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name. If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading. ![]() |
|||
82 | $this->Message = Config::inst()->get("DirectCreditPayment_ViaCreditCart", "after_payment_message"); |
||
0 ignored issues
–
show
The property
Message does not seem to exist. Did you mean before_payment_message ?
An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name. If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading. ![]() |
|||
83 | $this->write(); |
||
84 | return EcommercePayment_Success::create(); |
||
85 | } |
||
86 | |||
87 | public function getPaymentFormFields() |
||
88 | { |
||
89 | return new FieldList( |
||
90 | new LiteralField($this->ClassName.'_BeforeMessage', '<div id="'.$this->ClassName.'_BeforeMessage">' . Config::inst()->get("DirectCreditPayment_ViaCreditCart", "before_payment_message") . '</div>'), |
||
91 | new HiddenField($this->ClassName, $this->ClassName, 0) |
||
92 | ); |
||
93 | } |
||
94 | |||
95 | public function getPaymentFormRequirements() |
||
96 | { |
||
97 | return null; |
||
98 | } |
||
99 | } |
||
100 | |||
101 | View Code Duplication | class DirectCreditPayment_ViaCheque extends EcommercePayment |
|
0 ignored issues
–
show
This class seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. ![]() PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.
You can fix this by adding a namespace to your class: namespace YourVendor;
class YourClass { }
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries. ![]() |
|||
102 | { |
||
103 | |||
104 | /** |
||
105 | * Message shown before payment is made |
||
106 | * @var String |
||
107 | */ |
||
108 | private static $before_payment_message = ""; |
||
0 ignored issues
–
show
|
|||
109 | |||
110 | /** |
||
111 | * Message shown after payment is made |
||
112 | * @var String |
||
113 | */ |
||
114 | private static $after_payment_message = ""; |
||
0 ignored issues
–
show
|
|||
115 | |||
116 | /** |
||
117 | * Default Status for Payment |
||
118 | * @var String |
||
119 | */ |
||
120 | private static $default_status = "Pending"; |
||
0 ignored issues
–
show
|
|||
121 | |||
122 | /** |
||
123 | * Process the DirectCredit payment method |
||
124 | */ |
||
125 | public function processPayment($data, $form) |
||
126 | { |
||
127 | $this->Status = Config::inst()->get("DirectCreditPayment_ViaCheque", "default_status"); |
||
0 ignored issues
–
show
The property
Status does not seem to exist. Did you mean default_status ?
An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name. If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading. ![]() |
|||
128 | $this->Message = Config::inst()->get("DirectCreditPayment_ViaCheque", "after_payment_message"); |
||
0 ignored issues
–
show
The property
Message does not seem to exist. Did you mean before_payment_message ?
An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name. If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading. ![]() |
|||
129 | $this->write(); |
||
130 | return EcommercePayment_Success::create(); |
||
131 | } |
||
132 | |||
133 | public function getPaymentFormFields() |
||
134 | { |
||
135 | return new FieldList( |
||
136 | new LiteralField($this->ClassName.'_BeforeMessage', '<div id="'.$this->ClassName.'_BeforeMessage">' . Config::inst()->get("DirectCreditPayment_ViaCheque", "before_payment_message") . '</div>'), |
||
137 | new HiddenField($this->ClassName, $this->ClassName, 0) |
||
138 | ); |
||
139 | } |
||
140 | |||
141 | public function getPaymentFormRequirements() |
||
142 | { |
||
143 | return null; |
||
144 | } |
||
145 | } |
||
146 | |||
147 | View Code Duplication | class DirectCreditPayment_TESTSUCCESS extends EcommercePayment |
|
0 ignored issues
–
show
This class seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. ![]() PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.
You can fix this by adding a namespace to your class: namespace YourVendor;
class YourClass { }
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries. ![]() |
|||
148 | { |
||
149 | |||
150 | /** |
||
151 | * Message shown before payment is made |
||
152 | * @var String |
||
153 | */ |
||
154 | private static $before_payment_message = "This is for testing purposes only"; |
||
0 ignored issues
–
show
|
|||
155 | |||
156 | /** |
||
157 | * Message shown after payment is made |
||
158 | * @var String |
||
159 | */ |
||
160 | private static $after_payment_message = "Payment is always successful"; |
||
0 ignored issues
–
show
|
|||
161 | |||
162 | /** |
||
163 | * Default Status for Payment |
||
164 | * @var String |
||
165 | */ |
||
166 | private static $default_status = "Success"; |
||
0 ignored issues
–
show
|
|||
167 | |||
168 | /** |
||
169 | * Process the DirectCredit payment method |
||
170 | */ |
||
171 | public function processPayment($data, $form) |
||
172 | { |
||
173 | $this->Status = Config::inst()->get("DirectCreditPayment_TESTSUCCESS", "default_status"); |
||
0 ignored issues
–
show
The property
Status does not seem to exist. Did you mean default_status ?
An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name. If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading. ![]() |
|||
174 | $this->Message = Config::inst()->get("DirectCreditPayment_TESTSUCCESS", "after_payment_message"); |
||
0 ignored issues
–
show
The property
Message does not seem to exist. Did you mean before_payment_message ?
An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name. If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading. ![]() |
|||
175 | $this->write(); |
||
176 | return EcommercePayment_Success::create(); |
||
177 | } |
||
178 | |||
179 | public function getPaymentFormFields() |
||
180 | { |
||
181 | return new FieldList( |
||
182 | new LiteralField($this->ClassName.'_BeforeMessage', '<div id="'.$this->ClassName.'_BeforeMessage">' . Config::inst()->get("DirectCreditPayment_TESTSUCCESS", "before_payment_message") . '</div>'), |
||
183 | new HiddenField($this->ClassName, $this->ClassName, 0) |
||
184 | ); |
||
185 | } |
||
186 | |||
187 | public function getPaymentFormRequirements() |
||
188 | { |
||
189 | return null; |
||
190 | } |
||
191 | } |
||
192 | |||
193 | |||
194 | View Code Duplication | class DirectCreditPayment_TESTFAILURE extends EcommercePayment |
|
0 ignored issues
–
show
This class seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. ![]() PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.
You can fix this by adding a namespace to your class: namespace YourVendor;
class YourClass { }
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries. ![]() |
|||
195 | { |
||
196 | |||
197 | /** |
||
198 | * Message shown before payment is made |
||
199 | * @var String |
||
200 | */ |
||
201 | private static $before_payment_message = "This is for testing purposes only"; |
||
0 ignored issues
–
show
|
|||
202 | |||
203 | /** |
||
204 | * Message shown after payment is made |
||
205 | * @var String |
||
206 | */ |
||
207 | private static $after_payment_message = "Payment is always unsuccessful"; |
||
0 ignored issues
–
show
|
|||
208 | |||
209 | /** |
||
210 | * Default Status for Payment |
||
211 | * @var String |
||
212 | */ |
||
213 | private static $default_status = "Failure"; |
||
0 ignored issues
–
show
|
|||
214 | |||
215 | /** |
||
216 | * Process the DirectCredit payment method |
||
217 | */ |
||
218 | public function processPayment($data, $form) |
||
219 | { |
||
220 | $this->Status = Config::inst()->get("DirectCreditPayment_TESTFAILURE", "default_status"); |
||
0 ignored issues
–
show
The property
Status does not seem to exist. Did you mean default_status ?
An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name. If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading. ![]() |
|||
221 | $this->Message = Config::inst()->get("DirectCreditPayment_TESTFAILURE", "after_payment_message"); |
||
0 ignored issues
–
show
The property
Message does not seem to exist. Did you mean before_payment_message ?
An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name. If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading. ![]() |
|||
222 | $this->write(); |
||
223 | return EcommercePayment_Success::create(); |
||
224 | } |
||
225 | |||
226 | public function getPaymentFormFields() |
||
227 | { |
||
228 | return new FieldList( |
||
229 | new LiteralField($this->ClassName.'_BeforeMessage', '<div id="'.$this->ClassName.'_BeforeMessage">' . Config::inst()->get("DirectCreditPayment_TESTFAILURE", "before_payment_message") . '</div>'), |
||
230 | new HiddenField($this->ClassName, $this->ClassName, 0) |
||
231 | ); |
||
232 | } |
||
233 | |||
234 | public function getPaymentFormRequirements() |
||
235 | { |
||
236 | return null; |
||
237 | } |
||
238 | } |
||
239 |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.