Bypass EAP fees for anchor tenants

Note that the check flow does not yet handle any kind of allocation token
handling at all. Step 2 will be to add allocation token handling there, so a
RESERVED_FOR_ANCHOR_TENANT or RESERVED_FOR_SPECIFIC_USE domain will show as
available instead of reserved if the right token is specified using the
extension. Then once that's done, we can use that information to adjust the
price accordingly as well.

Right now the behavior with a domain check is that reserved domains always show
as reserved, even if they're anchor tenants.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=215599350
This commit is contained in:
mcilwain 2018-10-03 11:49:25 -07:00 committed by Ben McIlwain
parent ce5bbe4bfa
commit 1586813398
6 changed files with 55 additions and 136 deletions

View file

@ -54,7 +54,8 @@ public final class DomainPricingLogic {
/** Returns a new create price for the pricer. */
public FeesAndCredits getCreatePrice(
Registry registry, String domainName, DateTime date, int years) throws EppException {
Registry registry, String domainName, DateTime date, int years, boolean isAnchorTenant)
throws EppException {
CurrencyUnit currency = registry.getCurrency();
// Get the vanilla create cost.
@ -65,7 +66,8 @@ public final class DomainPricingLogic {
Fee eapFee = registry.getEapFeeFor(date);
FeesAndCredits.Builder feesBuilder =
new FeesAndCredits.Builder().setCurrency(currency).addFeeOrCredit(createFeeOrCredit);
if (!eapFee.hasZeroCost()) {
// Don't charge anchor tenants EAP fees.
if (!isAnchorTenant && !eapFee.hasZeroCost()) {
feesBuilder.addFeeOrCredit(eapFee);
}