01: package epayment.framework;
02:
03: /**
04: * The <code>IPaymentCommand</code> interface defines
05: * the common interface for all electronic payment
06: * actions.
07: * <p>
08: * Implementors of this interface encapsulate a payment
09: * request as an object which can be generically
10: * processed by the <code>PaymentProcessor</code>.
11: * The <code>PaymentProcessor</code> is responsible
12: * for installing an appropriate implementation of
13: * an <code>IGatewayAdapter</code>.
14: * <p>
15: * This class is strictly an example.
16: *
17: * @author <a href="mailto:mike@clarkware.com">Mike Clark</a>
18: * @author <a href="http://www.clarkware.com">Clarkware Consulting</a>
19: */
20:
21: public interface IPaymentCommand {
22:
23: /**
24: * Executes this command using the specified payment
25: * adapter and returns a payment response.
26: *
27: * @param adapter Payment adapter.
28: * @return response Payment response.
29: * @throws PaymentException If an error occurs.
30: */
31: public IPaymentResponse execute(IGatewayAdapter adapter)
32: throws PaymentException;
33: }
|