Skip to content

Commit

Permalink
Added disputes stream. (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
xacadil authored Apr 29, 2024
1 parent 0ad9d5e commit 1e8b4ff
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 2 deletions.
Binary file modified .DS_Store
Binary file not shown.
31 changes: 29 additions & 2 deletions tap_stripe/streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -935,9 +935,9 @@ class CreditNoteLineItemsStream(stripeStream):
th.Property("unit_amount_decimal", th.StringType),
th.Property("unit_amount_excluding_tax", th.StringType),
).to_dict()
class DisputesStream(stripeStream):
class DisputesIssuingStream(stripeStream):

name = "disputes"
name = "disputes_issuing"
object = "issuing.dispute"
replication_key = "updated"

Expand Down Expand Up @@ -1352,3 +1352,30 @@ def get_records(self, context: Optional[dict]) -> 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()
2 changes: 2 additions & 0 deletions tap_stripe/tap.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
TaxRatesStream,
RefundsStream,
PayoutReportsStream,
DisputesIssuingStream,
)

STREAM_TYPES = [
Expand Down Expand Up @@ -59,6 +60,7 @@
TaxRatesStream,
RefundsStream,
PayoutReportsStream,
DisputesIssuingStream,
]


Expand Down

0 comments on commit 1e8b4ff

Please sign in to comment.