1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
|
package epayment.framework;
/**
* The <code>IGatewayAdapter</code> interface defines
* the common interface for all electronic payment
* gateways.
* <p>
* Implementors of this interface serve as interface
* adapters to vendor-specific payment gateways.
* <p>
* This class is strictly an example.
*
* @author <a href="mailto:mike@clarkware.com">Mike Clark</a>
* @author <a href="http://www.clarkware.com">Clarkware Consulting</a>
*/
public interface IGatewayAdapter {
/**
* Sets the payment gateway host.
*
* @param host Gateway host.
*/
public void setHost(String host);
/**
* Performs an authorizes for the specified payment request
* information and returns a payment response.
*
* @param request Payment request.
* @return Payment response.
* @throws PaymentException If an error occurs.
*/
public IPaymentResponse authorize(IPaymentRequest request)
throws PaymentException;
/**
* Performs a capture for the specified payment request
* information and returns a payment response.
*
* @param request Payment request.
* @return Payment response.
* @throws PaymentException If an error occurs.
*/
public IPaymentResponse capture(IPaymentRequest request)
throws PaymentException;
/**
* Performs a sale (authorize and capture) for the specified
* payment request information and returns a payment response.
*
* @param request Payment request.
* @return Payment response.
* @throws PaymentException If an error occurs.
*/
public IPaymentResponse sale(IPaymentRequest request)
throws PaymentException;
/**
* Performs a credit for the specified payment request
* information and returns a payment response.
*
* @param request Payment request.
* @return Payment response.
* @throws PaymentException If an error occurs.
*/
public IPaymentResponse credit(IPaymentRequest request)
throws PaymentException;
/**
* Performs a void for the specified payment request
* information and returns a payment response.
*
* @param request Payment request.
* @return Payment response.
* @throws PaymentException If an error occurs.
*/
public IPaymentResponse voidSale(IPaymentRequest request)
throws PaymentException;
}
|