01: package epayment.commands;
02:
03: import epayment.framework.*;
04:
05: /**
06: * The <code>SaleCommand</code> class is an
07: * <code>AbstractPaymentCommand</code> for authorizing
08: * and capturing a purchase in an
09: * atomic operation.
10: * <p>
11: * This class is strictly an example.
12: *
13: * @author <a href="mailto:mike@clarkware.com">Mike Clark</a>
14: * @author <a href="http://www.clarkware.com">Clarkware Consulting</a>
15: */
16:
17: public class SaleCommand extends AbstractPaymentCommand {
18:
19: /**
20: * Constructs an <code>SaleCommand</code> with
21: * the specified payment request.
22: *
23: * @param request Payment request.
24: */
25: public SaleCommand(IPaymentRequest request) {
26: super (request);
27: }
28:
29: /**
30: * Executes this command using the specified payment
31: * adapter and returns a payment response.
32: *
33: * @param adapter Payment adapter.
34: * @return response Payment response.
35: * @throws PaymentException If an error occurs.
36: */
37: public IPaymentResponse execute(IGatewayAdapter adapter)
38: throws PaymentException {
39:
40: return adapter.sale(getPaymentRequest());
41: }
42: }
|