KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > epayment > commands > CreditCommand


1 package epayment.commands;
2
3 import epayment.framework.*;
4
5 /**
6  * The <code>CreditCommand</code> class is an
7  * <code>AbstractPaymentCommand</code> for crediting
8  * a previous capture.
9  * <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 CreditCommand extends AbstractPaymentCommand {
17
18     /**
19      * Constructs an <code>CreditCommand</code> with
20      * the specified payment request.
21      *
22      * @param request Payment request.
23      */

24     public CreditCommand(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.credit(getPaymentRequest());
40     }
41 }
42
Popular Tags