Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.6.8

Bug #3818 AuthorizeNet::process() method accessing private member of "Result" object
Submitted: 2005-03-15 05:45 UTC
From: jausions Assigned:
Status: Open Package: Payment_Process
PHP Version: Irrelevant OS: Irrelevant
Roadmaps: (Not assigned)    
Comments Add Comment Add patch

Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem : 24 + 4 = ?

 [2005-03-15 05:45 UTC] jausions
Description: ------------ The Payment_Process_AuthorizeNet::process() method calls Payment_Process_Result::factory() method, but then access the private member _request to set itself as the caller. Even though it works under PHP4, this is not good practice. Either pass the processor as a parameter to the factory method, or use a separate method to set it (setProcessor()) or change the private member to a public one. I would think modifying the factory method is the best way to go... -Philippe


 [2005-03-23 18:34 UTC] jausions
Of course, this means updating all the processors at once...
 [2005-03-23 19:20 UTC] jstump
Please do not submit the same bug more than once. An existing bug report already describes this very problem. Even if you feel that your issue is somewhat different, the resolution is likely to be the same. Because of this, we hope you add your comments to the existing bug instead. Thank you for your interest in PEAR. Dupe of bug 3790 (as this applies to all drivers and not just AuthorizeNet)
 [2005-03-23 23:28 UTC] jausions
At least PHP 5 will complain about passing by reference &$this in Payment_Process_*::process() call to the Payment_Process_Result::factory() method. Even with E_STRICT turned off. I know that PHP 4 doesn't support passing by reference with default. Is it to prevent BC break that you did it this way? Should someone really create a Payment_Process_Result instance without going through a Payment_Process_*processor instance...? Given the status of the package is it worth it to do it that way? -Philippe
 [2005-07-28 03:01 UTC] jstump
Any suggestions for fixing this?