|
@@ -49,7 +49,7 @@ module.exports = RecurlyWrapper = {
|
|
|
},
|
|
},
|
|
|
function(error, response, responseBody) {
|
|
function(error, response, responseBody) {
|
|
|
if (error) {
|
|
if (error) {
|
|
|
- logger.error(
|
|
|
|
|
|
|
+ logger.warn(
|
|
|
{ error, user_id: user._id, recurly_token_id },
|
|
{ error, user_id: user._id, recurly_token_id },
|
|
|
'error response from recurly while checking account'
|
|
'error response from recurly while checking account'
|
|
|
)
|
|
)
|
|
@@ -73,7 +73,7 @@ module.exports = RecurlyWrapper = {
|
|
|
account
|
|
account
|
|
|
) {
|
|
) {
|
|
|
if (err) {
|
|
if (err) {
|
|
|
- logger.error(
|
|
|
|
|
|
|
+ logger.warn(
|
|
|
{ err, user_id: user._id, recurly_token_id },
|
|
{ err, user_id: user._id, recurly_token_id },
|
|
|
'error parsing account'
|
|
'error parsing account'
|
|
|
)
|
|
)
|
|
@@ -131,7 +131,7 @@ module.exports = RecurlyWrapper = {
|
|
|
},
|
|
},
|
|
|
(error, response, responseBody) => {
|
|
(error, response, responseBody) => {
|
|
|
if (error) {
|
|
if (error) {
|
|
|
- logger.error(
|
|
|
|
|
|
|
+ logger.warn(
|
|
|
{ error, user_id: user._id, recurly_token_id },
|
|
{ error, user_id: user._id, recurly_token_id },
|
|
|
'error response from recurly while creating account'
|
|
'error response from recurly while creating account'
|
|
|
)
|
|
)
|
|
@@ -142,7 +142,7 @@ module.exports = RecurlyWrapper = {
|
|
|
account
|
|
account
|
|
|
) {
|
|
) {
|
|
|
if (err) {
|
|
if (err) {
|
|
|
- logger.error(
|
|
|
|
|
|
|
+ logger.warn(
|
|
|
{ err, user_id: user._id, recurly_token_id },
|
|
{ err, user_id: user._id, recurly_token_id },
|
|
|
'error creating account'
|
|
'error creating account'
|
|
|
)
|
|
)
|
|
@@ -179,7 +179,7 @@ module.exports = RecurlyWrapper = {
|
|
|
},
|
|
},
|
|
|
(error, response, responseBody) => {
|
|
(error, response, responseBody) => {
|
|
|
if (error) {
|
|
if (error) {
|
|
|
- logger.error(
|
|
|
|
|
|
|
+ logger.warn(
|
|
|
{ error, user_id: user._id, recurly_token_id },
|
|
{ error, user_id: user._id, recurly_token_id },
|
|
|
'error response from recurly while creating billing info'
|
|
'error response from recurly while creating billing info'
|
|
|
)
|
|
)
|
|
@@ -190,7 +190,7 @@ module.exports = RecurlyWrapper = {
|
|
|
billingInfo
|
|
billingInfo
|
|
|
) {
|
|
) {
|
|
|
if (err) {
|
|
if (err) {
|
|
|
- logger.error(
|
|
|
|
|
|
|
+ logger.warn(
|
|
|
{ err, user_id: user._id, accountCode, recurly_token_id },
|
|
{ err, user_id: user._id, accountCode, recurly_token_id },
|
|
|
'error creating billing info'
|
|
'error creating billing info'
|
|
|
)
|
|
)
|
|
@@ -242,7 +242,7 @@ module.exports = RecurlyWrapper = {
|
|
|
},
|
|
},
|
|
|
(error, response, responseBody) => {
|
|
(error, response, responseBody) => {
|
|
|
if (error) {
|
|
if (error) {
|
|
|
- logger.error(
|
|
|
|
|
|
|
+ logger.warn(
|
|
|
{ error, user_id: user._id, recurly_token_id },
|
|
{ error, user_id: user._id, recurly_token_id },
|
|
|
'error response from recurly while setting address'
|
|
'error response from recurly while setting address'
|
|
|
)
|
|
)
|
|
@@ -253,7 +253,7 @@ module.exports = RecurlyWrapper = {
|
|
|
billingInfo
|
|
billingInfo
|
|
|
) {
|
|
) {
|
|
|
if (err) {
|
|
if (err) {
|
|
|
- logger.error(
|
|
|
|
|
|
|
+ logger.warn(
|
|
|
{ err, user_id: user._id, recurly_token_id },
|
|
{ err, user_id: user._id, recurly_token_id },
|
|
|
'error updating billing info'
|
|
'error updating billing info'
|
|
|
)
|
|
)
|
|
@@ -291,7 +291,7 @@ module.exports = RecurlyWrapper = {
|
|
|
},
|
|
},
|
|
|
(error, response, responseBody) => {
|
|
(error, response, responseBody) => {
|
|
|
if (error) {
|
|
if (error) {
|
|
|
- logger.error(
|
|
|
|
|
|
|
+ logger.warn(
|
|
|
{ error, user_id: user._id, recurly_token_id },
|
|
{ error, user_id: user._id, recurly_token_id },
|
|
|
'error response from recurly while creating subscription'
|
|
'error response from recurly while creating subscription'
|
|
|
)
|
|
)
|
|
@@ -302,7 +302,7 @@ module.exports = RecurlyWrapper = {
|
|
|
subscription
|
|
subscription
|
|
|
) {
|
|
) {
|
|
|
if (err) {
|
|
if (err) {
|
|
|
- logger.error(
|
|
|
|
|
|
|
+ logger.warn(
|
|
|
{ err, user_id: user._id, recurly_token_id },
|
|
{ err, user_id: user._id, recurly_token_id },
|
|
|
'error creating subscription'
|
|
'error creating subscription'
|
|
|
)
|
|
)
|
|
@@ -340,7 +340,7 @@ module.exports = RecurlyWrapper = {
|
|
|
],
|
|
],
|
|
|
function(err, result) {
|
|
function(err, result) {
|
|
|
if (err) {
|
|
if (err) {
|
|
|
- logger.error(
|
|
|
|
|
|
|
+ logger.warn(
|
|
|
{ err, user_id: user._id, recurly_token_id },
|
|
{ err, user_id: user._id, recurly_token_id },
|
|
|
'error in paypal subscription creation process'
|
|
'error in paypal subscription creation process'
|
|
|
)
|
|
)
|
|
@@ -348,7 +348,7 @@ module.exports = RecurlyWrapper = {
|
|
|
}
|
|
}
|
|
|
if (!result.subscription) {
|
|
if (!result.subscription) {
|
|
|
err = new Error('no subscription object in result')
|
|
err = new Error('no subscription object in result')
|
|
|
- logger.error(
|
|
|
|
|
|
|
+ logger.warn(
|
|
|
{ err, user_id: user._id, recurly_token_id },
|
|
{ err, user_id: user._id, recurly_token_id },
|
|
|
'error in paypal subscription creation process'
|
|
'error in paypal subscription creation process'
|
|
|
)
|
|
)
|
|
@@ -431,7 +431,7 @@ module.exports = RecurlyWrapper = {
|
|
|
response.statusCode !== 204 &&
|
|
response.statusCode !== 204 &&
|
|
|
(response.statusCode !== 404 || !expect404)
|
|
(response.statusCode !== 404 || !expect404)
|
|
|
) {
|
|
) {
|
|
|
- logger.err(
|
|
|
|
|
|
|
+ logger.warn(
|
|
|
{
|
|
{
|
|
|
err: error,
|
|
err: error,
|
|
|
body,
|
|
body,
|
|
@@ -545,7 +545,7 @@ module.exports = RecurlyWrapper = {
|
|
|
}
|
|
}
|
|
|
return RecurlyWrapper._parseXml(body, function(err, data) {
|
|
return RecurlyWrapper._parseXml(body, function(err, data) {
|
|
|
if (err != null) {
|
|
if (err != null) {
|
|
|
- logger.err({ err }, 'could not get accoutns')
|
|
|
|
|
|
|
+ logger.warn({ err }, 'could not get accoutns')
|
|
|
callback(err)
|
|
callback(err)
|
|
|
}
|
|
}
|
|
|
allAccounts = allAccounts.concat(data.accounts)
|
|
allAccounts = allAccounts.concat(data.accounts)
|
|
@@ -699,7 +699,7 @@ module.exports = RecurlyWrapper = {
|
|
|
},
|
|
},
|
|
|
(error, response, responseBody) => {
|
|
(error, response, responseBody) => {
|
|
|
if (error != null) {
|
|
if (error != null) {
|
|
|
- logger.err({ err: error, coupon_code }, 'error creating coupon')
|
|
|
|
|
|
|
+ logger.warn({ err: error, coupon_code }, 'error creating coupon')
|
|
|
}
|
|
}
|
|
|
return callback(error)
|
|
return callback(error)
|
|
|
}
|
|
}
|
|
@@ -785,7 +785,7 @@ module.exports = RecurlyWrapper = {
|
|
|
},
|
|
},
|
|
|
(error, response, responseBody) => {
|
|
(error, response, responseBody) => {
|
|
|
if (error != null) {
|
|
if (error != null) {
|
|
|
- logger.err(
|
|
|
|
|
|
|
+ logger.warn(
|
|
|
{ err: error, account_code, coupon_code },
|
|
{ err: error, account_code, coupon_code },
|
|
|
'error redeeming coupon'
|
|
'error redeeming coupon'
|
|
|
)
|
|
)
|
|
@@ -812,7 +812,7 @@ module.exports = RecurlyWrapper = {
|
|
|
},
|
|
},
|
|
|
(error, response, responseBody) => {
|
|
(error, response, responseBody) => {
|
|
|
if (error != null) {
|
|
if (error != null) {
|
|
|
- logger.err(
|
|
|
|
|
|
|
+ logger.warn(
|
|
|
{ err: error, subscriptionId, daysUntilExpire },
|
|
{ err: error, subscriptionId, daysUntilExpire },
|
|
|
'error exending trial'
|
|
'error exending trial'
|
|
|
)
|
|
)
|