Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Post-process API call for membership installments #85

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions api/v3/TwingleDonation/Submit.php
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@
* @see civicrm_api3_create_success
* @see civicrm_api3_create_error
*/
function civicrm_api3_twingle_donation_Submit($params) {

Check warning on line 268 in api/v3/TwingleDonation/Submit.php

View workflow job for this annotation

GitHub Actions / PHP_CodeSniffer

Function's nesting level (6) exceeds 5; consider refactoring the function

Check failure on line 268 in api/v3/TwingleDonation/Submit.php

View workflow job for this annotation

GitHub Actions / PHP_CodeSniffer

Function's cyclomatic complexity (75) exceeds allowed maximum of 20
// Log call if debugging is enabled within civicrm.settings.php.
if (defined('TWINGLE_API_LOGGING') && TWINGLE_API_LOGGING) {
Civi::log()->debug('TwingleDonation.Submit: ' . json_encode($params, JSON_PRETTY_PRINT));
Expand Down Expand Up @@ -810,6 +810,7 @@
else {
// this is a follow-up recurring payment
$membership_type_id = NULL;
$isInstallment = TRUE;
}
}

Expand Down Expand Up @@ -880,6 +881,18 @@
}
}

if (

Check failure on line 884 in api/v3/TwingleDonation/Submit.php

View workflow job for this annotation

GitHub Actions / PHP_CodeSniffer

Empty IF statement detected
($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) {
Expand Down
Loading