backend-manager 5.9.5 → 5.9.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (244) hide show
  1. package/package.json +8 -1
  2. package/src/test/fixtures/firebase-project/.temp/newsletter/run-2026-06-11T03-28-07/metadata.json +14 -0
  3. package/src/test/fixtures/firebase-project/.temp/newsletter/run-2026-06-11T03-28-07/newsletter.html +486 -0
  4. package/src/test/fixtures/firebase-project/.temp/newsletter/run-2026-06-11T03-28-07/newsletter.md +41 -0
  5. package/src/test/fixtures/firebase-project/.temp/newsletter/run-2026-06-11T03-28-07/newsletter.mjml +97 -0
  6. package/{test/email/fixtures/clean.json → src/test/fixtures/firebase-project/.temp/newsletter/run-2026-06-11T03-28-07/structure.json} +16 -4
  7. package/src/test/fixtures/firebase-project/.temp/newsletter/run-2026-06-11T03-28-07/summary.md +1 -0
  8. package/src/test/fixtures/firebase-project/.temp/newsletter/run-2026-06-18T01-00-28/metadata.json +14 -0
  9. package/src/test/fixtures/firebase-project/.temp/newsletter/run-2026-06-18T01-00-28/newsletter.html +486 -0
  10. package/src/test/fixtures/firebase-project/.temp/newsletter/run-2026-06-18T01-00-28/newsletter.md +41 -0
  11. package/src/test/fixtures/firebase-project/.temp/newsletter/run-2026-06-18T01-00-28/newsletter.mjml +97 -0
  12. package/src/test/fixtures/firebase-project/.temp/newsletter/run-2026-06-18T01-00-28/structure.json +42 -0
  13. package/src/test/fixtures/firebase-project/.temp/newsletter/run-2026-06-18T01-00-28/summary.md +1 -0
  14. package/src/test/fixtures/firebase-project/.temp/newsletter/run-2026-06-18T01-01-34/metadata.json +14 -0
  15. package/src/test/fixtures/firebase-project/.temp/newsletter/run-2026-06-18T01-01-34/newsletter.html +486 -0
  16. package/src/test/fixtures/firebase-project/.temp/newsletter/run-2026-06-18T01-01-34/newsletter.md +41 -0
  17. package/src/test/fixtures/firebase-project/.temp/newsletter/run-2026-06-18T01-01-34/newsletter.mjml +97 -0
  18. package/src/test/fixtures/firebase-project/.temp/newsletter/run-2026-06-18T01-01-34/structure.json +42 -0
  19. package/src/test/fixtures/firebase-project/.temp/newsletter/run-2026-06-18T01-01-34/summary.md +1 -0
  20. package/src/test/fixtures/firebase-project/.temp/test-mode.json +6 -0
  21. package/src/test/fixtures/firebase-project/database-debug.log +12 -0
  22. package/src/test/fixtures/firebase-project/firestore-debug.log +136 -0
  23. package/src/test/fixtures/firebase-project/pubsub-debug.log +17 -0
  24. package/.codeclimate.yml +0 -32
  25. package/.nvmrc +0 -1
  26. package/CHANGELOG.md +0 -1440
  27. package/PROGRESS.md +0 -93
  28. package/TODO-2.md +0 -121
  29. package/TODO-CHARGEBLAST.md +0 -32
  30. package/TODO-WEBHOOK-KEY-LEGACY-REMOVAL.md +0 -15
  31. package/TODO-WEBHOOK-KEY-UPGRADE.md +0 -138
  32. package/TODO-email-auth.md +0 -14
  33. package/TODO.md +0 -187
  34. package/plans/mcp2.md +0 -247
  35. package/plans/suspended-subscription-dead-zone.md +0 -97
  36. package/scripts/test-helper-providers.js +0 -162
  37. package/scripts/update-disposable-domains.js +0 -44
  38. package/templates/_.env +0 -42
  39. package/templates/_.gitignore +0 -60
  40. package/templates/backend-manager-config.json +0 -249
  41. package/templates/database.rules.json +0 -83
  42. package/templates/firebase.json +0 -66
  43. package/templates/firestore.indexes.json +0 -4
  44. package/templates/firestore.rules +0 -112
  45. package/templates/public/404.html +0 -26
  46. package/templates/public/index.html +0 -24
  47. package/templates/remoteconfig.template.json +0 -1
  48. package/templates/storage-lifecycle-config-1-day.json +0 -9
  49. package/templates/storage-lifecycle-config-30-days.json +0 -9
  50. package/templates/storage.rules +0 -8
  51. package/test/_init/accounts-validation.js +0 -58
  52. package/test/_legacy/ai/index.js +0 -231
  53. package/test/_legacy/ai/test.jpg +0 -0
  54. package/test/_legacy/ai/test.pdf +0 -0
  55. package/test/_legacy/index.js +0 -31
  56. package/test/_legacy/payment-resolver/chargebee/orders/refunded.json +0 -0
  57. package/test/_legacy/payment-resolver/chargebee/orders/unpaid.json +0 -98
  58. package/test/_legacy/payment-resolver/chargebee/subscriptions/active.json +0 -578
  59. package/test/_legacy/payment-resolver/chargebee/subscriptions/trial-in-trial.json +0 -38
  60. package/test/_legacy/payment-resolver/chargebee/subscriptions/trial-skipped-to-active.json +0 -135
  61. package/test/_legacy/payment-resolver/chargebee/subscriptions/trial-to-active-to-cancelled.json +0 -42
  62. package/test/_legacy/payment-resolver/chargebee/subscriptions/trial-to-active.json +0 -44
  63. package/test/_legacy/payment-resolver/chargebee/subscriptions/trial-to-cancelled.json +0 -39
  64. package/test/_legacy/payment-resolver/chargebee/subscriptions/trial-to-refund.json +0 -143
  65. package/test/_legacy/payment-resolver/chargebee/subscriptions/trial-to-suspended.json +0 -48
  66. package/test/_legacy/payment-resolver/coinbase/orders/regular.json +0 -204
  67. package/test/_legacy/payment-resolver/coinbase/subscriptions/cancelled.json +0 -204
  68. package/test/_legacy/payment-resolver/coinbase/subscriptions/paid-2.json +0 -125
  69. package/test/_legacy/payment-resolver/index.js +0 -1558
  70. package/test/_legacy/payment-resolver/paypal/orders/refunded.json +0 -0
  71. package/test/_legacy/payment-resolver/paypal/orders/regular.json +0 -120
  72. package/test/_legacy/payment-resolver/paypal/subscriptions/active-refund-previous-stmnt.json +0 -323
  73. package/test/_legacy/payment-resolver/paypal/subscriptions/active.json +0 -192
  74. package/test/_legacy/payment-resolver/paypal/subscriptions/trial-in-trial.json +0 -125
  75. package/test/_legacy/payment-resolver/paypal/subscriptions/trial-payment-not-complete.json +0 -76
  76. package/test/_legacy/payment-resolver/paypal/subscriptions/trial-payment-overdue-2.json +0 -114
  77. package/test/_legacy/payment-resolver/paypal/subscriptions/trial-payment-overdue.json +0 -114
  78. package/test/_legacy/payment-resolver/paypal/subscriptions/trial-to-active-to-cancelled.json +0 -111
  79. package/test/_legacy/payment-resolver/paypal/subscriptions/trial-to-active.json +0 -132
  80. package/test/_legacy/payment-resolver/paypal/subscriptions/trial-to-cancelled.json +0 -107
  81. package/test/_legacy/payment-resolver/paypal/subscriptions/trial-to-expired.json +0 -91
  82. package/test/_legacy/payment-resolver/paypal/subscriptions/trial-to-refund.json +0 -147
  83. package/test/_legacy/payment-resolver/paypal/subscriptions/trial-to-suspended.json +0 -120
  84. package/test/_legacy/payment-resolver/stripe/orders/refunded.json +0 -0
  85. package/test/_legacy/payment-resolver/stripe/orders/regular.json +0 -91
  86. package/test/_legacy/payment-resolver/stripe/subscriptions/active.json +0 -421
  87. package/test/_legacy/payment-resolver/stripe/subscriptions/trial-in-trial.json +0 -349
  88. package/test/_legacy/payment-resolver/stripe/subscriptions/trial-to-active-failed-authorization.json +0 -430
  89. package/test/_legacy/payment-resolver/stripe/subscriptions/trial-to-active.json +0 -319
  90. package/test/_legacy/payment-resolver/stripe/subscriptions/trial-to-cancelled.json +0 -319
  91. package/test/_legacy/payment-resolver/stripe/subscriptions/trial-to-refund.json +0 -414
  92. package/test/_legacy/payment-resolver/stripe/subscriptions/trial-to-suspended.json +0 -319
  93. package/test/_legacy/payment-resolver/stripe/subscriptions/unsure.json +0 -339
  94. package/test/_legacy/test-new +0 -1178
  95. package/test/_legacy/test.md +0 -89
  96. package/test/_legacy/usage.js +0 -175
  97. package/test/_legacy/user.js +0 -31
  98. package/test/ai/tools-live.js +0 -170
  99. package/test/boot/emulator-boots.js +0 -37
  100. package/test/content/blog-generate.js +0 -160
  101. package/test/email/campaign-send.js +0 -45
  102. package/test/email/consent-lifecycle.js +0 -257
  103. package/test/email/feedback-and-plain-send.js +0 -52
  104. package/test/email/fixtures/editorial.json +0 -30
  105. package/test/email/fixtures/field-report.json +0 -53
  106. package/test/email/marketing-lifecycle.js +0 -132
  107. package/test/email/newsletter-generate.js +0 -819
  108. package/test/email/newsletter-templates.js +0 -491
  109. package/test/email/templates.js +0 -207
  110. package/test/email/transactional-send.js +0 -34
  111. package/test/email/transactional.js +0 -560
  112. package/test/email/validation.js +0 -710
  113. package/test/events/auth-delete-race.js +0 -201
  114. package/test/events/payments/journey-payments-cancel-endpoint.js +0 -100
  115. package/test/events/payments/journey-payments-cancel.js +0 -182
  116. package/test/events/payments/journey-payments-discount.js +0 -89
  117. package/test/events/payments/journey-payments-failure.js +0 -146
  118. package/test/events/payments/journey-payments-legacy-product.js +0 -149
  119. package/test/events/payments/journey-payments-one-time-failure.js +0 -111
  120. package/test/events/payments/journey-payments-one-time.js +0 -136
  121. package/test/events/payments/journey-payments-plan-change.js +0 -144
  122. package/test/events/payments/journey-payments-refund-webhook.js +0 -180
  123. package/test/events/payments/journey-payments-suspend.js +0 -181
  124. package/test/events/payments/journey-payments-trial-cancel.js +0 -130
  125. package/test/events/payments/journey-payments-trial.js +0 -171
  126. package/test/events/payments/journey-payments-uid-resolution.js +0 -132
  127. package/test/events/payments/journey-payments-upgrade.js +0 -135
  128. package/test/fixtures/chargebee/invoice-one-time.json +0 -27
  129. package/test/fixtures/chargebee/subscription-active.json +0 -44
  130. package/test/fixtures/chargebee/subscription-cancelled.json +0 -42
  131. package/test/fixtures/chargebee/subscription-in-trial.json +0 -41
  132. package/test/fixtures/chargebee/subscription-legacy-plan.json +0 -41
  133. package/test/fixtures/chargebee/subscription-non-renewing.json +0 -41
  134. package/test/fixtures/chargebee/subscription-paused.json +0 -42
  135. package/test/fixtures/chargebee/webhook-payment-failed.json +0 -51
  136. package/test/fixtures/chargebee/webhook-subscription-created.json +0 -47
  137. package/test/fixtures/paypal/order-approved.json +0 -62
  138. package/test/fixtures/paypal/order-completed.json +0 -110
  139. package/test/fixtures/paypal/subscription-active.json +0 -76
  140. package/test/fixtures/paypal/subscription-cancelled.json +0 -50
  141. package/test/fixtures/paypal/subscription-suspended.json +0 -65
  142. package/test/fixtures/stripe/checkout-session-completed.json +0 -130
  143. package/test/fixtures/stripe/invoice-payment-failed.json +0 -148
  144. package/test/fixtures/stripe/invoice-subscription-payment-failed.json +0 -28
  145. package/test/fixtures/stripe/subscription-active.json +0 -161
  146. package/test/fixtures/stripe/subscription-canceled.json +0 -161
  147. package/test/fixtures/stripe/subscription-trialing.json +0 -161
  148. package/test/functions/admin/database-read.js +0 -134
  149. package/test/functions/admin/database-write.js +0 -159
  150. package/test/functions/admin/edit-post.js +0 -366
  151. package/test/functions/admin/firestore-query.js +0 -207
  152. package/test/functions/admin/firestore-read.js +0 -129
  153. package/test/functions/admin/firestore-write.js +0 -105
  154. package/test/functions/admin/get-stats.js +0 -115
  155. package/test/functions/admin/send-email.js +0 -119
  156. package/test/functions/admin/send-notification.js +0 -208
  157. package/test/functions/admin/write-repo-content.js +0 -223
  158. package/test/functions/general/add-marketing-contact.js +0 -335
  159. package/test/functions/general/fetch-post.js +0 -54
  160. package/test/functions/general/generate-uuid.js +0 -114
  161. package/test/functions/test/authenticate.js +0 -64
  162. package/test/functions/user/create-custom-token.js +0 -73
  163. package/test/functions/user/delete.js +0 -135
  164. package/test/functions/user/get-active-sessions.js +0 -111
  165. package/test/functions/user/get-subscription-info.js +0 -99
  166. package/test/functions/user/regenerate-api-keys.js +0 -156
  167. package/test/functions/user/resolve.js +0 -52
  168. package/test/functions/user/sign-out-all-sessions.js +0 -94
  169. package/test/functions/user/sign-up.js +0 -252
  170. package/test/functions/user/submit-feedback.js +0 -104
  171. package/test/functions/user/validate-settings.js +0 -82
  172. package/test/helpers/ai-request-payload.js +0 -300
  173. package/test/helpers/ai-test-provider.js +0 -202
  174. package/test/helpers/ai-tools-format.js +0 -383
  175. package/test/helpers/content/blog-auto-publisher.js +0 -484
  176. package/test/helpers/content/feed-parser.js +0 -528
  177. package/test/helpers/content/ghostii-blocks.js +0 -134
  178. package/test/helpers/content/ghostii-feed-integration.js +0 -404
  179. package/test/helpers/content/ghostii-write-article.js +0 -243
  180. package/test/helpers/environment.js +0 -230
  181. package/test/helpers/infer-contact.js +0 -113
  182. package/test/helpers/merge-line-files.js +0 -271
  183. package/test/helpers/payment/chargebee/parse-webhook.js +0 -413
  184. package/test/helpers/payment/chargebee/to-unified-one-time.js +0 -147
  185. package/test/helpers/payment/chargebee/to-unified-subscription.js +0 -648
  186. package/test/helpers/payment/paypal/parse-webhook.js +0 -539
  187. package/test/helpers/payment/paypal/to-unified-one-time.js +0 -382
  188. package/test/helpers/payment/paypal/to-unified-subscription.js +0 -820
  189. package/test/helpers/payment/stripe/parse-webhook.js +0 -447
  190. package/test/helpers/payment/stripe/to-unified-one-time.js +0 -306
  191. package/test/helpers/payment/stripe/to-unified-subscription.js +0 -708
  192. package/test/helpers/sanitize.js +0 -222
  193. package/test/helpers/slugify.js +0 -394
  194. package/test/helpers/storage.js +0 -194
  195. package/test/helpers/user.js +0 -755
  196. package/test/helpers/webhook-forward.js +0 -418
  197. package/test/mcp/discovery.js +0 -53
  198. package/test/mcp/oauth.js +0 -161
  199. package/test/mcp/protocol.js +0 -268
  200. package/test/mcp/roles.js +0 -188
  201. package/test/mcp/utils.js +0 -245
  202. package/test/routes/admin/create-post.js +0 -364
  203. package/test/routes/admin/database.js +0 -131
  204. package/test/routes/admin/deduplicate-image-alts.js +0 -190
  205. package/test/routes/admin/email.js +0 -114
  206. package/test/routes/admin/firestore-query.js +0 -204
  207. package/test/routes/admin/firestore.js +0 -127
  208. package/test/routes/admin/infer-contact.js +0 -218
  209. package/test/routes/admin/notification.js +0 -198
  210. package/test/routes/admin/post-resize-image.js +0 -184
  211. package/test/routes/admin/post.js +0 -368
  212. package/test/routes/admin/repo-content.js +0 -223
  213. package/test/routes/admin/stats.js +0 -112
  214. package/test/routes/content/post.js +0 -54
  215. package/test/routes/general/uuid.js +0 -115
  216. package/test/routes/marketing/campaign.js +0 -125
  217. package/test/routes/marketing/contact.js +0 -370
  218. package/test/routes/marketing/email-preferences.js +0 -292
  219. package/test/routes/marketing/push-send.js +0 -32
  220. package/test/routes/marketing/webhook-forward.js +0 -61
  221. package/test/routes/marketing/webhook.js +0 -639
  222. package/test/routes/payments/cancel.js +0 -163
  223. package/test/routes/payments/discount.js +0 -80
  224. package/test/routes/payments/dispute-alert.js +0 -320
  225. package/test/routes/payments/intent.js +0 -336
  226. package/test/routes/payments/portal.js +0 -92
  227. package/test/routes/payments/refund.js +0 -179
  228. package/test/routes/payments/trial-eligibility.js +0 -71
  229. package/test/routes/payments/webhook.js +0 -107
  230. package/test/routes/test/authenticate.js +0 -59
  231. package/test/routes/test/schema.js +0 -554
  232. package/test/routes/test/usage.js +0 -342
  233. package/test/routes/user/api-keys.js +0 -156
  234. package/test/routes/user/delete.js +0 -136
  235. package/test/routes/user/feedback.js +0 -104
  236. package/test/routes/user/sessions.js +0 -199
  237. package/test/routes/user/settings-validate.js +0 -82
  238. package/test/routes/user/signup.js +0 -542
  239. package/test/routes/user/subscription.js +0 -99
  240. package/test/routes/user/token.js +0 -73
  241. package/test/routes/user/user.js +0 -157
  242. package/test/rules/notifications.js +0 -410
  243. package/test/rules/payments-carts.js +0 -371
  244. package/test/rules/user.js +0 -396
