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.
- package/esm2020/lib/collections/subscription/service-subscription.collection.mjs +2 -2
- package/esm2020/lib/models/service-subscription/service-subscription.mjs +3 -2
- package/fesm2015/taxtank-core.mjs +4 -2
- package/fesm2015/taxtank-core.mjs.map +1 -1
- package/fesm2020/taxtank-core.mjs +3 -2
- package/fesm2020/taxtank-core.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -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()
|
|
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
|
-
|
|
6668
|
+
// promo code can't make price < 0
|
|
6669
|
+
return price > 0 ? price : 0;
|
|
6669
6670
|
}
|
|
6670
6671
|
/**
|
|
6671
6672
|
* get title of subscription
|