diff --git a/tap_stripe/__init__.py b/tap_stripe/__init__.py index 090ece7c..0ca90c91 100755 --- a/tap_stripe/__init__.py +++ b/tap_stripe/__init__.py @@ -38,6 +38,7 @@ 'payout_transactions': {'sdk_object': stripe.BalanceTransaction, 'key_properties': ['id']}, 'disputes': {'sdk_object': stripe.Dispute, 'key_properties': ['id']}, 'products': {'sdk_object': stripe.Product, 'key_properties': ['id']}, + 'refunds': {'sdk_object': stripe.Refund, 'key_properties': ['id']}, } # I think this can be merged into the above structure @@ -60,6 +61,7 @@ #'invoice_line_items': 'date' 'disputes': 'created', 'products': 'created', + 'refunds': 'created', } STREAM_TO_TYPE_FILTER = { @@ -74,6 +76,7 @@ 'transfers': {'type': 'transfer.*', 'object': 'transfer'}, 'disputes': {'type': 'charge.dispute.*', 'object': 'dispute'}, 'products': {'type': 'product.*', 'object': 'product'}, + 'refunds': {'type': 'refund.*', 'object': 'refund'}, # pylint: disable=bad-continuation # Cannot find evidence of these streams having events associated: # subscription_items - appears on subscriptions events diff --git a/tap_stripe/schemas/refunds.json b/tap_stripe/schemas/refunds.json new file mode 100644 index 00000000..73da320d --- /dev/null +++ b/tap_stripe/schemas/refunds.json @@ -0,0 +1,110 @@ +{ + "type": "object", + "properties": { + "id": { + "type": [ + "null", + "string" + ] + }, + "object": { + "type": [ + "null", + "string" + ] + }, + "amount": { + "type": [ + "null", + "integer" + ] + }, + "balance_transaction": { + "type": [ + "null", + "string" + ] + }, + "charge": { + "type": [ + "null", + "string" + ] + }, + "created": { + "type": [ + "null", + "string" + ], + "format": "date-time" + }, + "currency": { + "type": [ + "null", + "string" + ] + }, + "description": { + "type": [ + "null", + "string" + ] + }, + "metadata": { + "type": [ + "null", + "object" + ], + "properties": {} + }, + "payment_intent": { + "type": [ + "null", + "string" + ] + }, + "reason": { + "type": [ + "null", + "string" + ] + }, + "failure_reason": { + "type": [ + "null", + "string" + ] + }, + "receipt_number": { + "type": [ + "null", + "string" + ] + }, + "source_transfer_reversal": { + "type": [ + "null", + "string" + ] + }, + "status": { + "type": [ + "null", + "string" + ] + }, + "transfer_reversal": { + "type": [ + "null", + "string" + ] + }, + "updated": { + "type": [ + "null", + "string" + ], + "format": "date-time" + } + } +}