0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-24 23:48:13 -05:00

Updated Stripe Subscription status label handling (#1784)

refs https://github.com/TryGhost/Ghost/issues/12256

* Replace `_` in stripe's status with space to setup proper status label for subscriptions
* Displayed subscription status for cancelled subscriptions

Co-authored-by: Fabien O'Carroll <fabien@allou.is>
This commit is contained in:
Rishabh Garg 2020-11-25 16:15:18 +05:30 committed by GitHub
parent f476c268b5
commit 1dd2b33499
2 changed files with 2 additions and 2 deletions

View file

@ -165,7 +165,7 @@
<tr> <tr>
<td class="gh-member-stripe-label">Status</td> <td class="gh-member-stripe-label">Status</td>
<td class="gh-member-stripe-data"> <td class="gh-member-stripe-data">
{{#if subscription.cancelAtPeriodEnd}} {{#if (and subscription.cancelAtPeriodEnd (not-eq subscription.status 'canceled'))}}
<span class="gh-member-cancels-on-label">Cancels on {{subscription.validUntil}}</span> <span class="gh-member-cancels-on-label">Cancels on {{subscription.validUntil}}</span>
{{else}} {{else}}
<span class="gh-member-stripe-status">{{subscription.statusLabel}}</span> <span class="gh-member-stripe-status">{{subscription.statusLabel}}</span>

View file

@ -33,7 +33,7 @@ export default Component.extend({
let subscriptions = this.member.get('stripe'); let subscriptions = this.member.get('stripe');
if (subscriptions && subscriptions.length > 0) { if (subscriptions && subscriptions.length > 0) {
return subscriptions.map((subscription) => { return subscriptions.map((subscription) => {
const statusLabel = subscription.status === 'past_due' ? 'Past due' : subscription.status; const statusLabel = subscription.status ? subscription.status.replace('_', ' ') : '';
return { return {
id: subscription.id, id: subscription.id,
customer: subscription.customer, customer: subscription.customer,