@mattwire has kindly provided some code to handle the issue in this extension, but I wonder if it was intentional, and if so why, and if it should be documented somewhere.
Or whether doPayment should be smarter?
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items ...
Show closed items
Linked items 0
Link issues together to show that they're related.
Learn more.
@AlanDixon yeah I think somewhere way back it was decided that payment processors might want to do something with $0 transactions so it was left to the payment processors to do an early return - ie
if (!empty($params['amount'])) { return;}
Has always been in the parent doPayment & winds up being copied to the child
@AlanDixon yeah perhaps one of those features that got added because 'it might be useful' - which is the definition of a hard-to-maintain feature as you are hitting (I think I've learnt the less about this sort of thing somewhere along the way)
Sorry, I am not feeling able to help on this. Thankfully I have forgotten more about disputes about $0 tansactions than I can remember. My overriding sentiment is I just want the code to work, and I wish we had had a standard that said $0 transactions have been supported never, nowhere, or always, everywhere.
I think they were removed then put back given some pushback, maybe from dgg. And there were issues with member payments and event payments. But mostly it's like a zombie problem that never really disappears.
Thanks for this - the background, even murky, is useful.
And the correct conclusion for payment processors is: core is ambivalent about whether it should send $0 payments to a payment processor, so best to handle them explicitly, especially when upgrading your code to using doPayment (from the old doDirectPayment).
Thank you for raising an issue to help improve CiviCRM. As you may know, this issue has not had any activity for quite some time, so we have closed it.
We would like you to help us to determine if this issue should be re-opened:
If this issue was reporting a bug, can you attempt to reproduce it on a latest version of CiviCRM?
If this issue was proposing a new feature, can you verify if the feature proposal is still relevant? Did it get the concept-approved label? Have other people also shown interest? Could it be implemented as an extension?
If the answer to either question is yes, please feel free to comment or re-open the issue. Please also consider:
Is it something that you could help implement, either by sending a patch or hiring someone who can?
Thank you for your help and contributions to CiviCRM.
P.S. This is an automated message, see infra/gitlab issue 20. We understand that automatic responses are annoying, but given the number of open issues as the project evolves, we need a bit of help to triage and prioritise the most relevant issues.