Add EAP fees to domain create flow

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=126411200
This commit is contained in:
ctingue 2016-07-01 08:16:31 -07:00 committed by Ben McIlwain
parent d6bd2d56cd
commit 273fc0014d
7 changed files with 118 additions and 18 deletions

View file

@ -33,7 +33,6 @@ import google.registry.model.domain.DomainApplication;
import google.registry.model.domain.DomainApplication.Builder;
import google.registry.model.domain.DomainResource;
import google.registry.model.domain.Period;
import google.registry.model.domain.fee.Fee;
import google.registry.model.domain.fee.FeeCreateExtension;
import google.registry.model.domain.fee.FeeCreateResponseExtension;
import google.registry.model.domain.launch.ApplicationStatus;
@ -143,7 +142,8 @@ public class DomainApplicationCreateFlow extends BaseDomainCreateFlow<DomainAppl
@Override
protected void verifyDomainCreateIsAllowed() throws EppException {
validateFeeChallenge(targetId, getTld(), now, feeCreate, createCost);
validateFeeChallenge(
targetId, getTld(), now, feeCreate, commandOperations.getTotalCost());
if (tldState == TldState.LANDRUSH && !isSuperuser) {
// Prohibit creating a landrush application in LANDRUSH (but not in SUNRUSH) if there is
// exactly one sunrise application for the same name.
@ -214,8 +214,8 @@ public class DomainApplicationCreateFlow extends BaseDomainCreateFlow<DomainAppl
.build());
if (feeCreate != null) {
responseExtensionsBuilder.add(new FeeCreateResponseExtension.Builder()
.setCurrency(createCost.getCurrencyUnit())
.setFee(ImmutableList.of(Fee.create(createCost.getAmount(), "create")))
.setCurrency(commandOperations.getCurrency())
.setFee(commandOperations.getFees())
.build());
}