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.