Skip to content
This repository has been archived by the owner on Feb 19, 2025. It is now read-only.

Commit

Permalink
fix: assert order is paid before fulfill
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanfallet committed Feb 25, 2024
1 parent 5005903 commit 21a2a06
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class UpdateStripeOrderUseCase(
// Here we actually update the order
if (!repository.update(input1, input2, input3)) return null
val updatedOrder = repository.get(input1, input3) ?: return null
if (updatedOrder.paidAt == null) return updatedOrder // We stop here if the order is not paid

// Create items to fulfill the order
updatedOrder.items.forEach {
Expand Down

0 comments on commit 21a2a06

Please sign in to comment.