mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-28 01:55:38 -05:00
Merge branch 'master' into production
This commit is contained in:
commit
5c70321741
1 changed files with 4 additions and 1 deletions
|
@ -161,7 +161,10 @@ module.exports.setup = (app) ->
|
||||||
_.remove(stripeInfo.recipients, (s) -> s.userID is recipient.id)
|
_.remove(stripeInfo.recipients, (s) -> s.userID is recipient.id)
|
||||||
options =
|
options =
|
||||||
quantity: utils.getSponsoredSubsAmount(subscription.plan.amount, stripeInfo.recipients.length, stripeInfo.subscriptionID?)
|
quantity: utils.getSponsoredSubsAmount(subscription.plan.amount, stripeInfo.recipients.length, stripeInfo.subscriptionID?)
|
||||||
console.log 'Updating sponsored subscription', stripeInfo.customerID, stripeInfo.sponsorSubscriptionID, options, 'from stripeInfo', stripeInfo, 'and subscription', subscription, 'for user', recipient.id, 'with sponsor', sponsor.id
|
unless stripeInfo.sponsorSubscriptionID
|
||||||
|
# TODO: fix #2786 error for a particular customer which doesn't have this
|
||||||
|
console.error "Couldn't find sponsorSubscriptionID from stripeInfo", stripeInfo, 'for customer', stripeInfo.customerID, 'with options', options, 'and subscription', subscription, 'for user', recipient.id, 'with sponsor', sponsor.id
|
||||||
|
return res.send(500, '')
|
||||||
stripe.customers.updateSubscription stripeInfo.customerID, stripeInfo.sponsorSubscriptionID, options, (err, subscription) =>
|
stripe.customers.updateSubscription stripeInfo.customerID, stripeInfo.sponsorSubscriptionID, options, (err, subscription) =>
|
||||||
if err
|
if err
|
||||||
logStripeWebhookError(err)
|
logStripeWebhookError(err)
|
||||||
|
|
Loading…
Reference in a new issue