Slide 6
Slide 6 text
Service interface
public i n t e r f a c e BillingService {
/ * *
* Attempts to charge the order to the c r e d i t card . Both
* successful and f a i l e d transactions w i l l be recorded .
*
* @return a receipt of the transaction . I f the charge was
* successful , the receipt w i l l be successful . Otherwise , the
* receipt w i l l contain a decline note describing why the
* charge f a i l e d .
* /
Receipt chargeOrder ( PizzaOrder order , CreditCard creditCard ) ;
}
Examples taken (and slightly modified) from
http://code.google.com/p/google-guice/wiki/Motivation