Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

source-stripe-native: query for payment_method.detached event #2181

Merged
merged 3 commits into from
Dec 9, 2024

Conversation

Alex-Bair
Copy link
Contributor

@Alex-Bair Alex-Bair commented Dec 4, 2024

Description:

This PR's scope includes:

  • Updating the docs URL to point to the appropriate connector docs.
    • The docs don't actually exist yet, but when they do, they'll exist at the updated URL.
  • Updating the capture snapshot since Stripe added some fields to a handful of streams.
    • It'd be nice if these types of backwards-compatible field additions were handled automatically somehow & didn't require us to manually update snapshots. Doing that sounds like it'd take some time & provide little immediate benefit, so I opted to just update the capture snapshot so I can work on higher priority issues.
  • Including the payment_method.detached event as an event the PaymentMethods stream listens for during incremental replication.
    • Detaching a payment method sounds like an irreversible change per the Stripe docs (it can't be used or re-attached). It certainly feels like a delete, but I think Stripe retains all payment method data for audit reasons. Because of this, I chose to consider payment_method.detached events as updates rather than deletes.
  • Increasing the default resource update interval to 5 minutes.
    • Users have seen their other Stripe integrations get rate-limited due to the massive number of API requests the connector makes. Increasing the default interval from 0s to 5m should help reduce the number of API requests the connector makes.

Workflow steps:

(How does one use this feature, and how has it changed)

Documentation links affected:

Docs don't currently exist for this connector, but they should be created.

Notes for reviewers:

Confirmed that:

  • payment_method.detached events are generated by Stripe and are accessible via the /events endpoint.
  • The connector still builds successfully and the PaymentMethods stream replicates data on a local stack.

This change is Reviewable

@Alex-Bair Alex-Bair added the change:unplanned Unplanned change, useful for things like doc updates label Dec 4, 2024
@Alex-Bair Alex-Bair requested a review from a team December 4, 2024 19:36
@Alex-Bair Alex-Bair marked this pull request as ready for review December 4, 2024 19:36
Stripe added `outcome.network_advice_code` and `network_decline_code`
fields to various streams. This broke our capture snapshot test. It'd be
nice if this type of backwards-compatible field addition was
automatically handled in capture snapshots for SaaS connectors somehow.
Doing that sounds like a relatively large lift with little immediate
benefit, so this PR just updates the capture snapshot so tests pass.

The docs URL is also updated to actually point to the appropriate
connector docs.
We've been seeing a significant number of rate-limiting errors, and
users have seen their other Stripe integrations getting rate-limited
because the connector sends a massive number of API requests. Increasing
the default interval to 5 minutes should help reduce the number of API
requests the connector makes.

Other improvements could be made to reduce the number of API requests
the connector makes. Primarily, the connector could dispatch events to
different bindings based on the event type instead of having each
binding check the `/events` endpoint. However, that's a significant
refactor that will take some time & should be prioritized against all of
the other work that needs done.
@Alex-Bair Alex-Bair force-pushed the bair/stripe-native-payment-method-detached-event branch from bbeefa9 to ba96ee6 Compare December 6, 2024 19:21
Copy link
Member

@williamhbaker williamhbaker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Alex-Bair Alex-Bair merged commit 164238c into main Dec 9, 2024
73 of 79 checks passed
@Alex-Bair Alex-Bair deleted the bair/stripe-native-payment-method-detached-event branch December 9, 2024 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
change:unplanned Unplanned change, useful for things like doc updates
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants