Conditions | 5 |
Paths | 9 |
Total Lines | 25 |
Code Lines | 19 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
24 | public function paid() |
||
25 | { |
||
26 | EcommercePayment::get_supported_methods(); |
||
27 | $this->extend("DpsPxPayPayment_Handler_completion_start"); |
||
28 | $commsObject = new DpsPxPayComs(); |
||
29 | $response = $commsObject->processRequestAndReturnResultsAsObject(); |
||
30 | if ($payment = DpsPxPayPayment::get()->byID($response->getMerchantReference())) { |
||
31 | if (1 == $response->getSuccess()) { |
||
32 | $payment->Status = 'Success'; |
||
33 | } else { |
||
34 | $payment->Status = 'Failure'; |
||
35 | } |
||
36 | if ($DpsTxnRef = $response->getDpsTxnRef()) { |
||
37 | $payment->TxnRef = $DpsTxnRef; |
||
38 | } |
||
39 | if ($ResponseText = $response->getResponseText()) { |
||
40 | $payment->Message = $ResponseText; |
||
41 | } |
||
42 | $payment->write(); |
||
43 | $payment->redirectToOrder(); |
||
44 | } else { |
||
45 | USER_ERROR("could not find payment with matching ID", E_USER_WARNING); |
||
46 | } |
||
47 | return; |
||
48 | } |
||
49 | } |
||
50 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.