Skip to content

Commit

Permalink
Merge pull request #20656 from eileenmcnaughton/cont_mode
Browse files Browse the repository at this point in the history
[REF] Follow up clean up - remove contribution_mode
  • Loading branch information
monishdeb authored Jul 5, 2021
2 parents 5f4dcb5 + b0261a9 commit 81499d2
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 10 deletions.
6 changes: 1 addition & 5 deletions CRM/Contribute/BAO/Contribution.php
Original file line number Diff line number Diff line change
Expand Up @@ -3380,7 +3380,7 @@ public static function isSubscriptionCancelled($contributionId) {
* @return null|\CRM_Core_BAO_FinancialTrxn
*/
public static function recordFinancialAccounts(&$params, $financialTrxnValues = NULL) {
$skipRecords = $update = $return = $isRelatedId = FALSE;
$skipRecords = $update = $return = FALSE;
$isUpdate = !empty($params['prevContribution']);

$additionalParticipantId = [];
Expand All @@ -3403,10 +3403,6 @@ public static function recordFinancialAccounts(&$params, $financialTrxnValues =
$entityTable = 'civicrm_contribution';
}

if (CRM_Utils_Array::value('contribution_mode', $params) == 'membership') {
$isRelatedId = TRUE;
}

$entityID[] = $entityId;
if (!empty($additionalParticipantId)) {
$entityID += $additionalParticipantId;
Expand Down
3 changes: 0 additions & 3 deletions CRM/Contribute/Form/Contribution.php
Original file line number Diff line number Diff line change
Expand Up @@ -1585,9 +1585,6 @@ protected function submit($submittedValues, $action, $pledgePaymentID) {
$params['participant_id'] = $pId;
$params['skipLineItem'] = 1;
}
elseif ($isRelatedId) {
$params['contribution_mode'] = 'membership';
}
$params['line_item'] = $lineItem;
$params['payment_processor_id'] = $params['payment_processor'] = $this->_paymentProcessor['id'] ?? NULL;
$params['tax_amount'] = CRM_Utils_Array::value('tax_amount', $submittedValues, CRM_Utils_Array::value('tax_amount', $this->_values));
Expand Down
2 changes: 1 addition & 1 deletion api/v3/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ function civicrm_api3_order_create(array $params): array {
}
$entityParams['participant_status_id'] = $entityParams['participant_status_id'] ?? 'Pending from incomplete transaction';
$entityParams['status_id'] = $entityParams['participant_status_id'];
$params['contribution_mode'] = 'participant';
break;

case 'membership':
Expand All @@ -116,7 +117,6 @@ function civicrm_api3_order_create(array $params): array {
if ($supportedEntity) {
$entityParams['skipLineItem'] = TRUE;
$entityResult = civicrm_api3($entity, 'create', $entityParams);
$params['contribution_mode'] = $entity;
$entityIds[] = $params[$entity . '_id'] = $entityResult['id'];
foreach ($lineItems['line_item'] as &$items) {
$items['entity_id'] = $entityResult['id'];
Expand Down
1 change: 0 additions & 1 deletion tests/phpunit/api/v3/ContributionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3509,7 +3509,6 @@ public function testPendingToCompleteContribution(): void {
'payment_processor_id' => $this->paymentProcessorID,
'currency' => 'USD',
'contribution_page_id' => $this->_ids['contribution_page'],
'contribution_mode' => 'membership',
'source' => 'Membership Signup and Renewal',
];

Expand Down

0 comments on commit 81499d2

Please sign in to comment.