Procházet zdrojové kódy

disable account plan for nonpayment

tags/v0.1.6
Jonathan Cobb před 5 roky
rodič
revize
d72ae7c56f
2 změnil soubory, kde provedl 3 přidání a 2 odebrání
  1. +1
    -0
      bubble-server/src/main/java/bubble/service/bill/BillingService.java
  2. +2
    -2
      bubble-server/src/test/resources/models/tests/payment/recurring_billing.json

+ 1
- 0
bubble-server/src/main/java/bubble/service/bill/BillingService.java Zobrazit soubor

@@ -92,6 +92,7 @@ public class BillingService extends SimpleDaemon {
final long unpaidStart = plan.getPeriod().periodMillis(bill.getPeriodStart());
final int unpaidDays = Days.daysBetween(new DateTime(unpaidStart), new DateTime(now())).getDays();
if (unpaidDays > MAX_UNPAID_DAYS_BEFORE_STOP) {
accountPlanDAO.update(accountPlan.setEnabled(false));
final BubbleNetwork network = networkDAO.findByUuid(accountPlan.getNetwork());
try {
networkService.stopNetwork(network);


+ 2
- 2
bubble-server/src/test/resources/models/tests/payment/recurring_billing.json Zobrazit soubor

@@ -431,7 +431,7 @@
"comment": "verify plan is no longer enabled",
"request": { "uri": "me/plans/{{accountPlan.uuid}}" },
"response": {
"check": [ {"condition": "json.getStatus().disabled()"} ]
"check": [ {"condition": "json.disabled()"} ]
}
},

@@ -490,7 +490,7 @@
"comment": "verify plan has been re-enabled",
"request": { "uri": "me/plans/{{accountPlan.uuid}}" },
"response": {
"check": [ {"condition": "json.getStatus().enabled()"} ]
"check": [ {"condition": "json.enabled()"} ]
}
},



Načítá se…
Zrušit
Uložit