[#19] implementing membership postprocess call (WIP)

This commit is contained in:
B. Endres 2020-02-12 13:57:26 +01:00
parent 33ced7bbc3
commit c4530e7e24

View file

@ -675,23 +675,15 @@ function civicrm_api3_twingle_donation_Submit($params) {
// call the postprocess API // call the postprocess API
$postprocess_call = $profile->getAttribute('membership_postprocess_call'); $postprocess_call = $profile->getAttribute('membership_postprocess_call');
if (!empty($postprocess_call)) { if (!empty($postprocess_call)) {
list($pp_entity, $pp_action) = explode('.', $postprocess_call, 1); list($pp_entity, $pp_action) = explode('.', $postprocess_call, 2);
try { try {
// gather the contribution IDs // gather the contribution IDs
$recurring_contribution_id = $contribution_id = ''; $recurring_contribution_id = $contribution_id = '';
if (isset($mandate)) { if (isset($contribution_recur['id'])) {
if ($mandate['type'] == 'RCUR') { $recurring_contribution_id = $contribution_recur['id'];
$recurring_contribution_id = $mandate['entity_id']; }
} elseif ($mandate['type'] == 'OOFF') { if (isset($contribution['id'])) {
$contribution_id = $mandate['entity_id']; $contribution_id = $contribution['id'];
}
} else {
if (isset($contribution_recur['id'])) {
$recurring_contribution_id = $contribution_recur['id'];
}
if (isset($contribution['id'])) {
$contribution_id = $contribution['id'];
}
} }
// run the call // run the call