Use start of subscription period as fallback timestamp

This commit is contained in:
Katherine 2023-12-12 11:34:44 -05:00 committed by GitHub
parent 07899f35bd
commit 951f978447
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -616,8 +616,8 @@ public class StripeManager implements SubscriptionProcessorManager {
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(),