diff --git a/services/web/app/coffee/Features/Subscription/RecurlyWrapper.coffee b/services/web/app/coffee/Features/Subscription/RecurlyWrapper.coffee index 75d1f1667a..5f0c7877f4 100644 --- a/services/web/app/coffee/Features/Subscription/RecurlyWrapper.coffee +++ b/services/web/app/coffee/Features/Subscription/RecurlyWrapper.coffee @@ -35,7 +35,7 @@ module.exports = RecurlyWrapper = ) , (result, next) -> # create account - if !result.userExists + if result.userExists logger.log {user_id: user._id, recurly_token_id}, "user already exists in recurly" return next(null, result) logger.log {user_id: user._id, recurly_token_id}, "creating user in recurly" @@ -51,9 +51,9 @@ module.exports = RecurlyWrapper =
#{address.address1} #{address.address2} - #{address.city} - #{address.state} - #{address.zip} + #{address.city || ''} + #{address.state || ''} + #{address.zip || ''} #{address.country}
@@ -112,9 +112,9 @@ module.exports = RecurlyWrapper = #{address.address1} #{address.address2} - #{address.city} - #{address.state} - #{address.zip} + #{address.city || ''} + #{address.state || ''} + #{address.zip || ''} #{address.country} """ @@ -455,6 +455,8 @@ module.exports = RecurlyWrapper = return callback(error) if error? if data? and data.account? billingInfo = data.billing_info + else if data? and data.billing_info? + billingInfo = data.billing_info else return callback "I don't understand the response from Recurly" callback null, billingInfo