test if response array contains contribution
This commit is contained in:
parent
c20c4ab16c
commit
5e068f6d31
1 changed files with 16 additions and 14 deletions
|
@ -36,6 +36,7 @@ class CRM_TwingleCampaign_Utils_APIWrapper {
|
|||
$response = $event->getResponse();
|
||||
|
||||
// Create soft credit for contribution
|
||||
if (array_key_exists('contribution', $response['values'])) {
|
||||
$contribution = $response['values']['contribution']
|
||||
[array_key_first($response['values']['contribution'])];
|
||||
if (array_key_exists('campaign_id', $contribution)) {
|
||||
|
@ -54,6 +55,7 @@ class CRM_TwingleCampaign_Utils_APIWrapper {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* ## Map donation to Campaign
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue