backend-manager 2.5.78 → 2.5.79

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "backend-manager",
3
- "version": "2.5.78",
3
+ "version": "2.5.79",
4
4
  "description": "Quick tools for developing Firebase functions",
5
5
  "main": "src/manager/index.js",
6
6
  "bin": {
@@ -62,4 +62,4 @@
62
62
  "wonderful-fetch": "^0.0.17",
63
63
  "yargs": "^17.7.1"
64
64
  }
65
- }
65
+ }
@@ -317,11 +317,14 @@ SubscriptionResolver.prototype.resolve = function (options) {
317
317
  get(resource, 'created_at', 0)
318
318
  );
319
319
 
320
+ // Retrieve last payment
321
+ const lastPayment = resource.payments.find(p => p.status === 'CONFIRMED');
322
+
320
323
  // Set last payment
321
324
  if (lastPayment) {
322
325
  resolved.lastPayment.amount = parseFloat(lastPayment.value.local.amount);
323
326
  resolved.lastPayment.date.timestamp = moment(lastPayment.detected_at);
324
- }
327
+ }
325
328
 
326
329
  // Get trial
327
330
  if (true) {
@@ -337,7 +340,6 @@ SubscriptionResolver.prototype.resolve = function (options) {
337
340
  }
338
341
 
339
342
  // Set completed
340
- const lastPayment = resource.payments.find(p => p.status === 'CONFIRMED');
341
343
  if (true) {
342
344
  resolved.payment.completed = !!lastPayment;
343
345
  }