From ee08c8cfd2a123265c86bbe2d375e50f122479d3 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Thu, 7 Jul 2022 14:06:15 +1200 Subject: [PATCH] Declare total_amount, make amount an alias The confusion between amount & total_amount is in multiple places - this means they are treated 'the same' if passed into repeattransaction --- api/v3/Contribution.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/api/v3/Contribution.php b/api/v3/Contribution.php index 3f01a7d4ef..6154d6343b 100644 --- a/api/v3/Contribution.php +++ b/api/v3/Contribution.php @@ -813,6 +813,14 @@ function _civicrm_api3_contribution_repeattransaction_spec(&$params) { 'name' => 'payment_processor_id', 'type' => CRM_Utils_Type::T_INT, ]; + $params['total_amount'] = [ + 'description' => ts('Optional override amount, will be ignored if more than one line item exists'), + 'title' => ts('Total amount of the contribution'), + 'name' => 'total_amount', + 'type' => CRM_Utils_Type::T_MONEY, + // Map 'amount' to total_amount - historically both have been used at times. + 'api.aliases' => ['amount'], + ]; } /** -- 2.25.1