01: package epayment.commands;
02:
03: import epayment.framework.*;
04:
05: /**
06: * The <code>CaptureCommand</code> class is an
07: * <code>AbstractPaymentCommand</code> for capturing
08: * a previously authorized amount.
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 CaptureCommand extends AbstractPaymentCommand {
17:
18: /**
19: * Constructs an <code>CaptureCommand</code> with
20: * the specified payment request.
21: *
22: * @param request Payment request.
23: */
24: public CaptureCommand(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.capture(getPaymentRequest());
40: }
41: }
|