-
-
Notifications
You must be signed in to change notification settings - Fork 824
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
Paypal cancel/notify/return URLs #25376
Conversation
(Standard links)
|
Does paypal even need the component? I'll take a look at the IPN code to see.... but it would be cleaner just to figure it out from the contribution |
@eileenmcnaughton I don't know. But don't think that would be a blocker for this PR? |
@KarinG You might be interested? |
By the way I did this as 5 commits so it's easier to review/merge the changes separately if preferred. |
Hmm - the way the IPN works it treats the presence or absense of
This feels like one of those places where someone looked at what was different but the difference was likely accidental. I suspect the component might be more reliably set on the class than when being passed in so that bad check might break |
@eileenmcnaughton As far as I can tell I'm not changing any passing or not of component. Just cleaning unnecessary function vars - if you look at this commit - component defaults to 'contribute' and is set in the class constructor. Then we pass it around anyway in paypal between functions but it all comes from the same place - the constructor and then the class method. |
OK - I agree with you after checking. I think this PR makes 2 changes then
|
As it's making a required parameter (
Well, it means it actually works for webform :-) From grepping code etc. my conclusion was that it was using a very old pattern and most of what it was passing would be ignored - I'm not sure that the cancel URL actually worked before as I didn't test the "cancel" before this PR. But it does work after this PR :-) |
@mattwire re "I don't think it should matter if a class does extend it as we're still maintaining the 2 params." - I think it would still bork because the expectation is the signature is the same between parent class & sub-class - but I couldn't find any instances Re the second - OK - it fixes if for webform & standardises with the other payment processors - I guess if it is fixing something which doesn't work that is a good argument |
Thanks @eileenmcnaughton |
Overview
This fixes Paypal standard on Drupal9 Webform and will also work for any other offsite payment processor that uses the standard methods.
Paypal: Stop passing component when it exists on the class
Paypal: Use getBaseReturnUrl() function
CRM_Core_Payment
: getCancelUrl participant default value of NULLPaypal (express): Pass participantID to getCancelUrl() if available
Paypal: Use standard functions for cancelUrl / notifyUrl
Before
Paypal using it's own code instead of generic code.
After
Using generic code to generate cancel/notify links.
Technical Details
Historically (a long time ago) these functions didn't exist. Recently (6 years ago) they were updated to allow them to be overridden by eg. webform.
Comments