Page MenuHomePhabricator

Gravy Audit/Settlement Processing (refunds)
Closed, ResolvedPublic

Description

Gravy sends over refunds in their settlement reports as adjustments to the original payment transactions and does not treat them as separate transactions.

This is different, to my understanding, from how other processors give us refund settlement data and as a result, we will have to push both a donation message and a refund message to the queues for refunded transactions that were not previously recorded, which might prove tricky.

Gravy responded yes on Slack to all of the below when queried:

  • Refunds do not have a distinct status; they are set to capture_succeeded, like payments.
  • Refunds do not appear as separate transactions/events in the settlement report, i.e., they don't have a separate row from the original payment transaction/event. Instead, they are indicated by the presence of a value > 0 in the 'refunded_amount' field.
  • The timestamp of the refund should be inferred from the 'updated_at' field on the report row where the 'refunded_amount' is > 0.
  • It is possible that we could receive a settlement report containing a single row that encompasses two distinct transactions within a given time period, the payment and the subsequent refund, if they were to happen, for example, within a 24-hour window if we were generating and processing the reports on a 24-hour basis.

Event Timeline

Change #1073799 had a related patch set uploaded (by Jgleeson; author: Jgleeson):

[wikimedia/fundraising/SmashPig@master] WIP: Gravy Audit Processor: Refunds

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

Change #1074244 had a related patch set uploaded (by Jgleeson; author: Jgleeson):

[wikimedia/fundraising/dev@master] Add script to safely checkout smashpig patch to CiviCRM

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

Change #1074271 had a related patch set uploaded (by Jgleeson; author: Jgleeson):

[wikimedia/fundraising/crm@master] Add test to confirm Gravy Audit Refund behaviour

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

Change #1073799 merged by jenkins-bot:

[wikimedia/fundraising/SmashPig@master] Gravy Audit Processor - Refunds

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

Change #1074412 had a related patch set uploaded (by Jgleeson; author: Jgleeson):

[wikimedia/fundraising/crm@master] Upgrade SmashPig to v0.8.12

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

Change #1074416 had a related patch set uploaded (by Jgleeson; author: Jgleeson):

[wikimedia/fundraising/crm@deployment] Upgrade SmashPig to v0.8.12

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

Change #1074412 merged by jenkins-bot:

[wikimedia/fundraising/crm@master] Upgrade SmashPig to v0.8.12

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

Change #1074416 merged by jenkins-bot:

[wikimedia/fundraising/crm@deployment] Upgrade SmashPig to v0.8.12

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

Change #1074244 merged by Jgleeson:

[wikimedia/fundraising/dev@master] Add script to safely checkout smashpig patch to CiviCRM

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

Change #1074271 merged by jenkins-bot:

[wikimedia/fundraising/crm@master] Add test to confirm Gravy Audit Refund behaviour

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

XenoRyet set Final Story Points to 4.