mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-27 17:45:40 -05:00
Add backwards compatibility check for Stripe sub search
This commit is contained in:
parent
af89452b93
commit
fde8904fd8
1 changed files with 6 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue