The examples were written using the infix notation but you can just use regular method calls. For example:
val price = Money.of(100, "USD")
val shipping = Money.of(5, "USD")
val subtotal = price.plus(shipping)
val discount = Percentage.of(10)
val total = subtotal.decreaseBy(discount)
total.allocate(2)
total.allocate(60.percent(), 40.percent())
The examples were written using the infix notation but you can just use regular method calls. For example:
val price = Money.of(100, "USD")
val shipping = Money.of(5, "USD")
val subtotal = price.plus(shipping)
val discount = Percentage.of(10)
val total = subtotal.decreaseBy(discount)
total.allocate(2)
total.allocate(60.percent(), 40.percent())