I've got the eWay payment gateway returing to my site on the URL http://silverstripe/ewayctl/success/00073?debug_request=1
I'm trying to get the $ID value of 00073 so I can edit that record on the Database, but it looks like the values are NULL by the time it gets to my controller
Debug (line 155 of RequestHandler.php): Testing '$Action//$ID/$OtherID' with '' on eWay_Controller
Debug (line 163 of RequestHandler.php): Rule '$Action//$ID/$OtherID' matched to action 'handleAction' on eWay_Controller. Latest request params: array ( 'Action' => NULL, 'ID' => NULL, 'OtherID' => NULL, )
I'm trying to do this in the class eWay_Controller extends Controller - (I'm guessing the $this is wrong)
if($id = $this->param('ID')){
$p = DataObject::get_one('eWay',"\"ID\" = '$id'");
$this->payment = $p;
return $p;
}
this is on SS 3.0.3
this is my routes.yml
---
Name: paymentroutes
After: framework/routes#coreroutes
---
Director:
rules:
'ewayctl/$Action/$ID/$OtherID' : 'eWay_Controller'
Update
I can do it using
Director::urlParam('ID')
in the controller but I get a deprecation notice:
Director::urlParam is deprecated. Use SS_HTTPRequest->param() instead.
I'm not sure what the SS_HTTPRequest object/variable name is from within the Controller to call it properly
thanks