-
-
Notifications
You must be signed in to change notification settings - Fork 10k
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 member's subscription cancellation helper {{cancel_link}} #11434
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Looks good to me!
The only thing it might be missing is the errorEl
logic that you see in some of the other handlers in public/members.js
@allouis good point on this one! Have added handling and added a text which needs a copy review: Also, have seen a console.error(err); in |
@gargol I think you can still nest the error element for now, just like we do with the |
We are listening to a button, so there's not much to be nested in I think. Will adjust as clearer wireframes are confirmed. For now, it's a rough prototype so is fine like this with a thought to be changed. |
This is how we currently document it for the So if we have this one as different then IMO we should maybe update the other stuff too |
Oh 😮 it makes sense! Good point! |
4a72f32
to
b5486fc
Compare
4f1bdbc
to
ea3e6ed
Compare
@@ -0,0 +1,25 @@ | |||
const commands = require('../../../schema').commands; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@allouis & @rishabhgrg this commit has a tiny migration and some schema changes. Would need your 👍 for this as usual 😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gargol Looks good 👍
9bdf1ce
to
78b7d47
Compare
refs #TryGhost/Ghost#11434 - Added method to allow updating single subscription. Only `cancel_at_period_end` field can be updated. - Middleware is needed to allow Ghost Core to cancel/uncancel member's subscription. - Relies on the request containing identity information to be able to verify if subscription belongs to the user - When member could not be identified by the identity information present in the request we should throw instead of continuing processing - Handling and messaging inspired by https://github.com/TryGhost/Ghost/blob/3.1.1/core/server/services/mega/mega.js#L132 - When the user initiates subscription cancellation we can safely mark the subscription as canceled so that it's not shown in the interface on subsequent request. Otherwise, we end up in a situation where we still return the subscription in the period until Stripe triggers the webhook. - Added boolean coercion for cancel_at_period_end parameter. If anything but boolean is passed to Stripe API it throws an error. Coercing the value on our side is a gives a better dev experience
refs TryGhost/Ghost#11434 - Added {{cancel_link}} to know helper in canary spec - Updated compile test structure to test version-specific changes - The previous structure only tested v1 spec and didn't take into account any new 'allowed helpers' - The new structure resembles one in deprecations and can be easily extended with new helpers on a per-version basis
- Allows to create elements with `data-members-cancel-subscription` attribute which would call subscription canellation
- This is more apporpriate palce for this endpoint.
…or' element - We are not inside the form, so there needs to be a separate element which would define where the error should be shown
- We need to store auto-renewal/cancellation state on our side to be able to display it to the member
- We need 2 states handled for subscription, for that reason PUT with a flag makes more sense than a DELETE
- As discussed we only add single column to subscriptions table to avoid preoptimizing for future cases
…continue-subscription - This corresponds better to the intention of the action and matches parameter names for the {{cancel_link}} helper
- This is needed so that the check is also performed when the member flag in settings is toggled during runtime
… subscription context
- Needed to use `updateSubscription` middleware
- Needed to recognize new {{cancel_link}} helper
550866c
to
bbaf0ba
Compare
refs TryGhost/Ghost#11434 - Adds {{cancel_link}} use to the `account.hbs` page which allows to cancel or continue member's subscription. - Adds some subscription specific data on the account page to give more context to the member.
refs ##11434 - Added method to allow updating single subscription. Only `cancel_at_period_end` field can be updated. - Middleware is needed to allow Ghost Core to cancel/uncancel member's subscription. - Relies on the request containing identity information to be able to verify if subscription belongs to the user - When member could not be identified by the identity information present in the request we should throw instead of continuing processing - Handling and messaging inspired by https://github.com/TryGhost/Ghost/blob/3.1.1/core/server/services/mega/mega.js#L132 - When the user initiates subscription cancellation we can safely mark the subscription as canceled so that it's not shown in the interface on subsequent request. Otherwise, we end up in a situation where we still return the subscription in the period until Stripe triggers the webhook. - Added boolean coercion for cancel_at_period_end parameter. If anything but boolean is passed to Stripe API it throws an error. Coercing the value on our side is a gives a better dev experience
refs TryGhost/Ghost#11434 - Adds {{cancel_link}} use to the `account.hbs` page which allows to cancel or continue member's subscription. - Adds some subscription specific data on the account page to give more context to the member.
refs TryGhost/Members#107
data-members-cancel-subscription
attribute.DELETE /subscriptions/:id
which allows canceling membership by subscription_id@peterzimon the naming of the
data-members-cancel-subscription
needs confirmation. Also, currently reloading the page withwindow.location.reload();
after the request succeeds, this flow needs some design input as well 😉@allouis would be great 🙌 if you could give a second pair of 👀 but we discussed this in the pitch enough I think 😃