Authorize.net webhooks fail, because processor expects Integer for x_invoice_num, while some have 20-character alphanumeric
I have a situation in which some Authorize.net ARB webhook notifications are not being processed successfully.
This appears to be because:
- CiviCRM expects an integer for the webhook value of x_invoice_num
- These webhooks have a 20-character alphanumeric string (e.g. "512def29489e1bcc8856") for this value.
More details:
- Affected recurring contributions were all created before Nov 2021
- This x_invoice_num string (e.g. "512def29489e1bcc8856") does appear in the database, only in these places:
-
civicrm_contribution
for the first contribution in the recurring series:- civicrm_contribution.invoice_id contains a 32-character alphanumeric string, the first 20 characters of which are this x_invoice_num value
- civicrm_contribution.trxn_id contains two strings, joined by a comma; the first is this x_invoice_num value; the second is an integer which appears to be an FK to civicrm_financial_trxn.order_reference.
-
Technical assessment:
- I'm guessing that older civicrm versions used to handle things this way (passing 20-character alphanumeric to Authorize.net, so that it gets returned in webhook's x_invoice_num value), and that way of things has changed at some point since Nov 2021.
I can work on a PR, but first I thought someone might know of a previous issue/commit that removed some code relevant to this process.
I'm at the sprint now and aim to work on a fix either way.
(Joinery reference: F#1270)