Skip to content

Commit

Permalink
source-stripe-native: switch Payouts to a no events stream
Browse files Browse the repository at this point in the history
No `payout.*` events are generated by Stripe despite being detailed in their docs, so we can't rely on those events to do incremental replication. Instead, we can treat `Payouts` as a no event stream. It seems like most payouts aren't updated after creation, so this strategy should work fine most of the time.
  • Loading branch information
Alex-Bair committed Sep 23, 2024
1 parent 087de9f commit 3539fd5
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions source-stripe-native/source_stripe_native/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,18 +443,11 @@ class PaymentIntent(BaseStripeObjectWithEvents):


# Despite listing various payout.* event types, Stripe does not generate
# these events.
class Payouts(BaseStripeObjectWithEvents):
# these events. It seems like most payouts are not updated after creation,
# so treating them as a no event stream should work well enough most of the time.
class Payouts(BaseStripeObjectNoEvents):
NAME: ClassVar[str] = "Payouts"
SEARCH_NAME: ClassVar[str] = "payouts"
EVENT_TYPES: ClassVar[dict[str, Literal["c", "u", "d"]]] = {
"payout.created": "c",
"payout.updated": "u",
"payout.canceled": "u",
"payout.failed": "u",
"payout.paid": "u",
"payout.reconciliation_completed": "u",
}


class Plans(BaseStripeObjectWithEvents):
Expand Down

0 comments on commit 3539fd5

Please sign in to comment.