Skip to content

Commit

Permalink
Use start of subscription period as fallback timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
katherine-signal authored Dec 12, 2023
1 parent 07899f3 commit 951f978
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -616,8 +616,8 @@ private CompletableFuture<ReceiptItem> getReceiptForSubscription(InvoiceLineItem
if (invoice.getStatusTransitions().getPaidAt() != null) {
paidAt = Instant.ofEpochSecond(invoice.getStatusTransitions().getPaidAt());
} else {
logger.warn("No paidAt timestamp exists for paid invoice {}, falling back to end of subscription period", invoice.getId());
paidAt = Instant.ofEpochSecond(subscriptionLineItem.getPeriod().getEnd());
logger.warn("No paidAt timestamp exists for paid invoice {}, falling back to start of subscription period", invoice.getId());
paidAt = Instant.ofEpochSecond(subscriptionLineItem.getPeriod().getStart());
}
return getProductForPrice(subscriptionLineItem.getPrice().getId()).thenApply(product -> new ReceiptItem(
subscriptionLineItem.getId(),
Expand Down

0 comments on commit 951f978

Please sign in to comment.