bug-fix in soft credit creation
This commit is contained in:
parent
fe927c4d39
commit
c20c4ab16c
2 changed files with 13 additions and 10 deletions
|
@ -134,18 +134,21 @@ class CRM_TwingleCampaign_Utils_APIWrapper {
|
||||||
array $event): array {
|
array $event): array {
|
||||||
try {
|
try {
|
||||||
return civicrm_api3('ContributionSoft', 'create', [
|
return civicrm_api3('ContributionSoft', 'create', [
|
||||||
'contribution_id' => $contribution['id'],
|
'contribution_id' => $contribution['id'],
|
||||||
'amount' => $contribution['total_amount'],
|
'amount' => $contribution['total_amount'],
|
||||||
'currency' => $contribution['currency'],
|
'currency' => $contribution['currency'],
|
||||||
'contact_id' => $event['contact_id'],
|
'contact_id' => $event['contact_id'],
|
||||||
'soft_credit_type' => 'twingle_event',
|
'soft_credit_type_id' => 'twingle_event_donation',
|
||||||
]);
|
]);
|
||||||
} catch (CiviCRM_API3_Exception $e) {
|
} catch (CiviCRM_API3_Exception $e) {
|
||||||
Civi::log()->error(
|
Civi::log()->error(
|
||||||
E::LONG_NAME .
|
E::LONG_NAME .
|
||||||
' could not create TwingleProject: ' .
|
' could not create soft credit: ',
|
||||||
$e->getMessage(),
|
[
|
||||||
$project->getResponse()
|
'contact_id' => $event['contact_id'],
|
||||||
|
'contact' => $event['contact'],
|
||||||
|
'contribution_id' => $contribution['id'],
|
||||||
|
]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"twingle_event": {
|
"twingle_event_donation": {
|
||||||
"name": "twingle_event",
|
"name": "twingle_event_donation",
|
||||||
"label": "Twingle Event",
|
"label": "Twingle Event",
|
||||||
"description": "A soft credit type for TwingleEvent initiators.",
|
"description": "A soft credit type for TwingleEvent initiators.",
|
||||||
"option_group_id": "soft_credit_type"
|
"option_group_id": "soft_credit_type"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue