returncivicrm_api3_create_error('No open pledges found for this contact. Contribution row was skipped.');
}
elseif(count($pledgeDetails)>1){
returncivicrm_api3_create_error('This contact has more than one open pledge. Unable to determine which pledge to apply the contribution to. Contribution row was skipped.');
}
// this mean we have only one pending / in progress pledge
$values['pledge_id']=$pledgeDetails[0];
}
// we need to check if oldest payment amount equal to contribution amount
returncivicrm_api3_create_error('No open pledges found for this contact. Contribution row was skipped.');
}
elseif(count($pledgeDetails)>1){
returncivicrm_api3_create_error('This contact has more than one open pledge. Unable to determine which pledge to apply the contribution to. Contribution row was skipped.');
}
// this mean we have only one pending / in progress pledge
$values['pledge_id']=$pledgeDetails[0];
}
// we need to check if oldest payment amount equal to contribution amount