-
-
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
CRM-19792, fixed payment processor params to include email #9662
Conversation
---------------------------------------- * CRM-19792: Authorize.net membership renewals with credit card not processed though event regs are https://issues.civicrm.org/jira/browse/CRM-19792
from coding perspective the PR looks good to me , but I am not sure how to manually test this since it will require Authorize.net test account . So if there are steps to follow in order to test this I would be happy to follow , otherwise it is approved from my side. |
Here is the test account for authorize.net You can create a new one at https://developer.authorize.net/hello_world/sandbox/ and configure in CiviCRM using https://wiki.civicrm.org/confluence/display/CRMDOC/Authorize.net+Configuration I am not sure if i am allowed to paste here my authorize.net account. :( I can inbox you if you want. |
I think there are Authorize.net creds in the test suite |
thanks guys , usally payments prcessors are require some extra stuff like public IP address .. etc .. but it appear that authorize.net is not enforcing that and any one can setup an account with it . so I just created the account and just want to test this on civi. |
@pradpnayak
but contribution status for the membership was fine (turned to completed ) and the membership get renewed .. so I am not sure how it possible to replicate the issue ( how did you replicate it so I can follow the same steps ? ) |
I suspect it might be an account setting in A.net - ie. if A.net is configured to send out an email it will |
One of JMA's client had a problem. Initially i couldn't replicate this error on test environment, but we replicated this live instance. The transaction submitted to Authorize.net was failing because the email was no longer being submitted to the payment processor and it required it. Some googling suggests that there may be a setting in Authorize.net account that determines if this is a required field. |
I just set the email field as required from authorize.net and tested again with and without this patch and both way it is still work fine .. just to make what I did clear here are the steps : 1- set authorized.net as my default payment processor and fill up my test account details there. let me know if there something else I can do or if there is another way to test this . |
As i said earlier in my comment, i could not replicate this on test environment but I could on live authorize.net. But when we have simple contribution without membership, email is send in payment processor params, but not incase of membership. Therefore i added those 2 lines to add email fields or any other required fields to payment processor params. @JoeMurray your thoughts on this? Since you were also able to replicate issue on live credit card processing. |
We were not able to access the client's Auth.net account interface, but Hershel, client and us were able to see problem without this and see it fixed with this. There are numerous reports of this error with Auth.net for other software using Auth.net visible via googling. There are ways clients can configure Auth.net to require it according to Google. There are no problems providing it as an extra param sent when not required. Let's merge this @eileenmcnaughton is my recommendation. |
I've been kind of ignoring this one a bit because I feel a bit uncomfortable with it. My issue is not so much whether it fixes a bug, but whether it introduces more fragility. I believe that this function is called in other places along the path of the form processing and this is adding a couple more. My suspicion is that it should be called once fairly early on in the flow and we should ensure that the parameters are passed along. From a test pov we can check in the alterPaymentProcessorParams hook what variables get passed to it & we could add that check to various tests to ensure they are consistent. |
OK, I'm going to merge this. I agree it is safe & fixes the issue and it would be nice to get it sorted. I did take a look for a better solution and while I had some thoughts I think fundamentally we need to start to talk about what is making those forms so dubious, and basically it is the fact that a whole lot of arrays are being passed around without clear separation of concerns, and even the whole form object is being passed around. Debugging is made harder by the fact that they are often passed as reference & randomly altered. My general thoughts about taking steps towards making this code less toxic are
|
2- This is counter intuitive : I believe passing arrays is counter intuitive and will require the developer to know about the implementation details of the method which is not right . but for objects case , I think it depends .. as long as proper interfaces are written and get injected into the class then that's great .
I think passing values by reference should be avoided as much as possible even for small functions (methods) |
@omarabuhussein my comments are not necessary about best-practice per se. I would advocate different things if writing new code, but when trying to unravel toxic & unpredictable code I think it helps. This is about the process of how to chip away at refactoring bad code. We have a lot of code where a bunch or arrays are passed around, or objects that do not have proper interfaces / patterns/expectations. In this case I think it's worth seeing what is used from those & if 2 properties are used & the rest ignored then pass in those 2 properties rather than the array. My thinking is largely motivated by the fact that if you pass an array in then later someone will hack in a bug fix that adds another way of using it. So, when trying to unravel code, or working on toxic code I advocate many specific parameters being passed in. |
make sense |
CRM-19792, fixed payment processor params to include email
https://issues.civicrm.org/jira/browse/CRM-19792