From a7f488655ba081d3916054bc46e5029f4012f766 Mon Sep 17 00:00:00 2001 From: Jon Goldberg Date: Wed, 13 Sep 2023 16:10:40 -0400 Subject: [PATCH] modernize soft credit on honoree --- src/WebformCivicrmPostProcess.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/WebformCivicrmPostProcess.php b/src/WebformCivicrmPostProcess.php index 8d81f3d40..47b96440b 100644 --- a/src/WebformCivicrmPostProcess.php +++ b/src/WebformCivicrmPostProcess.php @@ -2317,13 +2317,12 @@ private function processContribution() { } } // Save honoree - // FIXME: these api params were deprecated in 4.5, should be switched to use soft-credits when we drop support for 4.4 if (!empty($contribution['honor_contact_id']) && !empty($contribution['honor_type_id'])) { - $this->utils->wf_civicrm_api('contribution', 'create', [ - 'id' => $id, - 'total_amount' => $contribution['total_amount'], - 'honor_contact_id' => $contribution['honor_contact_id'], - 'honor_type_id' => $contribution['honor_type_id'], + $this->utils->wf_civicrm_api('contribution_soft', 'create', [ + 'contribution_id' => $id, + 'amount' => $contribution['total_amount'], + 'contact_id' => $contribution['honor_contact_id'], + 'soft_credit_type_id' => $contribution['honor_type_id'], ]); }