Home » Payment » Payment_Process » Bug #1271
Result::validate() not accessing options correctly
Details
| Submitted | 2004-04-23 16:47 UTC |
|---|---|
| From | aashley at optimiser dot com |
| Assigned | ieure |
| Status | Closed |
| Package | Payment_Process |
| PHP Version | Irrelevant |
| OS | All |
| Roadmaps | (Not assigned) |
Comments
[2004-04-23 16:47 UTC] aashley at optimiser dot com
Description:
------------
when Result::validate() is called it tries to access $this->_request->options[] which doesnt exist. This is incorrect for two reasons, first the array is _options not options and more importantly its a private array and it should be using the getOption function. The below patch makes this change. Really should do something about the access from the Result object to the Payment object attached to the Request as well.
--- /usr/share/pear/Payment/Process.php 2004-04-13 13:13:15.000000000 +0800
+++ Process.php 2004-04-24 00:54:58.593967038 +0800
@@ -582,13 +582,13 @@
function validate()
{
- if ($this->_request->options['avsCheck'] === true) {
+ if ($this->_request->getOption('avsCheck') === true) {
if ($this->getAVSCode() != PAYMENT_PROCESS_AVS_MATCH) {
return PEAR::raiseError('AVS check failed',PAYMENT_PROCESS_ERROR_AVS);
}
}
- if ($this->_request->options['cvvCheck'] === true &&
+ if ($this->_request->getOption('cvvCheck') === true &&
$this->_request->_payment->_driver == PAYMENT_PROCESS_TYPE_CREDITCARD) {
if ($this->getCvvCode() != PAYMENT_PROCESS_CVV_MATCH) {
return PEAR::raiseError('CVV check failed',PAYMENT_PROCESS_ERROR_CVV);