Page MenuHomePhabricator

Paypal - handle 'general reversal'
Closed, ResolvedPublic

Description

In this scenario

  1. we received a donation on March 3rd 2025 (credit) T0006
  2. a chargeback hold was settled against us on 19 Feb 2026 (debit) "T1110
  3. the chargeback hold settlement was reversed on 21 Feb (credit) T1111
  4. it was actually charged back on 22 Feb and we were debited for it T1201 & T1106

Since steps 2 & 3 settle to our account we need to represent them in CiviCRM. There are a couple of rare anomalies we see in PayPal (this one happened once in 2025, twice so far in 2026 and 3 times in 2022. I think the one in https://phabricator.wikimedia.org/T417347 has similar frequency - ie rare but needs to be handled.

../completed/STL-20250303.01.007.CSV:
"SB","1VR65581RE526013M","229113339.1","","","T0006",2025/03/03 07:28:57 -0800,2025/03/03 07:28:57 -0800,"CR",100,"EUR","DR",41,"EUR","229113339.1","J63WET8FRH99L","",""

../completed/STL-20260219.01.009.CSV:
T1110 = Chargeback hold**
"SB","9TA2576831804805W","229113339.1","1VR65581RE526013M","TXN","T1110",2026/02/19 03:36:28 -0800,2026/02/19 03:36:28 -0800,"DR",59,"EUR","",,"","229113339.1","J63WET8FRH99L","","","",,,

../completed/STL-20260221.01.009.CSV:
T1111 = Chargeback hold (released)
"SB","9TA2576831804805W","229113339.1","1VR65581RE526013M","TXN","T1111",2026/02/19 03:36:28 -0800,2026/02/21 00:21:46 -0800,"CR",59,"EUR","",,"","229113339.1","J63WET8FRH99L","","","",,,

../completed/STL-20260221.01.009.CSV: - these are handled
Chargeback and chargeback fee
"SB","63J34064G5584560B","229113339.1","1VR65581RE526013M","TXN","T1201",2026/02/21 00:21:47 -0800,2026/02/21 00:21:47 -0800,"DR",100,"EUR","",,"","229113339.1","","","","",,,
"SB","2TA64279JC8313330","229113339.1","63J34064G5584560B","TXN","T0106",2026/02/21 00:21:47 -0800,2026/02/21 00:21:47 -0800,"DR",1600,"EUR","",,"","229113339.1","","","","",,,

Note that I checked and Gravy excluded the chargeback hold from it's report and because they also drop the total information the fact it is missing is invisible - so these balance discrepancies would have been very hard to track down it we were not processing the primary source (paypal settlement report)

Event Timeline

Change #1242603 had a related patch set uploaded (by Eileen; author: Eileen):

[wikimedia/fundraising/SmashPig@master] Change T-code 1106 to chargeback

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

Change #1242771 had a related patch set uploaded (by Eileen; author: Eileen):

[wikimedia/fundraising/SmashPig@master] Add reversal & reversal_reversed types

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

Change #1242603 merged by jenkins-bot:

[wikimedia/fundraising/SmashPig@master] Change T-code 1106 to chargeback

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

Change #1242771 merged by jenkins-bot:

[wikimedia/fundraising/SmashPig@master] Add reversal & reversal_reversed types

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

@Eileenmcnaughton do you know, would the work in this Task enable (or relate to) Civi to cancel annual recurring PayPal donations if the first donation is charged-back via the Resolution Center?

If a donor requests a refund of their initial recurring annual donation at PayPal (via ordinary request to PayPal, or via dispute at the Resolution Center), will Civi likely know to cancel the recurring so that we don't try to charge them the next year?

Dylan said that the same cancel logic for monthly recurring donations that begin accruing chargebacks will apply to annual recurrings, so I'm wondering whether these PP resolution center ones will work that way?

Hi @MBeat33, we do have code to cancel the PayPal recurring on the first chargeback, but I see only 223 PayPal cancellations with the reason 'Automatically cancelling because we received a chargeback'. Perhaps we're not calling it on the requested refunds, just on actual chargebacks to the credit card backing their PayPal account?

@MBeat33 just noting that you should open another phab if you think there is something for us to do (it's tangential to this phab)

Thanks, @Ejegg for confirming that. It might make sense to have the code apply to just chargebacks.

And @Eileenmcnaughton got it, will spin off a Task if we need anything.

XenoRyet set Final Story Points to 2.