From eb6743919d854635ece93fb364bbe63b4e6fa33e Mon Sep 17 00:00:00 2001 From: Jens Schuppe Date: Fri, 19 Apr 2024 13:41:48 +0200 Subject: [PATCH] (WIP) post-process API call for membership installments --- api/v3/TwingleDonation/Submit.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/api/v3/TwingleDonation/Submit.php b/api/v3/TwingleDonation/Submit.php index ecaeac8..2c60646 100644 --- a/api/v3/TwingleDonation/Submit.php +++ b/api/v3/TwingleDonation/Submit.php @@ -810,6 +810,7 @@ function civicrm_api3_twingle_donation_Submit($params) { else { // this is a follow-up recurring payment $membership_type_id = NULL; + $isInstallment = TRUE; } } @@ -880,6 +881,18 @@ function civicrm_api3_twingle_donation_Submit($params) { } } + if ( + ($isInstallment ?? FALSE) + && is_string( + $membershipInstallmentPostprocessCall = $profile->getAttribute('membership_installment_postprocess_call') + ) + ) { + // TODO: MembershipPayment post process call + // * either via org.project60.membership + // * or via custom API call (e.g. form processor) + // receiving contribution_recur_id, contribution_id, contact_id + } + $result = civicrm_api3_create_success($result_values); } catch (Exception $exception) {