Expose Contribution token processor
This is just to outline the process I went through / am going through to expose the contribution token processor
- Unit tests - I added unit tests to cover both the legacy token processing, the token processor, the legacy token declarations & the token processor token declarations
- I used the tests to identify the discrepancies across the 4 functions
- I resolved pseudo-constant related discrepancies by adding tokens per the syntax discussed in #2650 (closed)
- I added upgrade scripts to convert 'wrong' tokens in scheduled reminders
- I then focussed on missing tokens &, with test cover, added the tokens to each side that were missing
- with test cover I consolidated the declarations such that they match.
In progress (these are mostly the easy bits left fortunately - most of the work was in ^^)
- determine whether the final token list is appropriate #2745 (closed)
- final cleanup - ie need merges on
21048& 21047 & 21046 &21057 - Add listening - the biggest challenge here has always been clarifying the syntax as there is an undocumented alternative syntax and a not-very-documented-possibly-the-standard syntax - https://chat.civicrm.org/civicrm/pl/pqiz9dh1bbgi3ppx8my1yxo5wa
- this step also involves adding a unit test for the listening version along with the adding the actual fetch - this should be easy as a simple apiv4 get but need to do some mapping on the custom fields as they will come in in v3 syntax
Still to do
- Add $contributionID as a parameter to
renderMessageTemplate
& add a test it's go. Note that that function is a strictly internal function & is thoroughly tested so we can change the signature 25 times a day if we want - & we specifically don't want that function to get 'extension-poisoned' - hence the lack of flexibility in the signature at the moment
Out of scope but good to do 11) add a couple of calculated tokens - most obviously total_paid_amount and balance_amount - these are acually in, of all places, the event token subscriber, and, more sensibly - the invoice code