org.starhope.appius.pay.util
Interface PaymentGatewayReal

All Known Implementing Classes:
AuthorizeNetGateway, IBCGateway, PaymentGateway, PayPalGateway

public interface PaymentGatewayReal

Author:
brpocock

Method Summary
 void alterEnrolment(Payment payment, UserEnrolment newForm)
           
 void endEnrolment(Payment payment)
           
 List<CredentialType> enumerateCredentialTypes()
          Provides a list of all credential types supported by the given payment gateway.
 Payment getPayment(BigDecimal bigDecimal)
           Get the status of a prior transaction from the gateway.
 boolean isAvailable()
           
 void startEnrolment(Payment payment)
           
 void startTransaction(Payment payment)
           
 void transactPayment(Payment payment)
           
 

Method Detail

alterEnrolment

void alterEnrolment(Payment payment,
                    UserEnrolment newForm)
                    throws UnsupportedCurrencyException,
                           NotFoundException,
                           UnsupportedCredentialException,
                           IOException,
                           RetryPaymentException,
                           GameLogicException
Parameters:
payment - WRITEME
newForm - WRITEME
Throws:
UnsupportedCurrencyException - WRITEME
NotFoundException - WRITEME
UnsupportedCredentialException - WRITEME
IOException - WRITEME
RetryPaymentException - WRITEME
GameLogicException - WRITEME

endEnrolment

void endEnrolment(Payment payment)
                  throws UnsupportedCurrencyException,
                         NotFoundException,
                         UnsupportedCredentialException,
                         IOException,
                         RetryPaymentException,
                         GameLogicException
Parameters:
payment - WRITEME
Throws:
UnsupportedCurrencyException - WRITEME
NotFoundException - WRITEME
UnsupportedCredentialException - WRITEME
IOException - WRITEME
RetryPaymentException - WRITEME
GameLogicException - WRITEME

enumerateCredentialTypes

List<CredentialType> enumerateCredentialTypes()
Provides a list of all credential types supported by the given payment gateway.

Returns:
all supported CredentialType:s

getPayment

Payment getPayment(BigDecimal bigDecimal)

Get the status of a prior transaction from the gateway. This method should not be based upon our internal database.

It is not necessary for every gateway to provide details of failed transactions. If possible, however, they should be returned as well.

It is an implementation requirement that all successful transactions must return valid results information. An auditing subsystem (TODO) should validate this information on a periodic basis (say, weekly?) against our internal database to ensure conformance.

Parameters:
bigDecimal - The identifier used by the implementing payment gateway to uniquely identify the transaction in question.
Returns:
the results information available about that transaction

isAvailable

boolean isAvailable()
Returns:
true, if the payment gateway appears to be online and functioning (or was known to be online and functioning recently enough)

startEnrolment

void startEnrolment(Payment payment)
                    throws UnsupportedCurrencyException,
                           NotFoundException,
                           UnsupportedCredentialException,
                           IOException,
                           RetryPaymentException,
                           GameLogicException,
                           AlreadyUsedException
Parameters:
payment - WRITEME
Throws:
UnsupportedCurrencyException - WRITEME
NotFoundException - WRITEME
UnsupportedCredentialException - WRITEME
IOException - WRITEME
RetryPaymentException - WRITEME
GameLogicException - WRITEME
AlreadyUsedException - WRITEME

startTransaction

void startTransaction(Payment payment)
                      throws UnsupportedCurrencyException,
                             NotFoundException,
                             UnsupportedCredentialException,
                             IOException,
                             RetryPaymentException,
                             GameLogicException,
                             AlreadyUsedException,
                             DataException
Parameters:
payment - WRITEME
Throws:
UnsupportedCurrencyException - WRITEME
NotFoundException - WRITEME
UnsupportedCredentialException - WRITEME
IOException - WRITEME
RetryPaymentException - WRITEME
GameLogicException - WRITEME
AlreadyUsedException - WRITEME
DataException - WRITEME

transactPayment

void transactPayment(Payment payment)
                     throws UnsupportedCurrencyException,
                            NotFoundException,
                            UnsupportedCredentialException,
                            IOException,
                            RetryPaymentException,
                            GameLogicException,
                            AlreadyUsedException,
                            DataException
Parameters:
payment - WRITEME
Throws:
UnsupportedCurrencyException - WRITEME
NotFoundException - WRITEME
UnsupportedCredentialException - WRITEME
IOException - WRITEME
RetryPaymentException - WRITEME
GameLogicException - WRITEME
AlreadyUsedException - WRITEME
DataException - WRITEME