mirror of
https://github.com/empayre/fleet.git
synced 2024-11-06 08:55:24 +00:00
Website: Add two events to stripe webhook, add comments about when events are sent. (#14370)
Changes: - Added the `invoice.updated` and `invoice.voided` events to the `STRIPE_EVENTS_SENT_BEFORE_A_SUBSCRIPTION_RECORD_EXISTS` array in the `receive-from-stripe` webhook.
This commit is contained in:
parent
1555d09f57
commit
eafc9ab313
@ -69,12 +69,14 @@ module.exports = {
|
|||||||
let subscriptionForThisEvent = await Subscription.findOne({stripeSubscriptionId: subscriptionIdToFind}).populate('user');
|
let subscriptionForThisEvent = await Subscription.findOne({stripeSubscriptionId: subscriptionIdToFind}).populate('user');
|
||||||
|
|
||||||
let STRIPE_EVENTS_SENT_BEFORE_A_SUBSCRIPTION_RECORD_EXISTS = [
|
let STRIPE_EVENTS_SENT_BEFORE_A_SUBSCRIPTION_RECORD_EXISTS = [
|
||||||
'invoice.created',
|
'invoice.created',// Sent when a user submits the billing form on /customers/new-license, before the user's biliing card is charged.
|
||||||
'invoice.finalized',
|
'invoice.finalized',// Sent when a user submits the billing form on /customers/new-license, before the user's biliing card is charged.
|
||||||
'invoice.paid',
|
'invoice.paid',//Sent when a user submits the billing form on /customers/new-license, when the user's biliing card is charged.
|
||||||
'invoice.payment_succeeded',
|
'invoice.payment_succeeded',// Sent when payment for a users subscription is successful. The save-billing-info-and-subscribe action will check for this event before creating a license key.
|
||||||
'invoice.payment_failed',
|
'invoice.payment_failed',// Sent when a users subscritpion payment fails. This can happen before we create a license key and save the subscription in the database.
|
||||||
'invoice.payment_action_required',
|
'invoice.payment_action_required',// Sent when a user's billing card requires additional verification from stripe.
|
||||||
|
'invoice.updated',// Sent before an incomplete invoice is voided. (~24 hours after a payment fails)
|
||||||
|
'invoice.voided',// Sent when an incomplete invoice is marked as voided. (~24 hours after a payment fails)
|
||||||
];
|
];
|
||||||
|
|
||||||
// If this event is for a subscription that was just created, we won't have a matching Subscription record in the database. This is because we wait until the subscription's invoice is paid to create the record in our database.
|
// If this event is for a subscription that was just created, we won't have a matching Subscription record in the database. This is because we wait until the subscription's invoice is paid to create the record in our database.
|
||||||
|
Loading…
Reference in New Issue
Block a user