From 979e638a1c251405fe5a39477479ba65cb8f268b Mon Sep 17 00:00:00 2001 From: Pavel Odintsov Date: Fri, 5 Jul 2024 17:31:09 +0300 Subject: [PATCH] Added logic to handle chargeback transactions --- main.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/main.go b/main.go index 8c3b01d..01a3272 100644 --- a/main.go +++ b/main.go @@ -123,6 +123,13 @@ func main() { } else if txn.Type == "stripe_fee" { fmt.Printf("Net amount: %v Radar for Fraud teams fee, it's Stripe fee for fraud screening\n", PrintAmount(txn.Net)) continue + } else if txn.Type == "adjustment" && txn.ReportingCategory == "dispute" { + // &{Amount:-206192 AvailableOn:1717696135 Created:1717696135 Currency:gbp + // Description:Chargeback withdrawal for ch_xxx ExchangeRate:0 ID:txn_xxx + // Fee:2000 FeeDetails:[0x14000d46050] Net:-208192 Recipient: ReportingCategory:dispute + // Source:0x14000531570 Status:available Type:adjustment} + fmt.Printf("Net amount: %v It's probably chargeback transaction\n", PrintAmount(txn.Net)) + continue } else { log.Fatalf("Unexpected issue with match from description: '%s' for transaction: %+v", txn.Description, txn) }