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

Persist stripe subscription ID on Subscription #192

Open
wants to merge 2 commits into
base: bt/link-mink
Choose a base branch
from

Conversation

trestrantham
Copy link

Also clones stripe customer ID to subscription owner (Team), too. This keeps backwards compatibility by naming the attribute Subscription#stripe_subscription_id rather than repurposing Subscription#stripe_id (which is really the stripe customer ID).

I didn't see any tests for this concern so please advise if there's a preferred test approach.

end

if subscription_owner.respond_to? :stripe_id
subscription_owner.update(stripe_id: customer.id)
Copy link
Owner

Choose a reason for hiding this comment

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

@trestrantham Hey. Curious why you'd want to write the Stripe ID to the subscription owner instead of just referencing from the Subscription (where it would already be)?

Copy link
Author

Choose a reason for hiding this comment

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

This was just a half measure to moving Stripe::Customer#id from Subscription to Team while maintaining backward compatibility. Ideally IMO, Subscription#stripe_id would be a Stripe::Subscription#id and Team#stripe_id would be a Stripe::Customer#id. I keep getting hung up on the current mismatch. That being said, happy to remove it to avoid confusion. 😄

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