Skip to content

#784 - Redirect to Project Page if User Already Has a Subscription - #794

Closed
alexgraffeocohen wants to merge 3 commits into
code-corps:developfrom
alexgraffeocohen:784-users-with-a-subscription-cannot-create-new-one
Closed

#784 - Redirect to Project Page if User Already Has a Subscription#794
alexgraffeocohen wants to merge 3 commits into
code-corps:developfrom
alexgraffeocohen:784-users-with-a-subscription-cannot-create-new-one

Conversation

@alexgraffeocohen

@alexgraffeocohen alexgraffeocohen commented Nov 28, 2016

Copy link
Copy Markdown

This is still a work in progress, but the idea is to put in a check in the afterModel hook of the donate route for whether the current user has a stripe subscription for a project already. If so, redirect to the project page.

So far, the user.stripeConnectSubscriptions collection seems to be available, but I am having trouble traversing the object graph when inspecting an individual subscription in the find loop. Maybe mirage isn't setting up the obejcts properly?

Also updated errors in the mirage models.

Will Fix #784

@joshsmith joshsmith added this to the Donations milestone Nov 28, 2016
@joshsmith joshsmith modified the milestones: Donations, Improve Donations Nov 30, 2016
@alexgraffeocohen
alexgraffeocohen force-pushed the 784-users-with-a-subscription-cannot-create-new-one branch from e8d0e9c to 947076e Compare November 30, 2016 04:52
@joshsmith

Copy link
Copy Markdown
Contributor

@alexwilkinson maybe we want to put all this into a service object and take an approach similar to some of the other services there (like the user skills one).

@alexgraffeocohen

Copy link
Copy Markdown
Author

@joshsmith Definitely fond of that idea—I was thinking of doing that from the start, once the logic had been figured out.

@begedin

begedin commented Dec 1, 2016

Copy link
Copy Markdown
Contributor

@alexwilkinson I'm sorry not to have realised this sooner, but I was actually working on the same solution. We seem to have duplicate issues, #784 and #798, one of which was assigned to you and another to myself. I'm dealing with mine in #803

Mine is just about ready to merge and contains other fixes, but it only deals with redirection from the project.donate route.

Once it's merged, I was thinking we should revisit your issue (since based on title alone, it's wider in scope) and figure out if anything else is needed in relation to a user already having a subscription.

I apologize for the inconvenience. It was an honest mistake on my part, since you clearly started on your issue sooner. We'll work on avoiding these sort of misunderstandings in the future.

@alexgraffeocohen

alexgraffeocohen commented Dec 1, 2016

Copy link
Copy Markdown
Author

@begedin That's ok!! You got much further along anyways, and if my little work on this Issue just ended up helping me get acclimated to the project, that's useful too : ). I'll just note on your PR another mirage model that you can fix while you're at it—something @joshsmith discovered while we were discussing my mirage struggles.

The only thing that could be revisited around this Issue would be potentially showing a more useful page to the user in the situation where they already have a subscription, instead of just redirecting. That conversation is in #784. I'm going to make a new Issue about that.

@joshsmith

Copy link
Copy Markdown
Contributor

@alexwilkinson not sure if you made a new issue, but please do when you get a chance!

@joshsmith joshsmith closed this Dec 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants