Suppress legacy warnings by default in propertyBag to allow transition to propertyBag without hitting legacy warnings on unconverted payment processors #20038
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
Per mattermost thread https://chat.civicrm.org/civicrm/pl/3tzw46wtfidwbjhbdxqg6y6qfa
This allows us to actually implement propertyBag and pass it to
doPayment()
- example in 0bed925#diff-32a00907a954b52a78852aca14a4d2cca61f9dba805905c9053a1f2ec8ef70c0R340 without causing tests to fail when payment processors are accessing legacy properties.By passing propertyBag we have full control over what parameters are being passed to the paymentprocessor and do not need to worry about setting multiple keys in case the processor looks for one rather than the other - eg. we use
$this->setIsRecur()
and the processor ideally accesses via$this->getIsRecur()
but can also access using ArrayAccess via$params['is_recur']
or$params['isRecur']
.Before
Payment processors that do not cast to propertyBag trigger deprecated warnings on the legacy parameters if accessing them - eg.
$params['is_recur']
instead of$params['isRecur']
. Both keys contain the same value.After
Payment processors that do not cast to propertyBag DO NOT trigger deprecated warnings on the legacy parameters if accessing them - eg.
$params['is_recur']
instead of$params['isRecur']
. Both keys contain the same value.Technical Details
Explained above.
Comments
@eileenmcnaughton