Modify create price custom logic to return FeesAndCredits

Previously DomainPricingCustomLogic#customizeCreatePrice takes in the create
price itself and modifies it. Change it to take in the entire FeesAndCredits (previously named EppCommandOperations) which may contain other fees related to domain creation,
such as EAP fees, and returns FeesAndCredits that may either change the
fees or add new type of fees.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=141600614
This commit is contained in:
jianglai 2016-12-09 14:30:03 -08:00 committed by Ben McIlwain
parent a56a0677ba
commit 74d64f502e
7 changed files with 90 additions and 91 deletions

View file

@ -56,7 +56,7 @@ import google.registry.flows.EppException.ParameterValueSyntaxErrorException;
import google.registry.flows.EppException.RequiredParameterMissingException;
import google.registry.flows.EppException.StatusProhibitsOperationException;
import google.registry.flows.EppException.UnimplementedOptionException;
import google.registry.flows.domain.DomainPricingLogic.EppCommandOperations;
import google.registry.flows.domain.DomainPricingLogic.FeesAndCredits;
import google.registry.flows.exceptions.ResourceAlreadyExistsException;
import google.registry.flows.exceptions.ResourceHasClientUpdateProhibitedException;
import google.registry.model.EppResource;
@ -994,12 +994,12 @@ public class DomainFlowUtils {
/** Create a response extension listign the fees on a domain or application create. */
static FeeTransformResponseExtension createFeeCreateResponse(
FeeTransformCommandExtension feeCreate,
EppCommandOperations commandOperations) {
return feeCreate.createResponseBuilder()
.setCurrency(commandOperations.getCurrency())
.setFees(commandOperations.getFees())
.setCredits(commandOperations.getCredits())
FeeTransformCommandExtension feeCreate, FeesAndCredits feesAndCredits) {
return feeCreate
.createResponseBuilder()
.setCurrency(feesAndCredits.getCurrency())
.setFees(feesAndCredits.getFees())
.setCredits(feesAndCredits.getCredits())
.build();
}