-
-
Notifications
You must be signed in to change notification settings - Fork 825
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
Fix issues with retrieving supportsTestMode/supportsLiveMode for payment processors #15330
Fix issues with retrieving supportsTestMode/supportsLiveMode for payment processors #15330
Conversation
(Standard links)
|
c33ab48
to
7a4a7c6
Compare
Jenkins re test this please |
1 similar comment
Jenkins re test this please |
test fails relate @mattwire |
@seamuslee001 Hey, any ideas why this doesn't fail locally? |
test this please |
7a4a7c6
to
5612bb0
Compare
@eileenmcnaughton So the issue with the test failing from #15499 |
test this please |
@mattwire good sleuthing. I feel like the Manual Processor probably should be returned when we retrieve a list of processors that work in test mode - I'm not sure where you mean it will return I'm also a bit nervous about the change to supportsLiveMode & supportsTestMode - we need to be sure there are no places in core where it loads the live processor & calls supportsTestMode & expects 'TRUE' - I guess we need to go through & test all the forms & just check it all out through a lot of slog |
@eileenmcnaughton There seems to have been a time when a lot of integrations just used the live processor ID and fudged params to use it in test mode. (webform_civicrm is one of these!). It's caused a lot of problems and lot's of custom code in payment extensions to handle this kind of thing which I've been steadily stripping out. There is an open PR on webform_civicrm to fix this: colemanw/webform_civicrm#266 The "worst case" is that a payment processor stops working in test mode for a particular module or form if we merge this. But without this there's various places where test mode doesn't work (eg. backend contribution forms). If we return the "live" manual processor then we are introducing an exception to how everything (including the dummy processor) works and we're going to need exceptions coded in everywhere we use it to say "this is a live mode processor but we're using it as if it was in test mode". |
Most of the forms end up calling |
test this please |
I'm still making sense of civicrm#15330 but these lines are simply a readability change & 'hiving them off' into a separate PR & getting that merged should make the actual changes in that PR more parsable.
@mattwire I spun off the bit that changes the IF clause since that if just moving code & it creates quite a bit of noise on this PR. I just tried & failed to replicate the wrong processor id loading in back end forms. Can you give steps to replicate? |
|
OK - I'm done now for tonight - but I may get back to this on Friday (my priority after dealing with any regressions is the items marked 'high' on here https://lab.civicrm.org/dev/financial/issues/76 ) now there are instructions to replicate. I've updated the PR template with them. I think it would be worth clearing out the 'noisy' changes in #15568 |
0898a42
to
75c2220
Compare
I'm still making sense of civicrm#15330 but these lines are simply a readability change & 'hiving them off' into a separate PR & getting that merged should make the actual changes in that PR more parsable.
@eileenmcnaughton This is stuck on waiting a response from you re the manual payment processor. My view is that we should be treating it the same as any other payment processor - ie. separate processors for live and test, otherwise we'll end up with code special casing things just to support an inconsistency with that processor. In the meantime this is a bit of a problem when debugging processor issues on live sites as I can't use test mode on backend forms. |
@mattwire At the moment the manual process has the number zero & no row in the payment processor table. We need to change that & give it rows in the table before we can treat it the same as the others |
75c2220
to
09dd320
Compare
669bc5b
to
7751bd9
Compare
@eileenmcnaughton Tests are now passing - I changed the manual processor to specifically support both test/live like before. Ok to merge? |
I tested this & the correct processors are loading & prior issue is resolved. |
Overview
supportsLiveMode
should return live processors.supportsTestMode
should return test processors.We should not be loading processors multiple times in
getPaymentProcessors()
- improves loading speed a little bit.Running a backend payment form in test mode (ie URL param
mode=test
) selected the live processor instead of the test one.Before
Open backend payment form in test mode (change mode=live to test) (eg. called via:
/civicrm/contact/view/contribution?reset=1&action=add&cid=202&context=contribution&mode=test).
Make sure you have multiple processors available.
Select a different processor which will load it's billingblock via AJAX. The live processor loads instead of the test one.
After
Resolve issues with loading processors in test/live mode. Improve efficiency.
Technical Details
Comments