Commit 8abb6018 authored by ErikHommel's avatar ErikHommel
Browse files

fix custom field api3 in_selector and payout date for api3 contribution

parent 34bb5490
## Version 1.2
* fixed issue with soft credit type in KoalectDonation found during test with Koalect platform
* add custom field payout date to api3 contribution create
* fix custom field in_selector for api3
## Version 1.1
* fixed date format issue when coming from Koalect platform
......
......@@ -225,6 +225,12 @@ class CRM_Koalecttocivi_CustomField {
if (isset($customFieldDefinition['text_length'])) {
$customFieldParams['text_length'] = $customFieldDefinition['text_length'];
}
if (isset($customFieldDefinition['attributes'])) {
$customFieldParams['attributes'] = $customFieldDefinition['attributes'];
}
if (isset($customFieldDefinition['in_selector'])) {
$customFieldParams['in_selector'] = $customFieldDefinition['in_selector'];
}
return $customFieldParams;
}
......
......@@ -275,6 +275,7 @@ class KoalectDonation extends AbstractAction {
*/
private function createContributionApi3(int $contactId, float $donationAmount, float $fee, float $netAmount, string $koalectTransactionId, ParameterBagInterface $parameters) {
$cfTransactionId = "custom_" . \Civi::service('koalecttocivi')->getKtCTrxnIdCfId();
$payOutDateId = "custom_" . \Civi::service('koalecttocivi')->getPayoutDateCfId();
$contributionParams = [
'contact_id' => $contactId,
'total_amount' => $donationAmount,
......@@ -289,6 +290,7 @@ class KoalectDonation extends AbstractAction {
'campaign_id' => $parameters->getParameter('civicrm_campaign_id'),
'revenue_recognition_date' => $this->getParameterDate('revenue', $parameters),
'payment_instrument_id' => $parameters->getParameter('donation_payment_method'),
$payOutDateId => $this->getParameterDate('payout', $parameters),
];
// add potential koalect custom fields for contribution
$this->addPotentialApi3CustomFields($parameters, $contributionParams);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment