diff --git a/docs/flows.md b/docs/flows.md index 1330ee3c0..e81f4693e 100644 --- a/docs/flows.md +++ b/docs/flows.md @@ -240,6 +240,7 @@ information. * 2002 * Command is not allowed in the current registry phase. * 2004 + * Unknown currency. * Domain label is not allowed by IDN table. * Domain name is under tld which doesn't exist. * 2005 @@ -311,6 +312,7 @@ An EPP flow that creates a new domain resource. * Registrant is required. * Technical contact is required. * 2004 + * Unknown currency. * The acceptance time specified in the claim notice is more than 48 hours in the past. * New registration period exceeds maximum number of years. @@ -421,6 +423,8 @@ information about the domain. ### Errors +* 2004 + * Unknown currency. * 2202 * Authorization information for accessing resource is invalid. * 2303 @@ -455,6 +459,7 @@ comes in at the exact millisecond that the domain would have expired. * Fees must be explicitly acknowledged when performing any operations on a premium name. * 2004 + * Unknown currency. * New registration period exceeds maximum number of years. * The fees passed in the transform command do not match the fees that will be charged. @@ -512,6 +517,7 @@ regardless of what the original expiration time was. * Fees must be explicitly acknowledged when performing any operations on a premium name. * 2004 + * Unknown currency. * The fees passed in the transform command do not match the fees that will be charged. * 2005 @@ -677,6 +683,7 @@ new ones with the correct approval time). * Fees must be explicitly acknowledged when performing any operations on a premium name. * 2004 + * Unknown currency. * The fees passed in the transform command do not match the fees that will be charged. * 2005 diff --git a/java/google/registry/flows/FlowUtils.java b/java/google/registry/flows/FlowUtils.java index 767688e08..0c18d0465 100644 --- a/java/google/registry/flows/FlowUtils.java +++ b/java/google/registry/flows/FlowUtils.java @@ -114,7 +114,7 @@ public final class FlowUtils { } /** Unknown currency. */ - static class UnknownCurrencyEppException extends ParameterValueRangeErrorException { + public static class UnknownCurrencyEppException extends ParameterValueRangeErrorException { public UnknownCurrencyEppException() { super("Unknown currency."); } diff --git a/java/google/registry/flows/domain/DomainCheckFlow.java b/java/google/registry/flows/domain/DomainCheckFlow.java index 6c011a8d7..fb909ebd6 100644 --- a/java/google/registry/flows/domain/DomainCheckFlow.java +++ b/java/google/registry/flows/domain/DomainCheckFlow.java @@ -77,6 +77,7 @@ import org.joda.time.DateTime; *
This flow also supports the EPP fee extension and can return pricing information.
*
* @error {@link google.registry.flows.exceptions.TooManyResourceChecksException}
+ * @error {@link google.registry.flows.FlowUtils.UnknownCurrencyEppException}
* @error {@link DomainFlowUtils.BadDomainNameCharacterException}
* @error {@link DomainFlowUtils.BadDomainNamePartsCountException}
* @error {@link DomainFlowUtils.DomainNameExistsAsTldException}
diff --git a/java/google/registry/flows/domain/DomainCreateFlow.java b/java/google/registry/flows/domain/DomainCreateFlow.java
index c65ce8275..eed6f1a06 100644
--- a/java/google/registry/flows/domain/DomainCreateFlow.java
+++ b/java/google/registry/flows/domain/DomainCreateFlow.java
@@ -123,6 +123,7 @@ import org.joda.time.Duration;
* @error {@link google.registry.flows.exceptions.ResourceAlreadyExistsException}
* @error {@link google.registry.flows.EppException.UnimplementedExtensionException}
* @error {@link google.registry.flows.ExtensionManager.UndeclaredServiceExtensionException}
+ * @error {@link google.registry.flows.FlowUtils.UnknownCurrencyEppException}
* @error {@link DomainCreateFlow.AnchorTenantCreatePeriodException}
* @error {@link DomainCreateFlow.MustHaveSignedMarksInCurrentPhaseException}
* @error {@link DomainCreateFlow.NoGeneralRegistrationsInCurrentPhaseException}
diff --git a/java/google/registry/flows/domain/DomainInfoFlow.java b/java/google/registry/flows/domain/DomainInfoFlow.java
index a87b23dbb..ad7431071 100644
--- a/java/google/registry/flows/domain/DomainInfoFlow.java
+++ b/java/google/registry/flows/domain/DomainInfoFlow.java
@@ -63,6 +63,7 @@ import org.joda.time.DateTime;
* domain, will get a rich result with all of the domain's fields. All other requests will be
* answered with a minimal result containing only basic information about the domain.
*
+ * @error {@link google.registry.flows.FlowUtils.UnknownCurrencyEppException}
* @error {@link google.registry.flows.ResourceFlowUtils.BadAuthInfoForResourceException}
* @error {@link google.registry.flows.ResourceFlowUtils.ResourceDoesNotExistException}
* @error {@link DomainFlowUtils.BadPeriodUnitException}
diff --git a/java/google/registry/flows/domain/DomainRenewFlow.java b/java/google/registry/flows/domain/DomainRenewFlow.java
index 37049b072..ffb580d93 100644
--- a/java/google/registry/flows/domain/DomainRenewFlow.java
+++ b/java/google/registry/flows/domain/DomainRenewFlow.java
@@ -92,6 +92,7 @@ import org.joda.time.Duration;
* longer than 10 years unless it comes in at the exact millisecond that the domain would have
* expired.
*
+ * @error {@link google.registry.flows.FlowUtils.UnknownCurrencyEppException}
* @error {@link google.registry.flows.ResourceFlowUtils.ResourceDoesNotExistException}
* @error {@link google.registry.flows.ResourceFlowUtils.ResourceNotOwnedException}
* @error {@link google.registry.flows.exceptions.ResourceStatusProhibitsOperationException}
diff --git a/java/google/registry/flows/domain/DomainRestoreRequestFlow.java b/java/google/registry/flows/domain/DomainRestoreRequestFlow.java
index 1dd507f4d..d2e4e951d 100644
--- a/java/google/registry/flows/domain/DomainRestoreRequestFlow.java
+++ b/java/google/registry/flows/domain/DomainRestoreRequestFlow.java
@@ -92,6 +92,7 @@ import org.joda.time.DateTime;
* original expiration time was.
*
* @error {@link google.registry.flows.EppException.UnimplementedExtensionException}
+ * @error {@link google.registry.flows.FlowUtils.UnknownCurrencyEppException}
* @error {@link google.registry.flows.ResourceFlowUtils.ResourceDoesNotExistException}
* @error {@link google.registry.flows.ResourceFlowUtils.ResourceNotOwnedException}
* @error {@link DomainFlowUtils.CurrencyUnitMismatchException}
diff --git a/java/google/registry/flows/domain/DomainTransferRequestFlow.java b/java/google/registry/flows/domain/DomainTransferRequestFlow.java
index 1d01d1e78..3c728bd2e 100644
--- a/java/google/registry/flows/domain/DomainTransferRequestFlow.java
+++ b/java/google/registry/flows/domain/DomainTransferRequestFlow.java
@@ -92,6 +92,7 @@ import org.joda.time.DateTime;
* rejection or cancellation of the request, they will be deleted (and in the approval case,
* replaced with new ones with the correct approval time).
*
+ * @error {@link google.registry.flows.FlowUtils.UnknownCurrencyEppException}
* @error {@link google.registry.flows.ResourceFlowUtils.BadAuthInfoForResourceException}
* @error {@link google.registry.flows.ResourceFlowUtils.ResourceDoesNotExistException}
* @error {@link google.registry.flows.exceptions.AlreadyPendingTransferException}
diff --git a/javatests/google/registry/flows/domain/DomainCheckFlowTest.java b/javatests/google/registry/flows/domain/DomainCheckFlowTest.java
index 71615ac35..96872e1af 100644
--- a/javatests/google/registry/flows/domain/DomainCheckFlowTest.java
+++ b/javatests/google/registry/flows/domain/DomainCheckFlowTest.java
@@ -37,6 +37,7 @@ import com.google.common.collect.ImmutableSortedMap;
import com.google.common.collect.Ordering;
import com.googlecode.objectify.Key;
import google.registry.flows.EppException;
+import google.registry.flows.FlowUtils.UnknownCurrencyEppException;
import google.registry.flows.ResourceCheckFlowTestCase;
import google.registry.flows.domain.DomainCheckFlow.OnlyCheckedNamesCanBeFeeCheckedException;
import google.registry.flows.domain.DomainFlowUtils.BadCommandForRegistryPhaseException;
@@ -417,7 +418,7 @@ public class DomainCheckFlowTest
@Test
public void testFeeExtension_v06() throws Exception {
persistActiveDomain("example1.tld");
- setEppInput("domain_check_fee_v06.xml");
+ setEppInput("domain_check_fee_v06.xml", ImmutableMap.of("CURRENCY", "USD"));
runFlowAssertResponse(loadFile("domain_check_fee_response_v06.xml"));
}
@@ -430,7 +431,7 @@ public class DomainCheckFlowTest
persistReservedList("example-sunrise", "allowedinsunrise,ALLOWED_IN_SUNRISE"))
.build());
persistActiveDomain("example1.tld");
- setEppInput("domain_check_fee_v06.xml");
+ setEppInput("domain_check_fee_v06.xml", ImmutableMap.of("CURRENCY", "USD"));
runFlowAssertResponse(loadFile("domain_check_fee_response_v06.xml"));
}
@@ -726,6 +727,13 @@ public class DomainCheckFlowTest
assertAboutEppExceptions().that(thrown).marshalsToXml();
}
+ @Test
+ public void testFeeExtension_badCurrencyType() {
+ setEppInput("domain_check_fee_v06.xml", ImmutableMap.of("CURRENCY", "BAD"));
+ EppException thrown = assertThrows(UnknownCurrencyEppException.class, this::runFlow);
+ assertAboutEppExceptions().that(thrown).marshalsToXml();
+ }
+
@Test
public void testFeeExtension_periodNotInYears_v06() {
setEppInput("domain_check_fee_bad_period_v06.xml");
@@ -896,7 +904,7 @@ public class DomainCheckFlowTest
.put(clock.nowUtc().plusDays(2), Money.of(USD, 0))
.build())
.build());
- setEppInput(inputFile);
+ setEppInput(inputFile, ImmutableMap.of("CURRENCY", "USD"));
runFlowAssertResponse(loadFile(outputFile));
}
diff --git a/javatests/google/registry/flows/domain/DomainCreateFlowTest.java b/javatests/google/registry/flows/domain/DomainCreateFlowTest.java
index a0eb98895..32df35918 100644
--- a/javatests/google/registry/flows/domain/DomainCreateFlowTest.java
+++ b/javatests/google/registry/flows/domain/DomainCreateFlowTest.java
@@ -57,7 +57,6 @@ import static google.registry.tmch.LordnTaskUtils.QUEUE_CLAIMS;
import static google.registry.tmch.LordnTaskUtils.QUEUE_SUNRISE;
import static google.registry.util.DateTimeUtils.END_OF_TIME;
import static google.registry.util.DateTimeUtils.START_OF_TIME;
-import static org.joda.money.CurrencyUnit.EUR;
import static org.joda.money.CurrencyUnit.USD;
import com.google.common.base.Strings;
@@ -71,6 +70,7 @@ import google.registry.flows.EppException;
import google.registry.flows.EppException.UnimplementedExtensionException;
import google.registry.flows.EppRequestSource;
import google.registry.flows.ExtensionManager.UndeclaredServiceExtensionException;
+import google.registry.flows.FlowUtils.UnknownCurrencyEppException;
import google.registry.flows.ResourceFlowTestCase;
import google.registry.flows.domain.DomainCreateFlow.AnchorTenantCreatePeriodException;
import google.registry.flows.domain.DomainCreateFlow.MustHaveSignedMarksInCurrentPhaseException;
@@ -154,7 +154,6 @@ import google.registry.model.reporting.HistoryEntry;
import google.registry.monitoring.whitebox.EppMetric;
import google.registry.testing.TaskQueueHelper.TaskMatcher;
import java.util.Map;
-import org.joda.money.CurrencyUnit;
import org.joda.money.Money;
import org.joda.time.DateTime;
import org.joda.time.Duration;
@@ -516,7 +515,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase