From beb9d8f170d39a2b7947d1bbe6aeee9a0869ea10 Mon Sep 17 00:00:00 2001 From: Marc Michalsky Date: Sat, 15 Jun 2024 11:36:12 +0200 Subject: [PATCH] take into account the latest changes to the Twingle API --- .../Exceptions/TwingleCampaignException.php | 4 ++-- CRM/TwingleCampaign/Utils/APIWrapper.php | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/CRM/TwingleCampaign/Exceptions/TwingleCampaignException.php b/CRM/TwingleCampaign/Exceptions/TwingleCampaignException.php index 0f99555..61baf6b 100644 --- a/CRM/TwingleCampaign/Exceptions/TwingleCampaignException.php +++ b/CRM/TwingleCampaign/Exceptions/TwingleCampaignException.php @@ -1,8 +1,8 @@ $contribution['campaign_id']] ); - $response['values']['soft_credit'] = + $response['soft_credit'] = self::createSoftCredit($contribution, $twingle_event)['values']; $event->setResponse($response); } catch (CiviCRM_API3_Exception $e) { @@ -58,8 +58,8 @@ class CRM_TwingleCampaign_Utils_APIWrapper { } } // Create soft credit for sepa mandate - elseif (array_key_exists('sepa_mandate', $response['values'])) { - $sepa_mandate = array_pop($response_copy['values']['sepa_mandate']); + elseif (array_key_exists('sepa_mandate', $response)) { + $sepa_mandate = array_pop($response_copy['sepa_mandate']); try { $contribution = civicrm_api3( @@ -84,7 +84,7 @@ class CRM_TwingleCampaign_Utils_APIWrapper { 'getsingle', ['id' => $contribution['contribution_campaign_id']] ); - $response['values']['soft_credit'] = + $response['soft_credit'] = self::createSoftCredit($contribution, $twingle_event)['values']; $event->setResponse($response); } catch (CiviCRM_API3_Exception $e) {