fix order placement error
Some checks failed
Build and Push Backend / docker (push) Failing after 6s

This commit is contained in:
irving
2025-11-02 21:51:08 -05:00
parent c463179e83
commit 7443c33d7a

View File

@@ -31,6 +31,11 @@ abstract class AbstractOrderPlacementStrategy implements OrderPlacementStrategy
boolean shouldDeduct = command.isDeductBalance() && service.shouldDeductBalance(context);
if (shouldDeduct) {
service.validateSufficientBalance(context.getPurchaserBy(), netAmount);
}
PlayOrderInfoEntity order = service.createOrderRecord(context);
if (shouldDeduct) {
service.deductCustomerBalance(
context.getPurchaserBy(),
netAmount,
@@ -38,8 +43,6 @@ abstract class AbstractOrderPlacementStrategy implements OrderPlacementStrategy
context.getOrderId());
}
PlayOrderInfoEntity order = service.createOrderRecord(context);
OrderAmountBreakdown amountBreakdown =
breakdown != null ? breakdown : service.fallbackBreakdown(paymentInfo);
return OrderPlacementResult.of(order, amountBreakdown);