Просмотр исходного кода

if refund can't be issued because of payment with a promotional credit, log it but don't throw exception

tags/v0.9.0
Jonathan Cobb 4 лет назад
Родитель
Сommit
61ef3b5a63
2 измененных файлов: 10 добавлений и 3 удалений
  1. +9
    -2
      bubble-server/src/main/java/bubble/cloud/payment/PaymentDriverBase.java
  2. +1
    -1
      bubble-web

+ 9
- 2
bubble-server/src/main/java/bubble/cloud/payment/PaymentDriverBase.java Просмотреть файл

@@ -228,8 +228,15 @@ public abstract class PaymentDriverBase<T> extends CloudServiceDriverBase<T> imp

// What payment was used to pay the bill?
if (successfulPayment == null) {
log.warn("refund: AccountPlanPayment not found for paid bill ("+bill.getUuid()+") accountPlan: "+accountPlanUuid);
throw invalidEx("err.refund.paymentNotFound");
// check to see if promotional credit(s) were used, this may be the reason no refund is due
final List<AccountPayment> creditsApplied = accountPaymentDAO.findByAccountAndAccountPlanAndBillAndCreditAppliedSuccess(accountPlan.getAccount(), accountPlanUuid, bill.getUuid());
if (empty(creditsApplied)) {
log.warn("refund: AccountPlanPayment not found for paid bill (" + bill.getUuid() + ") accountPlan: " + accountPlanUuid);
throw invalidEx("err.refund.paymentNotFound");
} else {
log.warn("refund: not refunding bill paid via promotional credits ("+bill.getUuid()+") accountPlan: "+accountPlanUuid);
return false;
}
}

// Is the payment method associated with the bill still active?


+ 1
- 1
bubble-web

@@ -1 +1 @@
Subproject commit b7f7d68eed6d07d35ef2f8f126dc9a7f1624d085
Subproject commit e960f22752267006dd565a82a48f97e1423d13e2

Загрузка…
Отмена
Сохранить