Skip to content

Persist stripe subscription ID on Subscription - #192

Open
trestrantham wants to merge 2 commits into
andrewculver:bt/link-minkfrom
trestrantham:tt/save-subscription-id
Open

trestrantham wants to merge 2 commits into
andrewculver:bt/link-minkfrom
trestrantham:tt/save-subscription-id

Conversation

@trestrantham

Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown
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