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