Payments-wiki currently sends one contribution tracking message on the first page load, and then sends another every time that do_transaction_internal is called. This can result it up to 4 messages for the same donation. We could hash the first message contents and only send a new one if the data changes (like when an invalid or missing amount is corrected).
It looks like this patch is failing CI due to the 2 earlier patches which are unrelated so I'll rebase this patch over master instead so it can be reviewed easier. I also think I owe this patch a unit test before it gets merged but I can add that as a follow on if you wanna review it first.