Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Major
-
Resolution: Fixed/Completed
-
Affects Version/s: 4.3.4
-
Fix Version/s: 4.3.6
-
Component/s: CiviContribute
-
Labels:None
Description
In testing the Elavon Payment Processor in CiviCRM 4.3.4, I was getting a 5002 error from Elavon complaining about an "invalid amount" being submitted.
I reproduced this multiple times by creating a new Contribution Page with one Contribution Amount: $1.00 and trying to submit both test and live payments.
When inspecting the XML generating by CiviCRM, I noticed the amount was being passed in as "%20%201.00" – encoding some extra whitespace from the form display or something?
The following change to civicrm/CRM/Core/Payment/Elavon.php fixed it:
93c93
< $requestFields['ssl_amount'] = $params['amount'];
—
> $requestFields['ssl_amount'] = trim($params['amount']);
A more elegant fix might be to remove that whitespace earlier, but I'm not familiar with the CiviContribute codebase.
I've tested this on 4.3.4. I'm presuming it affects 4.3.5 because that line is the same, though a fix may have been applied elsewhere?