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
REF Use the new prepareParamsForPaymentProcessor function in more places #15281
REF Use the new prepareParamsForPaymentProcessor function in more places #15281
Conversation
(Standard links)
|
@mattwire makes sense - wanna rebase it |
941417d
to
b1b7f4e
Compare
$this->_params["state_province-{$this->_bltID}"] = $this->_params["billing_state_province-{$this->_bltID}"] = CRM_Core_PseudoConstant::stateProvinceAbbreviation($this->_params["billing_state_province_id-{$this->_bltID}"]); | ||
$this->_params["country-{$this->_bltID}"] = $this->_params["billing_country-{$this->_bltID}"] = CRM_Core_PseudoConstant::countryIsoCode($this->_params["billing_country_id-{$this->_bltID}"]); | ||
|
||
$this->_params = $this->prepareParamsForPaymentProcessor($this->_params); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it matter that now these are only being set if !empty($params["billing_state_province_id-{$this->_bltID}"])
and similarly for country id?
and that
$params['state_province']
and
$params['country']
are now being set as well? I assume not but just wanted to double check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or is the fact that we were not previous testing for empty values the problem!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stesi561 The fact we weren't checking for empty values would potentially cause PHP notices. And missing params that are now being set means we might now be saving data that might not have been saved previously (or the payment processor had to implement custom handling to look for the parameter) - eg. for Country.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume this change won't clash with custom handling in payment processors. The dummy processor was already saving address data. However if this is a change of behaviour I think it's possibly worth referencing in the PR description?
The only thing I could spot is that I think there is a slight change in behaviour here - that I'm not sure is important or not. I've commented on the file concerned.
|
To r-run this do I need to set up an actual payment processor or will the dummy payment process give enough coverage? |
@stesi561 It should be sufficient to test with the dummy payment processor. Really we are just checking that there is no loss of information being saved and no new PHP notices. |
test this please |
@stesi561 Thankyou for reviewing / testing. I've triggered the test build again if you have time for r-run? |
My initial test of http://core-15281-8xhkx.test-1.civicrm.org:8001/civicrm/event/register?reset=1&id=1 while logged in resulted in the below error - this happened before the confirmation page however I can't seem to replicate this again - as either logged in or anon. This error seems to be related to a missing id in the url - the changes don't seem to relate to this so I don't think this is cause for concern. No warnings/notices showing in watchdog/or on screen. Address data appears to be saving correctly.
|
I've updated original review (r-run and r-explain) . |
@stesi561 Thanks for the review! |
This PR caused https://lab.civicrm.org/dev/event/issues/25 |
Overview
Follow on from #15280
Before
More code duplication
After
More code consolidation
Technical Details
Comments
#15280 should be reviewed and merged first.