From 9aaf7ee36a84f4cebbf0786454224b60c05d4b0f Mon Sep 17 00:00:00 2001 From: gbrodman Date: Thu, 6 Feb 2025 15:40:24 -0500 Subject: [PATCH] Allow for no fee extension with free premium domains (#2660) This isn't a situation we'll encounter often, but if the client has an allocation token that's valid for premium domains that gives a 0 cost, we shouldn't require them to include the fee extension when creating the domain. We already don't require it for standard domains. --- .../registry/flows/domain/FeesAndCredits.java | 2 +- .../flows/domain/DomainCreateFlowTest.java | 21 +++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/google/registry/flows/domain/FeesAndCredits.java b/core/src/main/java/google/registry/flows/domain/FeesAndCredits.java index 65b5c905c..cfecde986 100644 --- a/core/src/main/java/google/registry/flows/domain/FeesAndCredits.java +++ b/core/src/main/java/google/registry/flows/domain/FeesAndCredits.java @@ -64,7 +64,7 @@ public class FeesAndCredits extends ImmutableObject implements Buildable { } public boolean hasAnyPremiumFees() { - return fees.stream().anyMatch(BaseFee::isPremium); + return fees.stream().anyMatch(fee -> fee.isPremium() && !fee.hasZeroCost()); } /** Returns the create cost for the event. */ diff --git a/core/src/test/java/google/registry/flows/domain/DomainCreateFlowTest.java b/core/src/test/java/google/registry/flows/domain/DomainCreateFlowTest.java index 8b03320d4..c78f2fcad 100644 --- a/core/src/test/java/google/registry/flows/domain/DomainCreateFlowTest.java +++ b/core/src/test/java/google/registry/flows/domain/DomainCreateFlowTest.java @@ -1741,6 +1741,27 @@ class DomainCreateFlowTest extends ResourceFlowTestCase