diff --git a/Java/src/main/java/org/codecop/dependencies/c/Checkout.java b/Java/src/main/java/org/codecop/dependencies/c/Checkout.java index feef608..967f625 100644 --- a/Java/src/main/java/org/codecop/dependencies/c/Checkout.java +++ b/Java/src/main/java/org/codecop/dependencies/c/Checkout.java @@ -3,15 +3,20 @@ public class Checkout { public Receipt createReceipt(Money amount) { + Receipt receipt = create(amount); + + store(receipt); + + return receipt; + } + + protected Receipt create(Money amount) { Receipt receipt = new Receipt(); Money vat = amount.percentage(20); receipt.setAmount(amount); receipt.setTax(vat); receipt.setTotal(amount.add(vat)); - - store(receipt); - return receipt; }