@@ -1,1558 +0,0 @@
1
- const package = require('../package.json');
2
- const assert = require('assert');
3
-
4
- beforeEach(() => {
5
- });
6
-
7
- before(() => {
8
- });
9
-
10
- after(() => {
11
- });
12
-
13
- /*
14
- * ============
15
- * Test Cases
16
- * ============
17
- */
18
- describe(`${package.name}`, () => {
19
- const Manager = (new (require('../src/manager/index.js')));
20
-
21
- const options = {
22
- resolveProcessor: true,
23
- resolveType: true,
24
-
25
- today: '2023-04-28T00:00:00.000Z',
26
- // today: '2023-08-28T00:00:00.000Z',
27
-
28
- // log: true,
29
-
30
- message: false,
31
- }
32
-
33
- const defaultProfileOrder = {
34
- type: 'order',
35
- details: {
36
- }
37
- }
38
-
39
- const profileSubscriptionDefault = {
40
- type: 'subscription',
41
- details: {
42
- planFrequency: 'monthly',
43
- }
44
- }
45
-
46
- const profileSubscriptionFailedAuthorization = {
47
- type: 'subscription',
48
- details: {
49
- planFrequency: 'monthly',
50
- },
51
- authorization: {
52
- status: 'failed',
53
- }
54
- }
55
-
56
- function log() {
57
- // console.log(...arguments);
58
- }
59
-
60
- describe('.subscriptionResolver()', () => {
61
-
62
- /*
63
- GENERIC
64
- */
65
- // describe('error test', () => {
66
- // const result = Manager.SubscriptionResolver({}, new Error('Test')).resolve(options);
67
-
68
- // console.log('result', result);
69
-
70
- // it('should resolve correctly', () => {
71
- // return assert.deepStrictEqual(result, expected);
72
- // });
73
- // });
74
-
75
- /*
76
- * PAYPAL
77
- */
78
- describe('paypal', () => {
79
- // Orders
80
- describe('orders', () => {
81
- describe('regular', () => {
82
- const item = require('./payment-resolver/paypal/orders/regular.json');
83
- const result = Manager.SubscriptionResolver({}, item).resolve(options);
84
- const expected = {
85
- processor: 'paypal',
86
- type: 'order',
87
- status: 'cancelled',
88
- frequency: 'single',
89
- resource: { id: '5CA68427PY850452F' },
90
- payment: {
91
- completed: true,
92
- refunded: false,
93
- },
94
- start: { timestamp: '2023-04-27T03:39:50.000Z', timestampUNIX: 1682566790 },
95
- expires: { timestamp: '2023-04-27T03:39:50.000Z', timestampUNIX: 1682566790 },
96
- cancelled: { timestamp: '2023-04-27T03:39:50.000Z', timestampUNIX: 1682566790 },
97
- lastPayment: {
98
- amount: 1,
99
- date: { timestamp: '2023-04-27T03:40:38.000Z', timestampUNIX: 1682566838 }
100
- },
101
- trial: {
102
- active: false,
103
- claimed: false,
104
- daysLeft: 0,
105
- expires: {
106
- timestamp: '1970-01-01T00:00:00.000Z',
107
- timestampUNIX: 0,
108
- },
109
- },
110
- details: {
111
- message: '[REDACTED]',
112
- },
113
- }
114
-
115
- log('result', result);
116
-
117
- it('should resolve correctly', () => {
118
- return assert.deepStrictEqual(result, expected);
119
- });
120
- });
121
- });
122
-
123
- // Subscriptions
124
- describe('subscriptions', () => {
125
- describe('active', () => {
126
- const item = require('./payment-resolver/paypal/subscriptions/active.json');
127
- const result = Manager.SubscriptionResolver({}, item).resolve(options);
128
- const expected = {
129
- processor: 'paypal',
130
- type: 'subscription',
131
- status: 'active',
132
- frequency: 'monthly',
133
- resource: { id: 'I-GLYNACJCERDD' },
134
- payment: {
135
- completed: true,
136
- refunded: false,
137
- },
138
- start: { timestamp: '2023-03-22T22:38:03.000Z', timestampUNIX: 1679524683 },
139
- expires: { timestamp: '2024-09-21T11:03:15.000Z', timestampUNIX: 1726916595 },
140
- cancelled: { timestamp: '1970-01-01T00:00:00.000Z', timestampUNIX: 0 },
141
- lastPayment: {
142
- amount: 59.85,
143
- date: { timestamp: '2023-08-22T11:03:15.000Z', timestampUNIX: 1692702195 }
144
- },
145
- trial: {
146
- active: false,
147
- claimed: false,
148
- daysLeft: 0,
149
- expires: {
150
- timestamp: '1970-01-01T00:00:00.000Z',
151
- timestampUNIX: 0,
152
- },
153
- },
154
- details: {
155
- message: '[REDACTED]',
156
- },
157
- }
158
-
159
- log('result', result);
160
-
161
- it('should resolve correctly', () => {
162
- return assert.deepStrictEqual(result, expected);
163
- });
164
- });
165
-
166
- describe('active => refund previous stmnt', () => {
167
- const item = require('./payment-resolver/paypal/subscriptions/active-refund-previous-stmnt.json');
168
- const result = Manager.SubscriptionResolver({}, item).resolve(options);
169
- const expected = {
170
- processor: 'paypal',
171
- type: 'subscription',
172
- status: 'active',
173
- frequency: 'monthly',
174
- resource: { id: 'I-PXC8BVN91X5W' },
175
- payment: {
176
- completed: true,
177
- refunded: true,
178
- },
179
- start: { timestamp: '2023-02-12T13:34:46.000Z', timestampUNIX: 1676208886 },
180
- expires: { timestamp: '2025-02-11T10:29:45.000Z', timestampUNIX: 1739269785 },
181
- cancelled: { timestamp: '1970-01-01T00:00:00.000Z', timestampUNIX: 0 },
182
- lastPayment: {
183
- amount: 19.95,
184
- date: { timestamp: '2024-01-12T10:29:45.000Z', timestampUNIX: 1705055385 }
185
- },
186
- trial: {
187
- active: false,
188
- claimed: false,
189
- daysLeft: 0,
190
- expires: {
191
- timestamp: '1970-01-01T00:00:00.000Z',
192
- timestampUNIX: 0,
193
- },
194
- },
195
- details: {
196
- message: '[REDACTED]',
197
- },
198
- }
199
-
200
- log('result', result);
201
-
202
- it('should resolve correctly', () => {
203
- return assert.deepStrictEqual(result, expected);
204
- });
205
- });
206
-
207
- describe('trial => in-trial', () => {
208
- const item = require('./payment-resolver/paypal/subscriptions/trial-in-trial.json');
209
- const result = Manager.SubscriptionResolver({}, item).resolve(options);
210
- const expected = {
211
- processor: 'paypal',
212
- type: 'subscription',
213
- status: 'active',
214
- frequency: 'annually',
215
- resource: { id: 'I-HG5K7XD0BVPJ' },
216
- payment: {
217
- completed: true,
218
- refunded: false,
219
- },
220
- start: { timestamp: '2023-04-28T02:16:58.000Z', timestampUNIX: 1682648218 },
221
- expires: { timestamp: '2024-06-10T10:00:00.000Z', timestampUNIX: 1718013600 },
222
- cancelled: { timestamp: '1970-01-01T00:00:00.000Z', timestampUNIX: 0 },
223
- lastPayment: {
224
- amount: 0,
225
- date: { timestamp: '1970-01-01T00:00:00.000Z', timestampUNIX: 0 }
226
- },
227
- trial: {
228
- active: true,
229
- claimed: true,
230
- daysLeft: 13,
231
- expires: {
232
- timestamp: '2023-05-12T02:16:58.000Z',
233
- timestampUNIX: 1683857818,
234
- },
235
- },
236
- details: {
237
- message: '[REDACTED]',
238
- },
239
- }
240
-
241
- log('result', result);
242
-
243
- it('should resolve correctly', () => {
244
- return assert.deepStrictEqual(result, expected);
245
- });
246
- });
247
-
248
- describe('trial => payment not completed', () => {
249
- const item = require('./payment-resolver/paypal/subscriptions/trial-payment-not-complete.json');
250
- const result = Manager.SubscriptionResolver({}, item).resolve(options);
251
- const expected = {
252
- processor: 'paypal',
253
- type: 'subscription',
254
- status: 'cancelled',
255
- frequency: 'monthly',
256
- resource: { id: 'I-6YN0VNT6KM4W' },
257
- payment: {
258
- completed: false,
259
- refunded: false,
260
- },
261
- start: { timestamp: '2023-05-11T10:52:00.000Z', timestampUNIX: 1683802320 },
262
- expires: { timestamp: '1970-01-01T00:00:00.000Z', timestampUNIX: 0 },
263
- cancelled: { timestamp: '1970-01-01T00:00:00.000Z', timestampUNIX: 0 },
264
- lastPayment: {
265
- amount: 0,
266
- date: { timestamp: '1970-01-01T00:00:00.000Z', timestampUNIX: 0 }
267
- },
268
- trial: {
269
- active: false,
270
- claimed: true,
271
- daysLeft: 0,
272
- expires: {
273
- timestamp: '1970-01-01T00:00:00.000Z',
274
- timestampUNIX: 0,
275
- },
276
- },
277
- details: {
278
- message: '[REDACTED]',
279
- },
280
- }
281
-
282
- log('result', result);
283
-
284
- it('should resolve correctly', () => {
285
- return assert.deepStrictEqual(result, expected);
286
- });
287
- });
288
-
289
- describe('trial => payment overdue', () => {
290
- const item = require('./payment-resolver/paypal/subscriptions/trial-payment-overdue.json');
291
- const result = Manager.SubscriptionResolver({}, item).resolve(options);
292
- const expected = {
293
- processor: 'paypal',
294
- type: 'subscription',
295
- status: 'suspended',
296
- frequency: 'annually',
297
- resource: { id: 'I-PFLFF5TTAN4S' },
298
- payment: {
299
- completed: true,
300
- refunded: false,
301
- },
302
- start: { timestamp: '2023-09-09T05:58:41.000Z', timestampUNIX: 1694239121 },
303
- expires: { timestamp: '1970-01-01T00:00:00.000Z', timestampUNIX: 0 },
304
- cancelled: { timestamp: '1970-01-01T00:00:00.000Z', timestampUNIX: 0 },
305
- lastPayment: {
306
- amount: 0,
307
- date: { timestamp: '1970-01-01T00:00:00.000Z', timestampUNIX: 0 }
308
- },
309
- trial: {
310
- active: false,
311
- claimed: true,
312
- daysLeft: 0,
313
- expires: {
314
- timestamp: '1970-01-01T00:00:00.000Z',
315
- timestampUNIX: 0,
316
- },
317
- },
318
- details: {
319
- message: '[REDACTED]',
320
- },
321
- }
322
-
323
- log('result', result);
324
-
325
- it('should resolve correctly', () => {
326
- return assert.deepStrictEqual(result, expected);
327
- });
328
- });
329
-
330
- describe('trial => payment overdue (2)', () => {
331
- const item = require('./payment-resolver/paypal/subscriptions/trial-payment-overdue-2.json');
332
- const result = Manager.SubscriptionResolver({}, item).resolve(options);
333
- const expected = {
334
- processor: 'paypal',
335
- type: 'subscription',
336
- status: 'suspended',
337
- frequency: 'annually',
338
- resource: { id: 'I-JU1H0XF32WU5' },
339
- payment: {
340
- completed: true,
341
- refunded: false,
342
- },
343
- start: { timestamp: '2023-09-08T07:15:10.000Z', timestampUNIX: 1694157310 },
344
- expires: { timestamp: '1970-01-01T00:00:00.000Z', timestampUNIX: 0 },
345
- cancelled: { timestamp: '1970-01-01T00:00:00.000Z', timestampUNIX: 0 },
346
- lastPayment: {
347
- amount: 0,
348
- date: { timestamp: '1970-01-01T00:00:00.000Z', timestampUNIX: 0 }
349
- },
350
- trial: {
351
- active: false,
352
- claimed: true,
353
- daysLeft: 0,
354
- expires: {
355
- timestamp: '1970-01-01T00:00:00.000Z',
356
- timestampUNIX: 0,
357
- },
358
- },
359
- details: {
360
- message: '[REDACTED]',
361
- },
362
- }
363
-
364
- log('result', result);
365
-
366
- it('should resolve correctly', () => {
367
- return assert.deepStrictEqual(result, expected);
368
- });
369
- });
370
-
371
- describe('trial => active => cancelled', () => {
372
- const item = require('./payment-resolver/paypal/subscriptions/trial-to-active-to-cancelled.json');
373
- const result = Manager.SubscriptionResolver({}, item).resolve(options);
374
- const expected = {
375
- processor: 'paypal',
376
- type: 'subscription',
377
- status: 'cancelled',
378
- frequency: 'monthly',
379
- resource: { id: 'I-MH92AV4A3EA6' },
380
- payment: {
381
- completed: true,
382
- refunded: false,
383
- },
384
- start: { timestamp: '2023-03-31T14:48:51.000Z', timestampUNIX: 1680274131 },
385
- expires: { timestamp: '2023-05-14T10:56:15.000Z', timestampUNIX: 1684061775 },
386
- cancelled: { timestamp: '2023-04-18T10:14:56.000Z', timestampUNIX: 1681812896 },
387
- lastPayment: {
388
- amount: 19.95,
389
- date: { timestamp: '2023-04-14T10:56:15.000Z', timestampUNIX: 1681469775 }
390
- },
391
- trial: {
392
- active: false,
393
- claimed: true,
394
- daysLeft: 0,
395
- expires: {
396
- timestamp: '1970-01-01T00:00:00.000Z',
397
- timestampUNIX: 0,
398
- },
399
- },
400
- details: {
401
- message: '[REDACTED]',
402
- },
403
- }
404
-
405
- log('result', result);
406
-
407
- it('should resolve correctly', () => {
408
- return assert.deepStrictEqual(result, expected);
409
- });
410
- });
411
-
412
- describe('trial => active', () => {
413
- const item = require('./payment-resolver/paypal/subscriptions/trial-to-active.json');
414
- const result = Manager.SubscriptionResolver({}, item).resolve(options);
415
- const expected = {
416
- processor: 'paypal',
417
- type: 'subscription',
418
- status: 'active',
419
- frequency: 'monthly',
420
- resource: { id: 'I-VTXGPKDTMMK2' },
421
- payment: {
422
- completed: true,
423
- refunded: false,
424
- },
425
- start: { timestamp: '2023-04-11T17:37:58.000Z', timestampUNIX: 1681234678 },
426
- expires: { timestamp: '2024-05-25T10:28:22.000Z', timestampUNIX: 1716632902 },
427
- cancelled: { timestamp: '1970-01-01T00:00:00.000Z', timestampUNIX: 0 },
428
- lastPayment: {
429
- amount: 19.95,
430
- date: { timestamp: '2023-04-25T10:28:22.000Z', timestampUNIX: 1682418502 }
431
- },
432
- trial: {
433
- active: false,
434
- claimed: false,
435
- daysLeft: 0,
436
- expires: {
437
- timestamp: '1970-01-01T00:00:00.000Z',
438
- timestampUNIX: 0,
439
- },
440
- },
441
- details: {
442
- message: '[REDACTED]',
443
- },
444
- }
445
-
446
- log('result', result);
447
-
448
- it('should resolve correctly', () => {
449
- return assert.deepStrictEqual(result, expected);
450
- });
451
- });
452
-
453
- describe('trial => cancelled', () => {
454
- const item = require('./payment-resolver/paypal/subscriptions/trial-to-cancelled.json');
455
- const result = Manager.SubscriptionResolver({}, item).resolve(options);
456
- const expected = {
457
- processor: 'paypal',
458
- type: 'subscription',
459
- status: 'cancelled',
460
- frequency: 'monthly',
461
- resource: { id: 'I-79C4RSSVKN95' },
462
- payment: {
463
- completed: true,
464
- refunded: false,
465
- },
466
- start: { timestamp: '2023-03-31T08:41:35.000Z', timestampUNIX: 1680252095 },
467
- expires: { timestamp: '1970-01-01T00:00:00.000Z', timestampUNIX: 0 },
468
- cancelled: { timestamp: '2023-04-02T23:38:44.000Z', timestampUNIX: 1680478724 },
469
- lastPayment: {
470
- amount: 0,
471
- date: { timestamp: '1970-01-01T00:00:00.000Z', timestampUNIX: 0 }
472
- },
473
- trial: {
474
- active: false,
475
- claimed: true,
476
- daysLeft: 0,
477
- expires: {
478
- timestamp: '1970-01-01T00:00:00.000Z',
479
- timestampUNIX: 0,
480
- },
481
- },
482
- details: {
483
- message: '[REDACTED]',
484
- },
485
- }
486
-
487
- log('result', result);
488
-
489
- it('should resolve correctly', () => {
490
- return assert.deepStrictEqual(result, expected);
491
- });
492
- });
493
-
494
- describe('trial => expired', () => {
495
- const item = require('./payment-resolver/paypal/subscriptions/trial-to-expired.json');
496
- const result = Manager.SubscriptionResolver({}, item).resolve(options);
497
- const expected = {
498
- processor: 'paypal',
499
- type: 'subscription',
500
- status: 'cancelled',
501
- frequency: 'monthly',
502
- resource: { id: 'I-BC83SG8TF205' },
503
- payment: {
504
- completed: true,
505
- refunded: false,
506
- },
507
- start: { timestamp: '2023-06-05T15:16:16.000Z', timestampUNIX: 1685978176 },
508
- expires: { timestamp: '2023-07-05T15:16:31.000Z', timestampUNIX: 1688570191 },
509
- cancelled: { timestamp: '2023-06-05T15:16:33.000Z', timestampUNIX: 1685978193 },
510
- lastPayment: {
511
- amount: 3,
512
- date: { timestamp: '2023-06-05T15:16:31.000Z', timestampUNIX: 1685978191 }
513
- },
514
- trial: {
515
- active: false,
516
- claimed: false,
517
- daysLeft: 0,
518
- expires: {
519
- timestamp: '1970-01-01T00:00:00.000Z',
520
- timestampUNIX: 0,
521
- },
522
- },
523
- details: {
524
- message: '[REDACTED]',
525
- },
526
- }
527
-
528
- log('result', result);
529
-
530
- it('should resolve correctly', () => {
531
- return assert.deepStrictEqual(result, expected);
532
- });
533
- });
534
-
535
- describe('trial => refund', () => {
536
- const item = require('./payment-resolver/paypal/subscriptions/trial-to-refund.json');
537
- const result = Manager.SubscriptionResolver({}, item).resolve(options);
538
- const expected = {
539
- processor: 'paypal',
540
- type: 'subscription',
541
- status: 'cancelled',
542
- frequency: 'annually',
543
- resource: { id: 'I-JW7F1RK5KN8W' },
544
- payment: {
545
- completed: true,
546
- refunded: true,
547
- },
548
- start: { timestamp: '2023-07-17T14:31:50.000Z', timestampUNIX: 1689604310 },
549
- expires: { timestamp: '1970-01-01T00:00:00.000Z', timestampUNIX: 0 },
550
- cancelled: { timestamp: '2023-07-31T11:33:32.000Z', timestampUNIX: 1690803212 },
551
- lastPayment: {
552
- amount: 191.4,
553
- date: { timestamp: '2023-07-31T11:13:59.000Z', timestampUNIX: 1690802039 }
554
- },
555
- trial: {
556
- active: false,
557
- claimed: false,
558
- daysLeft: 0,
559
- expires: {
560
- timestamp: '1970-01-01T00:00:00.000Z',
561
- timestampUNIX: 0,
562
- },
563
- },
564
- details: {
565
- message: '[REDACTED]',
566
- },
567
- }
568
-
569
- log('result', result);
570
-
571
- it('should resolve correctly', () => {
572
- return assert.deepStrictEqual(result, expected);
573
- });
574
- });
575
-
576
- describe('trial => suspended', () => {
577
- const item = require('./payment-resolver/paypal/subscriptions/trial-to-suspended.json');
578
- const result = Manager.SubscriptionResolver({}, item).resolve(options);
579
- const expected = {
580
- processor: 'paypal',
581
- type: 'subscription',
582
- status: 'suspended',
583
- frequency: 'monthly',
584
- resource: { id: 'I-A3AS9XBE0JEG' },
585
- payment: {
586
- completed: true,
587
- refunded: false,
588
- },
589
- start: { timestamp: '2023-07-11T16:52:11.000Z', timestampUNIX: 1689094331 },
590
- expires: { timestamp: '1970-01-01T00:00:00.000Z', timestampUNIX: 0 },
591
- cancelled: { timestamp: '1970-01-01T00:00:00.000Z', timestampUNIX: 0 },
592
- lastPayment: {
593
- amount: 9.97,
594
- date: { timestamp: '2023-07-11T16:53:50.000Z', timestampUNIX: 1689094430 }
595
- },
596
- trial: {
597
- active: false,
598
- claimed: false,
599
- daysLeft: 0,
600
- expires: {
601
- timestamp: '1970-01-01T00:00:00.000Z',
602
- timestampUNIX: 0,
603
- },
604
- },
605
- details: {
606
- message: '[REDACTED]',
607
- },
608
- }
609
-
610
- log('result', result);
611
-
612
- it('should resolve correctly', () => {
613
- return assert.deepStrictEqual(result, expected);
614
- });
615
- });
616
- });
617
- });
618
-
619
- /*
620
- * CHARGEBEE
621
- */
622
- describe('chargebee', () => {
623
- // Orders
624
- describe('orders', () => {
625
- // describe('regular', () => {
626
- // const item = require('./payment-resolver/chargebee/orders/regular.json');
627
- // const result = Manager.SubscriptionResolver({}, item).resolve(options);
628
- // const expected = {
629
- // processor: 'chargebee',
630
- // type: 'order',
631
- // status: 'cancelled',
632
- // frequency: 'single',
633
- // resource: { id: '3065' },
634
- // payment: {
635
- // completed: false,
636
- // refunded: false,
637
- // },
638
- // start: { timestamp: '2023-04-27T09:34:43.000Z', timestampUNIX: 1682588083 },
639
- // expires: { timestamp: '1970-01-01T00:00:00.000Z', timestampUNIX: 0 },
640
- // cancelled: { timestamp: '2023-04-27T09:34:43.000Z', timestampUNIX: 1682588083 },
641
- // lastPayment: {
642
- // amount: 0,
643
- // date: { timestamp: '2023-04-27T09:34:43.000Z', timestampUNIX: 1682588083 }
644
- // },
645
- // trial: {
646
- // active: false,
647
- // claimed: false,
648
- // daysLeft: 0,
649
- // expires: {
650
- // timestamp: '1970-01-01T00:00:00.000Z',
651
- // timestampUNIX: 0,
652
- // },
653
- // },
654
- // details: {
655
- // message: '[REDACTED]',
656
- // },
657
- // }
658
-
659
- // log('result', result);
660
-
661
- // it('should resolve correctly', () => {
662
- // return assert.deepStrictEqual(result, expected);
663
- // });
664
- // });
665
-
666
- describe('unpaid', () => {
667
- const item = require('./payment-resolver/chargebee/orders/unpaid.json');
668
- const result = Manager.SubscriptionResolver({}, item).resolve(options);
669
- const expected = {
670
- processor: 'chargebee',
671
- type: 'order',
672
- status: 'cancelled',
673
- frequency: 'single',
674
- resource: { id: '3065' },
675
- payment: {
676
- completed: false,
677
- refunded: false,
678
- },
679
- start: { timestamp: '2023-04-27T09:34:43.000Z', timestampUNIX: 1682588083 },
680
- expires: { timestamp: '1970-01-01T00:00:00.000Z', timestampUNIX: 0 },
681
- cancelled: { timestamp: '2023-04-27T09:34:43.000Z', timestampUNIX: 1682588083 },
682
- lastPayment: {
683
- amount: 0,
684
- date: { timestamp: '2023-04-27T09:34:43.000Z', timestampUNIX: 1682588083 }
685
- },
686
- trial: {
687
- active: false,
688
- claimed: false,
689
- daysLeft: 0,
690
- expires: {
691
- timestamp: '1970-01-01T00:00:00.000Z',
692
- timestampUNIX: 0,
693
- },
694
- },
695
- details: {
696
- message: '[REDACTED]',
697
- },
698
- }
699
-
700
- log('result', result);
701
-
702
- it('should resolve correctly', () => {
703
- return assert.deepStrictEqual(result, expected);
704
- });
705
- });
706
- });
707
-
708
- // Subscriptions
709
- describe('subscriptions', () => {
710
- describe('active', () => {
711
- const item = require('./payment-resolver/chargebee/subscriptions/active.json');
712
- const result = Manager.SubscriptionResolver({}, item).resolve(options);
713
- const expected = {
714
- processor: 'chargebee',
715
- type: 'subscription',
716
- status: 'active',
717
- frequency: 'monthly',
718
- resource: { id: 'AzZMxvTYTQUmw1Iw7' },
719
- payment: {
720
- completed: true,
721
- refunded: false,
722
- },
723
- start: { timestamp: '2023-03-14T10:37:33.000Z', timestampUNIX: 1678790253 },
724
- expires: { timestamp: '2024-09-13T10:37:33.000Z', timestampUNIX: 1726223853 },
725
- cancelled: { timestamp: '1970-01-01T00:00:00.000Z', timestampUNIX: 0 },
726
- lastPayment: {
727
- amount: 19.95,
728
- date: { timestamp: '2023-08-14T10:37:33.000Z', timestampUNIX: 1692009453 }
729
- },
730
- trial: {
731
- active: false,
732
- claimed: false,
733
- daysLeft: 0,
734
- expires: {
735
- timestamp: '1970-01-01T00:00:00.000Z',
736
- timestampUNIX: 0,
737
- },
738
- },
739
- details: {
740
- message: '[REDACTED]',
741
- },
742
- }
743
-
744
- log('result', result);
745
-
746
- it('should resolve correctly', () => {
747
- return assert.deepStrictEqual(result, expected);
748
- });
749
- });
750
-
751
- describe('trial => skipped-to-active', () => {
752
- const item = require('./payment-resolver/chargebee/subscriptions/trial-skipped-to-active.json');
753
- const result = Manager.SubscriptionResolver({}, item).resolve(options);
754
- const expected = {
755
- processor: 'chargebee',
756
- type: 'subscription',
757
- status: 'active',
758
- frequency: 'monthly',
759
- resource: { id: '6oqX0TnhKo5R513B' },
760
- payment: {
761
- completed: true,
762
- refunded: false,
763
- },
764
- start: { timestamp: '2023-08-22T20:55:52.000Z', timestampUNIX: 1692737752 },
765
- expires: { timestamp: '2024-09-21T20:55:57.000Z', timestampUNIX: 1726952157 },
766
- cancelled: { timestamp: '1970-01-01T00:00:00.000Z', timestampUNIX: 0 },
767
- lastPayment: {
768
- amount: 19.95,
769
- date: { timestamp: '2023-08-22T20:55:57.000Z', timestampUNIX: 1692737757 }
770
- },
771
- trial: {
772
- active: false,
773
- claimed: false,
774
- daysLeft: 0,
775
- expires: {
776
- timestamp: '1970-01-01T00:00:00.000Z',
777
- timestampUNIX: 0,
778
- },
779
- },
780
- details: {
781
- message: '[REDACTED]',
782
- },
783
- }
784
-
785
- log('result', result);
786
-
787
- it('should resolve correctly', () => {
788
- return assert.deepStrictEqual(result, expected);
789
- });
790
- });
791
-
792
- describe('trial => in-trial', () => {
793
- const item = require('./payment-resolver/chargebee/subscriptions/trial-in-trial.json');
794
- const result = Manager.SubscriptionResolver({}, item).resolve(options);
795
- const expected = {
796
- processor: 'chargebee',
797
- type: 'subscription',
798
- status: 'active',
799
- frequency: 'monthly',
800
- resource: { id: '16CRCcTcWmQYKyT5' },
801
- payment: {
802
- completed: true,
803
- refunded: false,
804
- },
805
- start: { timestamp: '2023-04-26T10:19:48.000Z', timestampUNIX: 1682504388 },
806
- expires: { timestamp: '2024-06-09T10:19:48.000Z', timestampUNIX: 1717928388 },
807
- cancelled: { timestamp: '1970-01-01T00:00:00.000Z', timestampUNIX: 0 },
808
- lastPayment: {
809
- amount: 0,
810
- date: { timestamp: '1970-01-01T00:00:00.000Z', timestampUNIX: 0 }
811
- },
812
- trial: {
813
- active: true,
814
- claimed: true,
815
- daysLeft: 12,
816
- expires: {
817
- timestamp: '2023-05-10T10:19:48.000Z',
818
- timestampUNIX: 1683713988,
819
- },
820
- },
821
- details: {
822
- message: '[REDACTED]',
823
- },
824
- }
825
-
826
- log('result', result);
827
-
828
- it('should resolve correctly', () => {
829
- return assert.deepStrictEqual(result, expected);
830
- });
831
- });
832
-
833
- describe('trial => active => cancelled', () => {
834
- const item = require('./payment-resolver/chargebee/subscriptions/trial-to-active-to-cancelled.json');
835
- const result = Manager.SubscriptionResolver({}, item).resolve(options);
836
- const expected = {
837
- processor: 'chargebee',
838
- type: 'subscription',
839
- status: 'cancelled',
840
- frequency: 'monthly',
841
- resource: { id: 'AzqJXiTaQKh4m5Ta7' },
842
- payment: {
843
- completed: true,
844
- refunded: false,
845
- },
846
- start: { timestamp: '2023-04-04T02:53:37.000Z', timestampUNIX: 1680576817 },
847
- expires: { timestamp: '2023-05-18T02:53:37.000Z', timestampUNIX: 1684378417 },
848
- cancelled: { timestamp: '2023-04-19T03:42:24.000Z', timestampUNIX: 1681875744 },
849
- lastPayment: {
850
- amount: 19.95,
851
- date: { timestamp: '2023-04-18T02:53:37.000Z', timestampUNIX: 1681786417 }
852
- },
853
- trial: {
854
- active: false,
855
- claimed: true,
856
- daysLeft: 0,
857
- expires: {
858
- timestamp: '1970-01-01T00:00:00.000Z',
859
- timestampUNIX: 0,
860
- },
861
- },
862
- details: {
863
- message: '[REDACTED]',
864
- },
865
- }
866
-
867
- log('result', result);
868
-
869
- it('should resolve correctly', () => {
870
- return assert.deepStrictEqual(result, expected);
871
- });
872
- });
873
-
874
- describe('trial => active', () => {
875
- const item = require('./payment-resolver/chargebee/subscriptions/trial-to-active.json');
876
- const result = Manager.SubscriptionResolver({}, item).resolve(options);
877
- const expected = {
878
- processor: 'chargebee',
879
- type: 'subscription',
880
- status: 'active',
881
- frequency: 'monthly',
882
- resource: { id: 'AzyfbtTbMhiFM51DW' },
883
- payment: {
884
- completed: true,
885
- refunded: false,
886
- },
887
- start: { timestamp: '2023-04-14T02:29:56.000Z', timestampUNIX: 1681439396 },
888
- expires: { timestamp: '2024-05-28T02:29:56.000Z', timestampUNIX: 1716863396 },
889
- cancelled: { timestamp: '1970-01-01T00:00:00.000Z', timestampUNIX: 0 },
890
- lastPayment: {
891
- amount: 19.95,
892
- date: { timestamp: '2023-04-28T02:29:56.000Z', timestampUNIX: 1682648996 }
893
- },
894
- trial: {
895
- active: false,
896
- claimed: true,
897
- daysLeft: 0,
898
- expires: {
899
- timestamp: '1970-01-01T00:00:00.000Z',
900
- timestampUNIX: 0,
901
- },
902
- },
903
- details: {
904
- message: '[REDACTED]',
905
- },
906
- }
907
-
908
- log('result', result);
909
-
910
- it('should resolve correctly', () => {
911
- return assert.deepStrictEqual(result, expected);
912
- });
913
- });
914
-
915
- describe('trial => cancelled', () => {
916
- const item = require('./payment-resolver/chargebee/subscriptions/trial-to-cancelled.json');
917
- const result = Manager.SubscriptionResolver({}, item).resolve(options);
918
- const expected = {
919
- processor: 'chargebee',
920
- type: 'subscription',
921
- status: 'cancelled',
922
- frequency: 'monthly',
923
- resource: { id: 'AzZMshTbnEv7r1Eck' },
924
- payment: {
925
- completed: true,
926
- refunded: false,
927
- },
928
- start: { timestamp: '2023-04-18T15:24:28.000Z', timestampUNIX: 1681831468 },
929
- expires: { timestamp: '1970-01-01T00:00:00.000Z', timestampUNIX: 0 },
930
- cancelled: { timestamp: '2023-04-25T10:41:02.000Z', timestampUNIX: 1682419262 },
931
- lastPayment: {
932
- amount: 0,
933
- date: { timestamp: '1970-01-01T00:00:00.000Z', timestampUNIX: 0 }
934
- },
935
- trial: {
936
- active: false,
937
- claimed: true,
938
- daysLeft: 0,
939
- expires: {
940
- timestamp: '1970-01-01T00:00:00.000Z',
941
- timestampUNIX: 0,
942
- },
943
- },
944
- details: {
945
- message: '[REDACTED]',
946
- },
947
- }
948
-
949
- log('result', result);
950
-
951
- it('should resolve correctly', () => {
952
- return assert.deepStrictEqual(result, expected);
953
- });
954
- });
955
-
956
- describe('trial => refund', () => {
957
- const item = require('./payment-resolver/chargebee/subscriptions/trial-to-refund.json');
958
- const result = Manager.SubscriptionResolver({}, item).resolve(options);
959
- const expected = {
960
- processor: 'chargebee',
961
- type: 'subscription',
962
- status: 'cancelled',
963
- frequency: 'monthly',
964
- resource: { id: 'AzymDoTjgzDShlvd' },
965
- payment: {
966
- completed: true,
967
- refunded: true,
968
- },
969
- start: { timestamp: '2023-07-11T09:37:47.000Z', timestampUNIX: 1689068267 },
970
- expires: { timestamp: '1970-01-01T00:00:00.000Z', timestampUNIX: 0 },
971
- cancelled: { timestamp: '2023-07-15T13:23:15.000Z', timestampUNIX: 1689427395 },
972
- lastPayment: {
973
- amount: 19.95,
974
- date: { timestamp: '2023-07-11T09:37:54.000Z', timestampUNIX: 1689068274 }
975
- },
976
- trial: {
977
- active: false,
978
- claimed: false,
979
- daysLeft: 0,
980
- expires: {
981
- timestamp: '1970-01-01T00:00:00.000Z',
982
- timestampUNIX: 0,
983
- },
984
- },
985
- details: {
986
- message: '[REDACTED]',
987
- },
988
- }
989
-
990
- log('result', result);
991
-
992
- it('should resolve correctly', () => {
993
- return assert.deepStrictEqual(result, expected);
994
- });
995
- });
996
-
997
- describe('trial => suspendeded', () => {
998
- const item = require('./payment-resolver/chargebee/subscriptions/trial-to-suspended.json');
999
- const result = Manager.SubscriptionResolver({}, item).resolve(options);
1000
- const expected = {
1001
- processor: 'chargebee',
1002
- type: 'subscription',
1003
- status: 'suspended',
1004
- frequency: 'monthly',
1005
- resource: { id: 'Azym2sTkewehg121r' },
1006
- payment: {
1007
- completed: true,
1008
- refunded: false,
1009
- },
1010
- start: { timestamp: '2023-07-21T15:40:12.000Z', timestampUNIX: 1689954012 },
1011
- expires: { timestamp: '1970-01-01T00:00:00.000Z', timestampUNIX: 0 },
1012
- cancelled: { timestamp: '1970-01-01T00:00:00.000Z', timestampUNIX: 0 },
1013
- lastPayment: {
1014
- amount: 0,
1015
- date: { timestamp: '2023-08-04T15:40:12.000Z', timestampUNIX: 1691163612 }
1016
- },
1017
- trial: {
1018
- active: false,
1019
- claimed: true,
1020
- daysLeft: 0,
1021
- expires: {
1022
- timestamp: '1970-01-01T00:00:00.000Z',
1023
- timestampUNIX: 0,
1024
- },
1025
- },
1026
- details: {
1027
- message: '[REDACTED]',
1028
- },
1029
- }
1030
-
1031
- log('result', result);
1032
-
1033
- it('should resolve correctly', () => {
1034
- return assert.deepStrictEqual(result, expected);
1035
- });
1036
- });
1037
- });
1038
-
1039
- });
1040
-
1041
- /*
1042
- * STRIPE
1043
- */
1044
- describe('stripe', () => {
1045
- // Orders
1046
- describe('orders', () => {
1047
- describe('regular', () => {
1048
- const item = require('./payment-resolver/stripe/orders/regular.json');
1049
- const result = Manager.SubscriptionResolver({}, item).resolve(options);
1050
- const expected = {
1051
- processor: 'stripe',
1052
- type: 'order',
1053
- status: 'cancelled',
1054
- frequency: 'single',
1055
- resource: { id: 'ch_3N1pAXJVFkvVyI7h1FM4wdxL' },
1056
- payment: {
1057
- completed: true,
1058
- refunded: false,
1059
- },
1060
- start: { timestamp: '2023-04-28T11:08:54.000Z', timestampUNIX: 1682680134 },
1061
- expires: { timestamp: '2023-04-28T11:08:54.000Z', timestampUNIX: 1682680134 },
1062
- cancelled: { timestamp: '2023-04-28T11:08:54.000Z', timestampUNIX: 1682680134 },
1063
- lastPayment: {
1064
- amount: 1.01,
1065
- date: { timestamp: '2023-04-28T11:08:54.000Z', timestampUNIX: 1682680134 }
1066
- },
1067
- trial: {
1068
- active: false,
1069
- claimed: false,
1070
- daysLeft: 0,
1071
- expires: {
1072
- timestamp: '1970-01-01T00:00:00.000Z',
1073
- timestampUNIX: 0,
1074
- },
1075
- },
1076
- details: {
1077
- message: '[REDACTED]',
1078
- },
1079
- }
1080
-
1081
- log('result', result);
1082
-
1083
- it('should resolve correctly', () => {
1084
- return assert.deepStrictEqual(result, expected);
1085
- });
1086
- });
1087
- });
1088
-
1089
- // Subscriptions
1090
- describe('subscriptions', () => {
1091
- describe('active', () => {
1092
- const item = require('./payment-resolver/stripe/subscriptions/active.json');
1093
- const result = Manager.SubscriptionResolver({}, item).resolve(options);
1094
- const expected = {
1095
- processor: 'stripe',
1096
- type: 'subscription',
1097
- status: 'active',
1098
- frequency: 'monthly',
1099
- resource: { id: 'sub_1McA4ZEvB7hJrWnu1o7GMybv' },
1100
- payment: {
1101
- completed: true,
1102
- refunded: false,
1103
- },
1104
- start: { timestamp: '2023-02-16T16:12:39.000Z', timestampUNIX: 1676563959 },
1105
- expires: { timestamp: '2024-09-15T16:12:39.000Z', timestampUNIX: 1726416759 },
1106
- cancelled: { timestamp: '1970-01-01T00:00:00.000Z', timestampUNIX: 0 },
1107
- lastPayment: {
1108
- amount: 6,
1109
- date: { timestamp: '2023-08-16T16:13:11.000Z', timestampUNIX: 1692202391 }
1110
- },
1111
- trial: {
1112
- active: false,
1113
- claimed: false,
1114
- daysLeft: 0,
1115
- expires: {
1116
- timestamp: '1970-01-01T00:00:00.000Z',
1117
- timestampUNIX: 0,
1118
- },
1119
- },
1120
- details: {
1121
- message: '[REDACTED]',
1122
- },
1123
- }
1124
-
1125
- log('result', result);
1126
-
1127
- it('should resolve correctly', () => {
1128
- return assert.deepStrictEqual(result, expected);
1129
- });
1130
- });
1131
-
1132
- describe('trial => in trial', () => {
1133
- const item = require('./payment-resolver/stripe/subscriptions/trial-in-trial.json');
1134
- const result = Manager.SubscriptionResolver({}, item).resolve(options);
1135
- const expected = {
1136
- processor: 'stripe',
1137
- type: 'subscription',
1138
- status: 'active',
1139
- frequency: 'monthly',
1140
- resource: { id: 'sub_1N1a4yEvB7hJrWnuCzx5ssWK' },
1141
- payment: {
1142
- completed: true,
1143
- refunded: false,
1144
- },
1145
- start: { timestamp: '2023-04-27T19:02:08.000Z', timestampUNIX: 1682622128 },
1146
- expires: { timestamp: '2024-06-10T19:02:08.000Z', timestampUNIX: 1718046128 },
1147
- cancelled: { timestamp: '1970-01-01T00:00:00.000Z', timestampUNIX: 0 },
1148
- lastPayment: {
1149
- amount: 0,
1150
- date: { timestamp: '2023-04-27T19:02:08.000Z', timestampUNIX: 1682622128 }
1151
- },
1152
- trial: {
1153
- active: true,
1154
- claimed: true,
1155
- daysLeft: 13,
1156
- expires: {
1157
- timestamp: '2023-05-11T19:02:08.000Z',
1158
- timestampUNIX: 1683831728,
1159
- },
1160
- },
1161
- details: {
1162
- message: '[REDACTED]',
1163
- },
1164
- }
1165
-
1166
- log('result', result);
1167
-
1168
- it('should resolve correctly', () => {
1169
- return assert.deepStrictEqual(result, expected);
1170
- });
1171
- });
1172
-
1173
- describe('trial => active', () => {
1174
- const item = require('./payment-resolver/stripe/subscriptions/trial-to-active.json');
1175
- const result = Manager.SubscriptionResolver({}, item).resolve(options);
1176
- const expected = {
1177
- processor: 'stripe',
1178
- type: 'subscription',
1179
- status: 'active',
1180
- frequency: 'monthly',
1181
- resource: { id: 'sub_1MqedqJVFkvVyI7hYGbJyOFD' },
1182
- payment: {
1183
- completed: true,
1184
- refunded: false,
1185
- },
1186
- start: { timestamp: '2023-03-28T15:40:58.000Z', timestampUNIX: 1680018058 },
1187
- expires: { timestamp: '2024-05-11T15:40:58.000Z', timestampUNIX: 1715442058 },
1188
- cancelled: { timestamp: '1970-01-01T00:00:00.000Z', timestampUNIX: 0 },
1189
- lastPayment: {
1190
- amount: 6,
1191
- date: { timestamp: '2023-04-11T15:41:07.000Z', timestampUNIX: 1681227667 }
1192
- },
1193
- trial: {
1194
- active: false,
1195
- claimed: true,
1196
- daysLeft: 0,
1197
- expires: {
1198
- timestamp: '1970-01-01T00:00:00.000Z',
1199
- timestampUNIX: 0,
1200
- },
1201
- },
1202
- details: {
1203
- message: '[REDACTED]',
1204
- },
1205
- }
1206
-
1207
- log('result', result);
1208
-
1209
- it('should resolve correctly', () => {
1210
- return assert.deepStrictEqual(result, expected);
1211
- });
1212
- });
1213
-
1214
- describe('trial => active-failed-authorization', () => {
1215
- const item = require('./payment-resolver/stripe/subscriptions/trial-to-active-failed-authorization.json');
1216
- const result = Manager.SubscriptionResolver(profileSubscriptionFailedAuthorization, item).resolve(options);
1217
- const expected = {
1218
- processor: 'stripe',
1219
- type: 'subscription',
1220
- status: 'active',
1221
- frequency: 'monthly',
1222
- resource: { id: 'sub_1OAJjOHGybgi7uQGicdK4TGm' },
1223
- payment: {
1224
- completed: true,
1225
- refunded: false,
1226
- },
1227
- start: { timestamp: '2023-11-08T21:56:14.000Z', timestampUNIX: 1699480574 },
1228
- expires: { timestamp: '2024-12-22T21:56:14.000Z', timestampUNIX: 1734904574 },
1229
- cancelled: { timestamp: '1970-01-01T00:00:00.000Z', timestampUNIX: 0 },
1230
- lastPayment: {
1231
- amount: 8,
1232
- date: { timestamp: '2023-11-22T21:56:26.000Z', timestampUNIX: 1700690186 }
1233
- },
1234
- trial: {
1235
- active: false,
1236
- claimed: true,
1237
- daysLeft: 0,
1238
- expires: {
1239
- timestamp: '1970-01-01T00:00:00.000Z',
1240
- timestampUNIX: 0,
1241
- },
1242
- },
1243
- details: {
1244
- message: '[REDACTED]',
1245
- },
1246
- }
1247
-
1248
- log('result', result);
1249
-
1250
- it('should resolve correctly', () => {
1251
- return assert.deepStrictEqual(result, expected);
1252
- });
1253
- });
1254
-
1255
- describe('trial => cancelled', () => {
1256
- const item = require('./payment-resolver/stripe/subscriptions/trial-to-cancelled.json');
1257
- const result = Manager.SubscriptionResolver({}, item).resolve(options);
1258
- const expected = {
1259
- processor: 'stripe',
1260
- type: 'subscription',
1261
- status: 'cancelled',
1262
- frequency: 'monthly',
1263
- resource: { id: 'sub_1Mv9VtCzY9baOpL0I2MRKfoj' },
1264
- payment: {
1265
- completed: true,
1266
- refunded: false,
1267
- },
1268
- start: { timestamp: '2023-04-10T01:27:21.000Z', timestampUNIX: 1681090041 },
1269
- expires: { timestamp: '1970-01-01T00:00:00.000Z', timestampUNIX: 0 },
1270
- cancelled: { timestamp: '2023-04-17T07:13:15.000Z', timestampUNIX: 1681715595 },
1271
- lastPayment: {
1272
- amount: 0,
1273
- date: { timestamp: '2023-04-10T01:27:21.000Z', timestampUNIX: 1681090041 }
1274
- },
1275
- trial: {
1276
- active: false,
1277
- claimed: true,
1278
- daysLeft: 0,
1279
- expires: {
1280
- timestamp: '1970-01-01T00:00:00.000Z',
1281
- timestampUNIX: 0,
1282
- },
1283
- },
1284
- details: {
1285
- message: '[REDACTED]',
1286
- },
1287
- }
1288
-
1289
- log('result', result);
1290
-
1291
- it('should resolve correctly', () => {
1292
- return assert.deepStrictEqual(result, expected);
1293
- });
1294
- });
1295
-
1296
- describe('trial => refund', () => {
1297
- const item = require('./payment-resolver/stripe/subscriptions/trial-to-refund.json');
1298
- const result = Manager.SubscriptionResolver({}, item).resolve(options);
1299
- const expected = {
1300
- processor: 'stripe',
1301
- type: 'subscription',
1302
- status: 'cancelled',
1303
- frequency: 'annually',
1304
- resource: { id: 'sub_1NWA2ZHGybgi7uQGF7ODZNEZ' },
1305
- payment: {
1306
- completed: true,
1307
- refunded: true,
1308
- },
1309
- start: { timestamp: '2023-07-21T03:30:03.000Z', timestampUNIX: 1689910203 },
1310
- expires: { timestamp: '1970-01-01T00:00:00.000Z', timestampUNIX: 0 },
1311
- cancelled: { timestamp: '2023-08-03T19:51:57.000Z', timestampUNIX: 1691092317 },
1312
- lastPayment: {
1313
- amount: 72,
1314
- date: { timestamp: '2023-07-21T03:30:03.000Z', timestampUNIX: 1689910203 }
1315
- },
1316
- trial: {
1317
- active: false,
1318
- claimed: false,
1319
- daysLeft: 0,
1320
- expires: {
1321
- timestamp: '1970-01-01T00:00:00.000Z',
1322
- timestampUNIX: 0,
1323
- },
1324
- },
1325
- details: {
1326
- message: '[REDACTED]',
1327
- },
1328
- }
1329
-
1330
- log('result', result);
1331
-
1332
- it('should resolve correctly', () => {
1333
- return assert.deepStrictEqual(result, expected);
1334
- });
1335
- });
1336
-
1337
- describe('trial => suspended', () => {
1338
- const item = require('./payment-resolver/stripe/subscriptions/trial-to-suspended.json');
1339
- const result = Manager.SubscriptionResolver({}, item).resolve(options);
1340
- const expected = {
1341
- processor: 'stripe',
1342
- type: 'subscription',
1343
- status: 'suspended',
1344
- frequency: 'monthly',
1345
- resource: { id: 'sub_1MrOiKCzY9baOpL0TNU5sQZQ' },
1346
- payment: {
1347
- completed: true,
1348
- refunded: false,
1349
- },
1350
- start: { timestamp: '2023-03-30T16:52:40.000Z', timestampUNIX: 1680195160 },
1351
- expires: { timestamp: '1970-01-01T00:00:00.000Z', timestampUNIX: 0 },
1352
- cancelled: { timestamp: '1970-01-01T00:00:00.000Z', timestampUNIX: 0 },
1353
- lastPayment: {
1354
- amount: 0,
1355
- date: { timestamp: '2023-04-13T16:52:51.000Z', timestampUNIX: 1681404771 }
1356
- },
1357
- trial: {
1358
- active: false,
1359
- claimed: true,
1360
- daysLeft: 0,
1361
- expires: {
1362
- timestamp: '1970-01-01T00:00:00.000Z',
1363
- timestampUNIX: 0,
1364
- },
1365
- },
1366
- details: {
1367
- message: '[REDACTED]',
1368
- },
1369
- }
1370
-
1371
- log('result', result);
1372
-
1373
- it('should resolve correctly', () => {
1374
- return assert.deepStrictEqual(result, expected);
1375
- });
1376
- });
1377
-
1378
- // describe('unsure', () => {
1379
- // const item = require('./payment-resolver/stripe/subscriptions/unsure.json');
1380
- // const result = Manager.SubscriptionResolver({}, item).resolve(options);
1381
- // const expected = {
1382
- // processor: 'stripe',
1383
- // type: 'subscription',
1384
- // status: 'active',
1385
- // frequency: 'monthly',
1386
- // resource: { id: 'sub_1OkWCdHGybgi7uQGxQDhAQ51' },
1387
- // payment: {
1388
- // completed: true,
1389
- // refunded: false,
1390
- // },
1391
- // start: { timestamp: '2024-02-16T18:32:03.000Z', timestampUNIX: 1708108323 },
1392
- // expires: { timestamp: '1970-01-01T00:00:00.000Z', timestampUNIX: 0 },
1393
- // cancelled: { timestamp: '1970-01-01T00:00:00.000Z', timestampUNIX: 0 },
1394
- // lastPayment: {
1395
- // amount: 0,
1396
- // date: { timestamp: '2023-04-13T16:52:51.000Z', timestampUNIX: 1681404771 }
1397
- // },
1398
- // trial: {
1399
- // active: false,
1400
- // claimed: true,
1401
- // daysLeft: 0,
1402
- // expires: {
1403
- // timestamp: '1970-01-01T00:00:00.000Z',
1404
- // timestampUNIX: 0,
1405
- // },
1406
- // },
1407
- // details: {
1408
- // message: '[REDACTED]',
1409
- // },
1410
- // }
1411
-
1412
- // log('result', result);
1413
-
1414
- // it('should resolve correctly', () => {
1415
- // return assert.deepStrictEqual(result, expected);
1416
- // });
1417
- // });
1418
-
1419
-
1420
- });
1421
-
1422
- });
1423
-
1424
- /*
1425
- * COINBASE
1426
- */
1427
- describe('coinbase', () => {
1428
- describe('order', () => {
1429
- describe('regular', () => {
1430
- const item = require('./payment-resolver/coinbase/orders/regular.json');
1431
- const result = Manager.SubscriptionResolver(defaultProfileOrder, item).resolve(options);
1432
- const expected = {
1433
- processor: 'coinbase',
1434
- type: 'order',
1435
- status: 'cancelled',
1436
- frequency: 'single',
1437
- resource: { id: '8f783fa6-eaa3-4460-af64-cac26b183ed1' },
1438
- payment: {
1439
- completed: true,
1440
- refunded: false,
1441
- },
1442
- start: { timestamp: '2023-04-26T09:59:19.000Z', timestampUNIX: 1682503159 },
1443
- expires: { timestamp: '2023-04-26T09:59:19.000Z', timestampUNIX: 1682503159 },
1444
- cancelled: { timestamp: '2023-04-26T09:59:19.000Z', timestampUNIX: 1682503159 },
1445
- lastPayment: {
1446
- amount: 16,
1447
- date: { timestamp: '2023-04-26T10:06:55.000Z', timestampUNIX: 1682503615 }
1448
- },
1449
- trial: {
1450
- active: false,
1451
- claimed: false,
1452
- daysLeft: 0,
1453
- expires: {
1454
- timestamp: '1970-01-01T00:00:00.000Z',
1455
- timestampUNIX: 0,
1456
- },
1457
- },
1458
- details: {
1459
- message: '[REDACTED]',
1460
- },
1461
- }
1462
-
1463
- log('result', result);
1464
-
1465
- it('should resolve correctly', () => {
1466
- return assert.deepStrictEqual(result, expected);
1467
- });
1468
- });
1469
- });
1470
-
1471
- describe('subscription', () => {
1472
- describe('cancelled', () => {
1473
- const item = require('./payment-resolver/coinbase/subscriptions/cancelled.json');
1474
- const result = Manager.SubscriptionResolver(profileSubscriptionDefault, item).resolve(options);
1475
- const expected = {
1476
- processor: 'coinbase',
1477
- type: 'subscription',
1478
- status: 'cancelled',
1479
- frequency: 'monthly',
1480
- resource: { id: '8f783fa6-eaa3-4460-af64-cac26b183ed1' },
1481
- payment: {
1482
- completed: true,
1483
- refunded: false,
1484
- },
1485
- start: { timestamp: '2023-04-26T09:59:19.000Z', timestampUNIX: 1682503159 },
1486
- expires: { timestamp: '2023-05-26T09:59:19.000Z', timestampUNIX: 1685095159 },
1487
- cancelled: { timestamp: '2023-04-26T09:59:19.000Z', timestampUNIX: 1682503159 },
1488
- lastPayment: {
1489
- amount: 16,
1490
- date: { timestamp: '2023-04-26T10:06:55.000Z', timestampUNIX: 1682503615 }
1491
- },
1492
- trial: {
1493
- active: false,
1494
- claimed: false,
1495
- daysLeft: 0,
1496
- expires: {
1497
- timestamp: '1970-01-01T00:00:00.000Z',
1498
- timestampUNIX: 0,
1499
- },
1500
- },
1501
- details: {
1502
- message: '[REDACTED]',
1503
- },
1504
- }
1505
-
1506
- log('result', result);
1507
-
1508
- it('should resolve correctly', () => {
1509
- return assert.deepStrictEqual(result, expected);
1510
- });
1511
- });
1512
-
1513
- describe('paid 2', () => {
1514
- const item = require('./payment-resolver/coinbase/subscriptions/paid-2.json');
1515
- const result = Manager.SubscriptionResolver(profileSubscriptionDefault, item).resolve(options);
1516
- const expected = {
1517
- processor: 'coinbase',
1518
- type: 'subscription',
1519
- status: 'cancelled',
1520
- frequency: 'monthly',
1521
- resource: { id: '1baa71fb-318c-400c-9020-08b894a1fa6e' },
1522
- payment: {
1523
- completed: true,
1524
- refunded: false,
1525
- },
1526
- start: { timestamp: '2024-01-23T21:59:03.000Z', timestampUNIX: 1706047143 },
1527
- expires: { timestamp: '2024-02-23T21:59:03.000Z', timestampUNIX: 1708725543 },
1528
- cancelled: { timestamp: '2024-01-23T21:59:03.000Z', timestampUNIX: 1706047143 },
1529
- lastPayment: {
1530
- amount: 10,
1531
- date: { timestamp: '2024-01-23T22:40:35.000Z', timestampUNIX: 1706049635 }
1532
- },
1533
- trial: {
1534
- active: false,
1535
- claimed: false,
1536
- daysLeft: 0,
1537
- expires: {
1538
- timestamp: '1970-01-01T00:00:00.000Z',
1539
- timestampUNIX: 0,
1540
- },
1541
- },
1542
- details: {
1543
- message: '[REDACTED]',
1544
- },
1545
- }
1546
-
1547
- log('result', result);
1548
-
1549
- it('should resolve correctly', () => {
1550
- return assert.deepStrictEqual(result, expected);
1551
- });
1552
- });
1553
- });
1554
- });
1555
-
1556
- });
1557
-
1558
- })