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

Sync all stripe subscriptions not only the active ones #107

Closed

Conversation

Somtom
Copy link
Contributor

@Somtom Somtom commented Dec 22, 2021

Description of change

The default setting of the API is to return only non-cancelled subscriptions - as stated in the docs:

By default, returns a list of subscriptions that have not been canceled. In order to list canceled subscriptions, specify status=canceled.

This leads to the problem that we currently technically only sync not cancelled subscriptions and exclude the cancelled ones. However, it seems that some - but not all - cancelled ones are included in the request (I could not figure out why).
To tackle the problem I did the following changes:

  • Added a request_args parameter to the STREAM_SDK_OBJECTS which can be used to specify additional request parameters for the api call
  • Added a request argument to subscriptions to fetch subscriptions with any status

Manual QA steps

  • Perform an extraction using the master branch -> Perform a SELECT COUNT(*) on the results
  • Perform an extraction using this branch -> Perform a SELECT COUNT(*) on the results -> you should have all subscriptions now

Risks

  • ?

Rollback steps

  • revert this branch

dmosorast added a commit that referenced this pull request Dec 31, 2021
@dmosorast
Copy link
Contributor

@Somtom Thanks for the PR! I just happened to come up with this exact case as well. I've pulled your commit into my branch in #113 to get tests run over it, reviewed, and released. I cherry-picked so the change is associated with your user. Closing this PR.

Cheers!

@dmosorast dmosorast closed this Dec 31, 2021
dmosorast added a commit that referenced this pull request Dec 31, 2021
* Request all types of subscriptions

* 1.5.1 and changelog

* Revert "Request all types of subscriptions" in favor of PR #107

This reverts commit 3fbd7dd.

* Sync all stripe subscriptions not only the active ones

Co-authored-by: Somtom <som_tom@web.de>
@Somtom
Copy link
Contributor Author

Somtom commented Jan 1, 2022

@dmosorast thanks so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants