Magento PayPoint/Meta-Charge extension fault and fixes (PayPoint Fastrack 1.3.1)
At a customers request we were given the opportunity to use PayPoint/Meta-Charge as the payment gateway. As an extension already existed there was little point re-inventing the wheel, so we took advantage of PayPoint Fastrack by Deeson Group Ltd.
However, after a few days use it was become apparent there was a bug with the extension when handling some payment types.
URL: not available Time: 2009-11-10 11:13:13 GMT Error: Notice: Undefined property: stdClass::$amount in app/code/local/PaypointFastTrack/controllers/FastController.php on line 162Looking at line 162, it reveals
161 // We get the amount without the currency prepended to it 162 $split_amount = explode($this->getConfig()->getCurrency(),$this->responseArr->amount); 163 $this->responseArr->intAmount = $split_amount[1];Which all looked normal, so we dumped the object:
stdClass Object ( [intTransID] => XX [strCartID] => XX [intAccountID] => XX [intAuthMode] => [intInstID] => XX [intStatus] => 1 [intTime] => XX [fltAmount] => 80.40 [strCurrency] => GBP [strPaymentType] => VISA [intCV2] => 1 [strCustomer] => XX [strAddress] => XX [strCity] => XX [strState] => XX [strPostcode] => XX [strCountry] => XX [strTel] => XX [strFax] => [strEmail] => XX@XX.XX [strDesc] => Re: XXX [fltFraudScore] => 0.014 [strTransactionType] => Chargeback [strSyndicate] => default [fltNotifyVersion] => 1.5 [intRelatedID] => XXX )However, it was very apparent that the variable "amount" it was trying to access did not exist. We didn't have time to fully diagnose the fault, so a quick immediate patch was in order. We replaced the above code with:
if (@empty($this->responseArr->amount)) { $this->responseArr->intAmount = $this->responseArr->fltAmount; $this->responseArr->amount = $this->responseArr->fltAmount; } else { $split_amount = explode($this->getConfig()->getCurrency(),$this->responseArr->amount); $this->responseArr->intAmount = $split_amount[1]; }So far, so good and all transactions are going through properly. If anyone is still having difficulty with the extension not working properly, Deeson Group Ltd recommend purchasing a support contract to remedy the bugs with the extension. [syntaxhighlighter]