google-nomulus/java/google/registry/model/domain
jianglai ff221fba96 Validate individual fee types
Currently we validate the fee extension by summing up all fees present in the extension and comparing it against the total fee to be charged. While this works in most cases, we'd like the ability to individually validate each fee. This is especially useful during EAP when two fees are charged, a regular "create" fee that would also be amount we charge during renewal, and a one time "EAP" fee.

Because we can only distinguish fees by their descriptions, we try to match the description to the format string of the fee type enums. We also only require individual fee matches when we are charging more than one type of fees, which makes the change compatible with most existing use cases where only one fees is charged and the description field is ignored in the extension.

We expect the workflow to be that a registrar sends a domain check, and we reply with exactly what fees we are expecting, and then it will use the descriptions in the response to send us a domain create with the correct fees.

Note that we aggregate fees within the same FeeType together. Normally there will only be one fee per type, but in case of custom logic there could be more than one fee for the same type. There is no way to distinguish them as they both use the same description. So it is simpler to just aggregate them.

This CL also includes some reformatting that conforms to google-java-format output.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=186530316
2018-03-06 18:48:39 -05:00
..
allocate Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
fee Validate individual fee types 2018-03-06 18:48:39 -05:00
fee06 Switch from Guava Optionals to Java 8 Optionals 2017-10-24 16:53:47 -04:00
fee11 Switch from Guava Optionals to Java 8 Optionals 2017-10-24 16:53:47 -04:00
fee12 Switch from Guava Optionals to Java 8 Optionals 2017-10-24 16:53:47 -04:00
launch Add the START_DATE_SUNRISE phase 2018-02-20 15:45:27 -05:00
metadata Format some imports using fix_imports.py 2017-10-24 16:53:47 -04:00
rgp Format some imports using fix_imports.py 2017-10-24 16:53:47 -04:00
secdns Format some imports using fix_imports.py 2017-10-24 16:53:47 -04:00
superuser Add support for a domain delete superuser EPP extension 2017-09-12 15:51:50 -04:00
token Add basic AllocationToken validation/redemption for domain creates 2018-01-19 14:28:26 -05:00
AllocationToken.java Add basic AllocationToken validation/redemption for domain creates 2018-01-19 14:28:26 -05:00
DesignatedContact.java Fix stale documentation on {ForeignKeyed,}DesignatedContact 2017-03-21 15:28:58 -04:00
DomainApplication.java Remove temporary @OnLoad used for setting period in DomainApplication 2017-06-21 09:51:28 -04:00
DomainAuthInfo.java Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
DomainBase.java Replace Stream.concat with Streams.concat 2017-12-27 11:35:47 -05:00
DomainCommand.java Clean up some code quality issues 2017-12-01 22:14:06 -05:00
DomainInfoData.java Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
DomainObjectSpec.java Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
DomainRenewData.java Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
DomainResource.java Remove unnecessary generic type arguments 2017-11-21 18:17:31 -05:00
ForeignKeyedDesignatedContact.java Fix stale documentation on {ForeignKeyed,}DesignatedContact 2017-03-21 15:28:58 -04:00
GracePeriod.java Refer to Datastore everywhere correctly by its capitalized form 2017-02-17 12:12:12 -05:00
LrpTokenEntity.java Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
package-info.java Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
Period.java Format some imports using fix_imports.py 2017-10-24 16:53:47 -04:00