Use a potential discount in the AllocationToken when determining domain create price

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=245458027
This commit is contained in:
gbrodman 2019-04-26 11:38:31 -07:00 committed by jianglai
parent 1a1ff94bc5
commit 70c7e6c224
14 changed files with 388 additions and 96 deletions

View file

@ -550,7 +550,8 @@ public class DomainFlowUtils {
InternetDomainName domain,
@Nullable CurrencyUnit topLevelCurrency,
DateTime currentDate,
DomainPricingLogic pricingLogic)
DomainPricingLogic pricingLogic,
Optional<AllocationToken> allocationToken)
throws EppException {
DateTime now = currentDate;
// Use the custom effective date specified in the fee check request, if there is one.
@ -588,10 +589,10 @@ public class DomainFlowUtils {
builder.setReasonIfSupported("reserved");
} else {
builder.setAvailIfSupported(true);
// TODO(b/117145844): Once allocation token support for domain check flow is implemented,
// we should be able to calculate the correct price here.
fees =
pricingLogic.getCreatePrice(registry, domainNameString, now, years, false).getFees();
pricingLogic
.getCreatePrice(registry, domainNameString, now, years, false, allocationToken)
.getFees();
}
break;
case RENEW: