Skip to content

Commit

Permalink
fix: update charges steam with extra event types (#193)
Browse files Browse the repository at this point in the history
* fix: charges stream with extra events types

* chore: update charges schema
  • Loading branch information
am6010 authored Jun 10, 2024
1 parent fbbe609 commit bdbde9c
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 20 deletions.
2 changes: 1 addition & 1 deletion airbyte-integrations/connectors/source-stripe/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from setuptools import find_packages, setup

MAIN_REQUIREMENTS = ["airbyte-cdk", "stripe==2.56.0", "pendulum==2.1.2"]
MAIN_REQUIREMENTS = ["airbyte-cdk==0.67", "stripe==2.56.0", "pendulum==2.1.2"]

TEST_REQUIREMENTS = [
"pytest~=6.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -392,24 +392,65 @@
"type": ["null", "string"]
},
"refunds": {
"type": ["null", "object"],
"properties": {
"object": {
"type": ["null", "string"]
},
"data": {
"type": ["null", "array"]
},
"has_more": {
"type": ["null", "boolean"]
},
"total_count": {
"type": ["null", "number"]
},
"url": {
"type": ["null", "string"]
"anyOf": [{
"type": ["null", "object"],
"properties": {
"object": {
"type": ["null", "string"]
},
"data": {
"type": ["null", "array"]
},
"has_more": {
"type": ["null", "boolean"]
},
"total_count": {
"type": ["null", "number"]
},
"url": {
"type": ["null", "string"]
}
}
},{
"type": ["null", "array"],
"items": {
"type": ["null", "object"],
"additionalProperties": true,
"properties": {
"id": {
"type": ["null", "string"]
},
"object": {
"type": ["null", "string"]
},
"amount":{
"type": ["null", "integer"]
},
"balance_transaction": {
"type": ["null", "string"]
},
"currency": {
"type": ["null", "string"]
},
"created": {
"type": ["null", "integer"]
},
"payment_intent": {
"type": ["null", "string"]
},
"reason": {
"type": ["null", "string"]
},
"receipt_number": {
"type": ["null", "string"]
},
"statys": {
"type": ["null", "string"]
}
}
}
}
}
]
},
"application_fee": {
"type": ["null", "string"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,15 @@ class Charges(IncrementalStripeStreamWithUpdates):
"""
API docs: https://stripe.com/docs/api/charges/list
"""
event_types = ["charge.created","charge.updated"]
event_types = [
"charge.captured",
"charge.expired",
"charge.failed",
"charge.pending",
"charge.refunded",
"charge.succeeded",
"charge.updated"
]
cursor_field = "created"

def path(self, **kwargs) -> str:
Expand Down Expand Up @@ -394,7 +402,13 @@ class Disputes(IncrementalStripeStreamWithUpdates):
"""
API docs: https://stripe.com/docs/api/disputes/list
"""
event_types = ["charge.dispute.created", "charge.dispute.updated"]
event_types = [
"charge.dispute.created",
"charge.dispute.updated",
"charge.dispute.closed",
"charge.dispute.funds_reinstated",
"charge.dispute.funds_withdrawn"
]
cursor_field = "created"

def path(self, **kwargs):
Expand Down

0 comments on commit bdbde9c

Please sign in to comment.