Relax configured currency checks
This commit is contained in:
parent
dd7a20a774
commit
8cb9c60a3c
|
@ -104,11 +104,13 @@ public class SubscriptionConfiguration {
|
|||
@JsonIgnore
|
||||
@ValidationMethod(message = "has a mismatch between the levels supported currencies")
|
||||
public boolean isCurrencyListSameAcrossAllLevels() {
|
||||
final Map<Long, SubscriptionLevelConfiguration> subscriptionLevels = Stream
|
||||
.concat(donationLevels.entrySet().stream(), backupLevels.entrySet().stream())
|
||||
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
|
||||
return isCurrencyListSameAccrossLevelConfigurations(donationLevels)
|
||||
&& isCurrencyListSameAccrossLevelConfigurations(backupLevels);
|
||||
}
|
||||
|
||||
Optional<SubscriptionLevelConfiguration> any = subscriptionLevels.values().stream().findAny();
|
||||
private static boolean isCurrencyListSameAccrossLevelConfigurations(
|
||||
Map<Long, ? extends SubscriptionLevelConfiguration> subscriptionLevels) {
|
||||
Optional<? extends SubscriptionLevelConfiguration> any = subscriptionLevels.values().stream().findAny();
|
||||
if (any.isEmpty()) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -367,6 +367,10 @@ subscription: # configuration for Stripe subscriptions
|
|||
backupExpiration: P30D
|
||||
backupGracePeriod: P15D
|
||||
backupFreeTierMediaDuration: P30D
|
||||
backupLevels:
|
||||
201:
|
||||
playProductId: EXAMPLE
|
||||
prices: {}
|
||||
levels:
|
||||
500:
|
||||
badge: EXAMPLE
|
||||
|
|
Loading…
Reference in New Issue