Просмотр исходного кода

Merge pull request #14048 from overleaf/mj-recurly-script-update

[web] recurly resync script update

GitOrigin-RevId: 798cb73f46b763f6ece6b12d63fe82fbcc6c2920
Tim Down 3 лет назад
Родитель
Сommit
800c9d63b4

+ 3 - 0
services/web/app/src/Features/Subscription/RecurlyWrapper.js

@@ -472,6 +472,9 @@ const RecurlyWrapper = {
         (response.statusCode !== 404 || !expect404) &&
         (response.statusCode !== 422 || !expect422)
       ) {
+        if (options.headers.Authorization) {
+          options.headers.Authorization = 'REDACTED'
+        }
         logger.warn(
           {
             err: error,

+ 8 - 4
services/web/scripts/recurly/resync_subscriptions.js

@@ -30,12 +30,16 @@ const ScriptLogger = {
     ScriptLogger.mismatchSubscriptionsCount += 1
     const mismatchReasonsString = JSON.stringify(mismatchReasons)
     if (ScriptLogger.allMismatchReasons[mismatchReasonsString]) {
-      ScriptLogger.allMismatchReasons[mismatchReasonsString].push(
-        subscription._id
-      )
+      ScriptLogger.allMismatchReasons[mismatchReasonsString].push({
+        id: subscription._id,
+        name: subscription.planCode,
+      })
     } else {
       ScriptLogger.allMismatchReasons[mismatchReasonsString] = [
-        subscription._id,
+        {
+          id: subscription._id,
+          name: subscription.planCode,
+        },
       ]
     }
   },