for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
class DpsPxPayPayment_Handler extends Controller
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.
{
private static $allowed_actions = array(
$allowed_actions
This check marks private properties in classes that are never used. Those properties can be removed.
"complete_link",
"absolute_complete_link",
"paid"
);
private static $url_segment = 'dpspxpaypayment';
$url_segment
public static function complete_link()
return Config::inst()->get('DpsPxPayPayment_Handler', 'url_segment') . '/paid/';
}
public static function absolute_complete_link()
return Director::AbsoluteURL(self::complete_link());
public function paid()
EcommercePayment::get_supported_methods();
$this->extend("DpsPxPayPayment_Handler_completion_start");
$commsObject = new DpsPxPayComs();
$response = $commsObject->processRequestAndReturnResultsAsObject();
if ($payment = DpsPxPayPayment::get()->byID($response->getMerchantReference())) {
if (1 == $response->getSuccess()) {
$payment->Status = 'Success';
} else {
$payment->Status = 'Failure';
if ($DpsTxnRef = $response->getDpsTxnRef()) {
$payment->TxnRef = $DpsTxnRef;
if ($ResponseText = $response->getResponseText()) {
$payment->Message = $ResponseText;
$payment->write();
$payment->redirectToOrder();
USER_ERROR("could not find payment with matching ID", E_USER_WARNING);
return;
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.