Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev/financial#152 Clean up & test contributionPageID handling #18729

Merged
merged 1 commit into from
Oct 10, 2020

Conversation

eileenmcnaughton
Copy link
Contributor

Overview

Cleans up & adds tests for handling of $ids['contributionPage'] in AuthorizeNetIP

Before

Paypal specific code adding confusion, contribution id being retrieved as a separate query in a separate place when we could just use the value when the bao is fetched

After

Handling simplified, test added.

Technical Details

The only use of loading it is that the authorize.net code later decides whether to send an email based on it. This is tested in the test that also now includes a check that it is copied over.

This is part of step 1 in https://lab.civicrm.org/dev/financial/-/issues/152 where the goal is to remove the use of the now irrelevant paymentProcessorID in

        $this->loadObjects($input, $ids, $objects, TRUE, $paymentProcessorID);

However, it seems loadObjects can likely be bypasses altogether so I'm clarifying how $ids & $objects are used - a larger clarification can be done after #18728 is merged

Comments

@civibot
Copy link

civibot bot commented Oct 10, 2020

(Standard links)

@@ -106,13 +107,6 @@ public function main($component = 'contribute') {
$objects['contact'] = &$contact;
$objects['contribution'] = &$contribution;

// CRM-19478: handle oddity when p=null is set in place of contribution page ID,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was copied onto this class as part of https://lab.civicrm.org/dev/financial/-/issues/148 but as noted there it never applied to A.net & was always gonna be short lived on this class - see https://issues.civicrm.org/jira/browse/CRM-19478 for background

@@ -321,12 +315,6 @@ public function getIDs(&$ids, &$input) {
throw new CRM_Core_Exception($message);
}

// get page id based on contribution id
$ids['contributionPage'] = CRM_Core_DAO::getFieldValue('CRM_Contribute_DAO_Contribution',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, do that - but not here as we have loaded it in line 80....

@seamuslee001
Copy link
Contributor

Looks fine to me merge on pass

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants