Allow domain transfers with 0 period and in auto-renew grace period

Normally, if a domain is in the auto-renew grace period, a transfer will cancel the auto-renew billing event. In the event of a transfer with no change to registration end date, the auto-renew billing event should not be cancelled and the gaining registrar should not be charged for the transfer.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=170576726
This commit is contained in:
bbilbo 2017-09-30 01:29:01 -07:00 committed by Ben McIlwain
parent 3c0b17dc6f
commit 7aa5629517
9 changed files with 120 additions and 50 deletions

View file

@ -138,8 +138,15 @@ public final class DomainTransferApproveFlow implements TransactionalFlow {
int extraYears = transferData.getTransferPeriod().getValue();
if (autorenewGrace != null) {
extraYears = 0;
ofy().save().entity(
BillingEvent.Cancellation.forGracePeriod(autorenewGrace, historyEntry, targetId));
// During a normal transfer, if the domain is in the auto-renew grace period, the auto-renew
// billing event is cancelled and the gaining registrar is charged for the one year renewal.
// But, if the superuser extension is used to request a transfer without an additional year
// then the gaining registrar is not charged for the one year renewal and the losing registrar
// still needs to be charged for the auto-renew.
if (billingEvent.isPresent()) {
ofy().save().entity(
BillingEvent.Cancellation.forGracePeriod(autorenewGrace, historyEntry, targetId));
}
}
// Close the old autorenew event and poll message at the transfer time (aka now). This may end
// up deleting the poll message.