Restrict domain transfer pricing to 1 year

This CL restricts domain transfer pricing lookups (on domain check and info) to
only support a 1-year period for inquiring about transfer fees.  That treatment
matches what we do for domain restores, which are also always one year.  This is
a followup to [] which disallowed actual transfer request flows from
specifying multi-year periods.

Since it's no longer necessary, this CL also changes the domain transfer pricing
logic to drop the years parameter, including removing the parameter from the
custom pricing logic TransferPriceParameters object.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=150367839
This commit is contained in:
nickfelt 2017-03-16 14:19:10 -07:00 committed by Ben McIlwain
parent 8b37620af1
commit 70fbdccea2
15 changed files with 133 additions and 18 deletions

View file

@ -110,7 +110,6 @@ public final class DomainPricingLogic {
}
/** Returns a new restore price for the pricer. */
@SuppressWarnings("unused")
public FeesAndCredits getRestorePrice(Registry registry, String domainName, DateTime date)
throws EppException {
FeesAndCredits feesAndCredits =
@ -131,13 +130,9 @@ public final class DomainPricingLogic {
}
/** Returns a new transfer price for the pricer. */
public FeesAndCredits getTransferPrice(
Registry registry,
String domainName,
DateTime transferDate,
int years)
public FeesAndCredits getTransferPrice(Registry registry, String domainName, DateTime date)
throws EppException {
Money renewCost = getDomainRenewCost(domainName, transferDate, years);
Money renewCost = getDomainRenewCost(domainName, date, 1);
return customLogic.customizeTransferPrice(
TransferPriceParameters.newBuilder()
.setFeesAndCredits(
@ -147,8 +142,7 @@ public final class DomainPricingLogic {
.build())
.setRegistry(registry)
.setDomainName(InternetDomainName.from(domainName))
.setAsOfDate(transferDate)
.setYears(years)
.setAsOfDate(date)
.build());
}