From 1e8b4ff23d392e6d41d5759ba771e3506146b74d Mon Sep 17 00:00:00 2001 From: xacadil <92389481+xacadil@users.noreply.github.com> Date: Mon, 29 Apr 2024 21:50:51 +0500 Subject: [PATCH] Added disputes stream. (#19) --- .DS_Store | Bin 8196 -> 8196 bytes tap_stripe/streams.py | 31 +++++++++++++++++++++++++++++-- tap_stripe/tap.py | 2 ++ 3 files changed, 31 insertions(+), 2 deletions(-) diff --git a/.DS_Store b/.DS_Store index a87e8da8e9e0d369a70091734d3deaa0f00486da..1c7fa19e57d20f14d8e3223f76af4f9be3eb5429 100644 GIT binary patch literal 8196 zcmeHMTWl0n7(U;&(3vUNQ*5zI!?Lj=7Z>P_n_%4DD2Rx#+Y1FLvpWNwFr6tovs)00 z)tHz_yv7HGs1LpvV@QlqNQ@>LNlbiELr~Az)+p|fbTFxJ2rQ>Y8dt7({_3AyOgS}f#L5(U{aR$wOcnU@>)#-?dU zj3@$81fmE;5r`rXMc`(L0NvT5Dc8C8r8F9&2t*OMB_kld4@v5Rrb9X@Y4GWwAt(We ziV`4bG^aWsut|nA9nwij15?^lRu2eG5tbN`<|I!Fb)xBzPD(1x8KgNwcrwBY1;OcL zmkiVy(vn7F6oDuL(<30#M`0_ON0od2>iRuryE&4b$&J~T=QlT>N35c9*6gY(wW_-6 zk<5rYp7C|R=ymFa-C~t>T{~Bv>$!f*93SR&U9RKnmSYwI1IsW;WzT@+818tdTXYOB zu+2z;sw(O*Z#a6it#x%O*|xTAB9%P4zO^}(Y;RjLF`+8;O{+HS96o4|I_@*l6@;Gy zHg}3^$7k}(_DWsSuh<`Dzb=G+DXON;iD$BX+5Tb9i=MgDv~}Mqnccc?dc(ZNBPX}y zUFYF~St92K@~&MRbx2a1*X?|fl+6y?&RCC{-k?Q#Vm9cThkY>_^4x;o6<7@EhqEDf zn9mbiZ6EV3*YWzzf=5(UPtBd*n7nJ*%C>bIJ9-{?=-h2JyjIid>IX`eXXR{jm+s|F z$FQ6OedCtlj|@@x9N*e+nF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QBiwYz}E9vp8#Jo$LTR#w-ex3HByC!_KmI*{AFR z`+|MNzGgqNpV&3_3;UJ*!Tw~|*$s9R41k0R)S?~_V=dO91#Q@dcI-eG_F+GIaS;7D zf}=Qw3`S7ENx1MZftTK8&fT}j6tHiaaJSRg=kAPW>vPwSlRJ1frNvg%$JLb$^95T!k={Hdi#X$z;p~SR zWgT)@RU z__%*2A8~muK9*BOJMY-XNjJ^onP$=Gu060ISRp3z|DO4O|G(>fq6H!kL>{ Iterable[Dict[str, Any]]: # Record filtered out during post_process() continue yield transformed_record + +class DisputesStream(stripeStream): + name = "disputes" + object = "dispute" + replication_key = "updated" + + @property + def path(self): + return "events" if self.get_from_events else "disputes" + + schema = th.PropertiesList( + th.Property("id", th.StringType), + th.Property("object", th.StringType), + th.Property("amount", th.NumberType), + th.Property("charge", th.StringType), + th.Property("created", th.DateTimeType), + th.Property("updated", th.DateTimeType), + th.Property("currency", th.StringType), + th.Property("evidence", th.CustomType({"type": ["object", "string"]})), + th.Property("evidence_details", th.CustomType({"type": ["object", "string"]})), + th.Property("is_charge_refundable", th.BooleanType), + th.Property("livemode", th.BooleanType), + th.Property("metadata", th.CustomType({"type": ["object", "string"]})), + th.Property("payment_intent", th.StringType), + th.Property("reason", th.StringType), + th.Property("status", th.StringType), + ).to_dict() diff --git a/tap_stripe/tap.py b/tap_stripe/tap.py index 093b09a..288ba16 100644 --- a/tap_stripe/tap.py +++ b/tap_stripe/tap.py @@ -31,6 +31,7 @@ TaxRatesStream, RefundsStream, PayoutReportsStream, + DisputesIssuingStream, ) STREAM_TYPES = [ @@ -59,6 +60,7 @@ TaxRatesStream, RefundsStream, PayoutReportsStream, + DisputesIssuingStream, ]