0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-10 23:36:14 -05:00

Stored cancellation reason in local database (#222)

refs https://github.com/TryGhost/Ghost/issues/12403
refs https://github.com/TryGhost/Ghost/pull/12405

This smol change means that we keep our local cancellation_reason column in sync with what we set in Stripe metadata
This commit is contained in:
Fabien 'egg' O'Carroll 2020-11-23 16:50:03 +00:00 committed by GitHub
parent da00444961
commit ecd5bb2c01

View file

@ -453,6 +453,7 @@ module.exports = class StripePaymentProcessor {
subscription_id: subscription.id,
status: subscription.status,
cancel_at_period_end: subscription.cancel_at_period_end,
cancellation_reason: subscription.metadata && subscription.metadata.cancellation_reason || null,
current_period_end: new Date(subscription.current_period_end * 1000),
start_date: new Date(subscription.start_date * 1000),
default_payment_card_last4: payment && payment.card && payment.card.last4 || null,