Add backwards compatibility check for Stripe sub search

This commit is contained in:
Matt Lott 2015-03-13 15:39:19 -07:00
parent af89452b93
commit fde8904fd8

View file

@ -38,6 +38,12 @@ module.exports =
if userID? and sub.metadata?.id is userID
unless subscription?.cancel_at_period_end is false
subscription = sub
# Check for backwards compatible basic subscription search
# Only recipient subscriptions are currently searched for via userID
if userID? and not sub.metadata?.id and sub.plan?.id is 'basic'
subscription ?= sub
return done(subscription) if subscription?.cancel_at_period_end is false
if subscriptions.has_more