Skip to content

Commit 8f31154

Browse files
Add warning regarding known gaps in meeting the contract if property bag is used
Core does not use property bag - and there are no known instances of people using property bag with Omnipay but if they did it would fail to create recurrings as of 5.69 because it does not pass our is_recur. Omnipay is not the only processor that requires is_recur. Note in the past Omnipay had a cast to PropertyBag but I reverted that after hitting regressions in Omnipay caused by property bag As far as I know there are no runtime benefits of using Omnipay
1 parent 3cbc165 commit 8f31154

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

CRM/Core/Payment/OmnipayMultiProcessor.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,22 @@ public function doPayment(&$params, $component = 'contribute') {
157157
'payment_status_id' => array_search('Completed', CRM_Contribute_BAO_Contribution::buildOptions('contribution_status_id', 'validate')),
158158
];
159159
}
160+
if (is_object($params)) {
161+
// I recently tried to fix the checking in the Dummmy processor to be strict & enforce the documented payment
162+
// processor contract for recurring. That work was reverted in core but it became apparent in the process that
163+
// a) the is custom code passing the PropertyBag to the payment processors. I did think we decided to avoid passing
164+
// propertyBag to payment processors as it seems to be a really complicated & brittle way to get around documenting
165+
// the contract & patching code to meet the contact. However, if you are reading this you are probably using an
166+
// extension that does pass the object out.
167+
// b) it became apparent PropertyBag does not set the 'is_recur' value such that it is accessible. This should be
168+
// fixed.
169+
// c) I made a really good decision 2 years ago to officially pass off any engagement with PropertyBag to the
170+
// rest of the core team. My recent experience made it clear to me that I should continue to avoid any
171+
// engagement with the PropertyBag - so If you are reading this and choose to try to fix the extension or
172+
// PropertyBag please do not ping me or otherwise try
173+
// to involve me.
174+
CRM_Core_Error::deprecatedWarning('A property bag object has been passed into the Omnipay processor. As of CiviCRM 5.69 this will mean that Omnipay (and Authorize.net, and others) will not behave as expected for recurring contributions. PropertyBag does not meet the recurring contribution contract https://docs.civicrm.org/dev/en/latest/extensions/payment-processors/paymentclass/#recurring-contribution-parameters & may not work properly. Core code does not pass the propertyBag to the payment processor so this is coming from an extension you are using');
175+
}
160176

161177
$params['component'] = strtolower($component);
162178
$this->initialize($params);

0 commit comments

Comments
 (0)