From 98c1a8308f26c12e7cd791f734292f6faca7fb1c Mon Sep 17 00:00:00 2001 From: Thibault Duplessis Date: Thu, 14 Jul 2016 19:24:45 +0200 Subject: [PATCH] remove unused paypal.expired field --- modules/plan/src/main/Patron.scala | 1 - modules/plan/src/main/PlanApi.scala | 4 +--- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/modules/plan/src/main/Patron.scala b/modules/plan/src/main/Patron.scala index 341ae258f8..9454a87f5f 100644 --- a/modules/plan/src/main/Patron.scala +++ b/modules/plan/src/main/Patron.scala @@ -46,7 +46,6 @@ object Patron { email: Option[PayPal.Email], subId: Option[PayPal.SubId], lastCharge: DateTime) { - def isExpired = lastCharge isBefore DateTime.now.minusMonths(1) } object PayPal { case class Email(value: String) extends AnyVal diff --git a/modules/plan/src/main/PlanApi.scala b/modules/plan/src/main/PlanApi.scala index b78dd00afa..708849a847 100644 --- a/modules/plan/src/main/PlanApi.scala +++ b/modules/plan/src/main/PlanApi.scala @@ -164,9 +164,7 @@ final class PlanApi( } case (_, Some(paypal)) => - if (paypal.isExpired) - patronColl.update($id(user.id), patron.removePayPal) >> sync(user) - else if (!paypal.isExpired && !user.plan.active) { + if (!user.plan.active) { logger.warn(s"sync: enable plan of customer with paypal") UserRepo.setPlan(user, user.plan.enable) inject ReloadUser }