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

Added initial subscription support with stripe to Members API #10460

Merged
merged 14 commits into from Feb 7, 2019
Merged

Added initial subscription support with stripe to Members API #10460

merged 14 commits into from Feb 7, 2019

Conversation

allouis
Copy link
Contributor

@allouis allouis commented Feb 6, 2019

These changes introduce a new "service" to the members api, which handles getting and creating subscriptions.

This is wired up to get subscription information when creating tokens, and attaching information to the token, so that the Content API can allow/deny access.

Behind the subscription service we have a Stripe "payment processor", this holds the logic for creating subscriptions etc... in Stripe.

The logic for getting items out of stripe uses a hash of the relevant data as the id to search for, this allows us to forgo keeping stripe data in a db, so that this feature can get out quicker.

@@ -32,7 +32,7 @@ module.exports = function cookies(sessionSecret) {
function removeCookie() {
return cookie.serialize('signedin', false, {
maxAge: 0,
path: '/ghost/api/v2/members/token',
path: '/ghost/api/v2/members',
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the reason to remove /token from path here? 🤔

Copy link
Contributor Author

@allouis allouis Feb 7, 2019

Choose a reason for hiding this comment

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

Because the current /subscription endpoint uses the cookie, so we need it to be accessible - this is where a /secure prefix would've been useful!

@allouis allouis merged commit 46bf527 into TryGhost:master Feb 7, 2019
@allouis allouis deleted the subscription-w-stripe branch February 7, 2019 09:41
daniellockyer pushed a commit that referenced this pull request Jul 20, 2022
These changes introduce a new "service" to the members api, which handles getting and creating subscriptions.

This is wired up to get subscription information when creating tokens, and attaching information to the token, so that the Content API can allow/deny access. 

Behind the subscription service we have a Stripe "payment processor", this holds the logic for creating subscriptions etc... in Stripe.

The logic for getting items out of stripe uses a hash of the relevant data as the id to search for, this allows us to forgo keeping stripe data in a db, so that this feature can get out quicker.
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.

None yet

2 participants