fix order placement error
Some checks failed
Build and Push Backend / docker (push) Failing after 6s
Some checks failed
Build and Push Backend / docker (push) Failing after 6s
This commit is contained in:
@@ -31,6 +31,11 @@ abstract class AbstractOrderPlacementStrategy implements OrderPlacementStrategy
|
|||||||
boolean shouldDeduct = command.isDeductBalance() && service.shouldDeductBalance(context);
|
boolean shouldDeduct = command.isDeductBalance() && service.shouldDeductBalance(context);
|
||||||
if (shouldDeduct) {
|
if (shouldDeduct) {
|
||||||
service.validateSufficientBalance(context.getPurchaserBy(), netAmount);
|
service.validateSufficientBalance(context.getPurchaserBy(), netAmount);
|
||||||
|
}
|
||||||
|
|
||||||
|
PlayOrderInfoEntity order = service.createOrderRecord(context);
|
||||||
|
|
||||||
|
if (shouldDeduct) {
|
||||||
service.deductCustomerBalance(
|
service.deductCustomerBalance(
|
||||||
context.getPurchaserBy(),
|
context.getPurchaserBy(),
|
||||||
netAmount,
|
netAmount,
|
||||||
@@ -38,8 +43,6 @@ abstract class AbstractOrderPlacementStrategy implements OrderPlacementStrategy
|
|||||||
context.getOrderId());
|
context.getOrderId());
|
||||||
}
|
}
|
||||||
|
|
||||||
PlayOrderInfoEntity order = service.createOrderRecord(context);
|
|
||||||
|
|
||||||
OrderAmountBreakdown amountBreakdown =
|
OrderAmountBreakdown amountBreakdown =
|
||||||
breakdown != null ? breakdown : service.fallbackBreakdown(paymentInfo);
|
breakdown != null ? breakdown : service.fallbackBreakdown(paymentInfo);
|
||||||
return OrderPlacementResult.of(order, amountBreakdown);
|
return OrderPlacementResult.of(order, amountBreakdown);
|
||||||
|
|||||||
Reference in New Issue
Block a user