taxtank-core 0.30.12 → 0.30.14

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.
@@ -5743,7 +5743,7 @@ class ServiceSubscriptionCollection extends Collection {
5743
5743
  const dictionary = new Dictionary([]);
5744
5744
  products.toArray().forEach((product) => {
5745
5745
  const subscriptions = this.filterByProduct(product);
5746
- dictionary.add(product.id, (subscriptions.getPaid() || subscriptions.getTrials()).first);
5746
+ dictionary.add(product.id, (subscriptions.getPaid().first ?? subscriptions.getTrials().first));
5747
5747
  });
5748
5748
  return dictionary;
5749
5749
  }
@@ -6665,7 +6665,8 @@ class ServiceSubscription extends ServiceSubscription$1 {
6665
6665
  }
6666
6666
  return price - price * (this.stripePromoCode.percentOff / 100);
6667
6667
  }
6668
- return price;
6668
+ // promo code can't make price < 0
6669
+ return price > 0 ? price : 0;
6669
6670
  }
6670
6671
  /**
6671
6672
  * get title of subscription