Page MenuHomePhabricator

Adyen audit changing the contribution_recur currency to USD in a chargeback (maybe)
Closed, ResolvedPublic

Description

Still working on figuring out what is exactly going on, ~166 affected since July.

Examples:
RNJ9SH6XXXT3MKG2 with contribution_recur id of 1257722

If you look at that one in log_civicrm_contribution_recur the currency field is somehow set to USD from EUR. I think that is coming from the fact that the "gateway_refund_id":"RNJ9SH6XXXT3MKG2" is the same as gateway_parent_id":"RNJ9SH6XXXT3MKG2" in the audit which seems to be the format for chargebacks. But it should have never gotten to the refund queue in the first place

The change happened at 2022-09-09 20:24:09.

I looked around in the process control logs and did find that it got sent to the refund queue from the audit:
2022-09-09 20:24:09,932 ERROR WD RefundQueueConsumer: [info]
2022-09-09 20:24:09,932 ERROR {"gross":"2.50","date":1662590440,"type":"refund","gateway":"adyen","gateway_refund_id":"RNJ9SH6XXXT3MKG2","gateway_parent_id":"RNJ9SH6XXXT3MKG2","gross_currency":"EUR","source_name":"Recon Auditor","source_type":"audit","source_host":"civi1001","source_run_id":16638,"source_version":"unknown","source_enqueued_time":1662754988}
2022-09-09 20:24:09,934 ERROR WD refund: RNJ9SH6XXXT3MKG2: Marking as refunded [info]
2022-09-09 20:24:09,997 ERROR WD refund: RNJ9SH6XXXT3MKG2: Successfully marked as refunded [info]
2022-09-09 20:24:09,997 ERROR WD wmf_common: Committing DB transaction

The data in that day's audit file settlement_detail_report_batch_970.csv is:

Psp ReferenceMerchant ReferencePayment MethodCreation DateTimeZoneTypeModification ReferenceGross Currency
RNJ9SH6XXXT3MKG2128263852.1ideal2022-08-31 13:44:55PDTSettledRNJ9SH6XXXT3MKG2EUR

Event Timeline

Cstone renamed this task from Adyen audit sending not refunded ideal donations to the refund queue to Adyen audit sending not refunded recurring ideal donations to the refund queue.Oct 7 2022, 8:43 PM
greg triaged this task as Medium priority.Nov 15 2022, 10:01 PM
greg raised the priority of this task from Medium to High.Nov 15 2022, 10:06 PM

Queries scratchpad:

SELECT 
  cr.id, 
  cr.contact_id, 
  cr.currency, 
  cr.log_date, 
  cr.payment_processor_id 
FROM 
  civicrm.log_civicrm_contribution_recur cr 
  INNER JOIN civicrm.log_civicrm_contribution_recur cr2 ON cr.id = cr2.id 
  AND cr2.currency != 'USD' 
WHERE 
  cr.currency = 'USD' 
GROUP BY 
  cr.id 
ORDER BY 
  cr.id DESC 
LIMIT 
  200;
select 
  id, 
  contact_id, 
  currency, 
  log_date 
from 
  log_civicrm_contribution_recur 
where 
  id = $id \G
Cstone renamed this task from Adyen audit sending not refunded recurring ideal donations to the refund queue to Adyen audit changing the contribution_recur currency to USD in a chargeback (maybe).Nov 17 2022, 9:14 PM
jgleeson subscribed.

Change 859157 had a related patch set uploaded (by Ejegg; author: Ejegg):

[wikimedia/fundraising/crm@master] Stop changing recur currency on contribution edit

https://gerrit.wikimedia.org/r/859157

Change 859157 merged by jenkins-bot:

[wikimedia/fundraising/crm@master] Stop changing recur currency on contribution edit

https://gerrit.wikimedia.org/r/859157

XenoRyet set Final Story Points to 4.