Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Major
-
Resolution: Fixed/Completed
-
Affects Version/s: 3.4.5, 4.0.5
-
Fix Version/s: 4.1.0
-
Component/s: CiviContribute, CiviMember
-
Labels:None
Description
We have a contrib page setup where we are collecting membership and also a separate contribution amount. The list of membership options all have a minimum fee, with the exception of one option, which is a free level.
Because we have membership + contrib, and they are attributed to different contrib types, doDirectPayment is called twice. I suspect that because some memberships do have a fee attached to them, we trigger the transaction regardless of the option selected.
that means we trigger doDirectPayment even for the free option, which results in an error from the processor: Payment Processor Error message: 1:5 A valid amount is required — because a 0 value is not accepted. The contrib records appear to be saved correctly. but when that error occurs, the user is sent back to the form instead of the thank you page, and tempted to resubmit, which creates problems.
i've fixed by adding the following directly inside the Authorize.net doDirectorPayment method:
if ( $params['amount'] == '0.00' )
{ $params['gross_amount'] = $params['amount']; return $params; }but I suspect we should probably add that exclusion higher up in the code. i'm just unsure where.