com.aoindustries.aoserv.creditcards
Class AOServPersistenceMechanism

java.lang.Object
  extended by com.aoindustries.aoserv.creditcards.AOServPersistenceMechanism
All Implemented Interfaces:
com.aoindustries.creditcards.PersistenceMechanism

public class AOServPersistenceMechanism
extends java.lang.Object
implements com.aoindustries.creditcards.PersistenceMechanism

Stores the information in the AOServ system. The principal sent in to the methods should be an instance of AOServConnectorPrincipal and any group should be a BusinessGroup. All operations will be performed using the connector from the principal, therefore the underlying AOServ security model will apply to these calls.

Author:
AO Industries, Inc.

Method Summary
 void authorizeCompleted(java.security.Principal principal, com.aoindustries.creditcards.Transaction transaction)
          Stores the results of an authorize transaction: authorizationResult status The current status must be PROCESSING.
 void deleteCreditCard(java.security.Principal principal, com.aoindustries.creditcards.CreditCard creditCard)
           
static AOServPersistenceMechanism getInstance()
          Only one instance is necessary since all calls are on the method parameter objects.
 java.lang.String insertTransaction(java.security.Principal principal, java.security.acl.Group group, com.aoindustries.creditcards.Transaction transaction)
           
 void saleCompleted(java.security.Principal principal, com.aoindustries.creditcards.Transaction transaction)
          Stores the results of a sale transaction: authorizationResult captureTime capturePrincipalName captureResult status The current status must be PROCESSING.
 java.lang.String storeCreditCard(java.security.Principal principal, com.aoindustries.creditcards.CreditCard creditCard)
           
 void updateCardNumber(java.security.Principal principal, com.aoindustries.creditcards.CreditCard creditCard, java.lang.String cardNumber, byte expirationMonth, short expirationYear)
           
 void updateExpiration(java.security.Principal principal, com.aoindustries.creditcards.CreditCard creditCard, byte expirationMonth, short expirationYear)
           
 void voidCompleted(java.security.Principal principal, com.aoindustries.creditcards.Transaction transaction)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static AOServPersistenceMechanism getInstance()
Only one instance is necessary since all calls are on the method parameter objects.


storeCreditCard

public java.lang.String storeCreditCard(java.security.Principal principal,
                                        com.aoindustries.creditcards.CreditCard creditCard)
                                 throws java.sql.SQLException
Specified by:
storeCreditCard in interface com.aoindustries.creditcards.PersistenceMechanism
Throws:
java.sql.SQLException

updateCardNumber

public void updateCardNumber(java.security.Principal principal,
                             com.aoindustries.creditcards.CreditCard creditCard,
                             java.lang.String cardNumber,
                             byte expirationMonth,
                             short expirationYear)
                      throws java.sql.SQLException
Specified by:
updateCardNumber in interface com.aoindustries.creditcards.PersistenceMechanism
Throws:
java.sql.SQLException

updateExpiration

public void updateExpiration(java.security.Principal principal,
                             com.aoindustries.creditcards.CreditCard creditCard,
                             byte expirationMonth,
                             short expirationYear)
                      throws java.sql.SQLException
Specified by:
updateExpiration in interface com.aoindustries.creditcards.PersistenceMechanism
Throws:
java.sql.SQLException

deleteCreditCard

public void deleteCreditCard(java.security.Principal principal,
                             com.aoindustries.creditcards.CreditCard creditCard)
                      throws java.sql.SQLException
Specified by:
deleteCreditCard in interface com.aoindustries.creditcards.PersistenceMechanism
Throws:
java.sql.SQLException

insertTransaction

public java.lang.String insertTransaction(java.security.Principal principal,
                                          java.security.acl.Group group,
                                          com.aoindustries.creditcards.Transaction transaction)
                                   throws java.sql.SQLException
Specified by:
insertTransaction in interface com.aoindustries.creditcards.PersistenceMechanism
Throws:
java.sql.SQLException

saleCompleted

public void saleCompleted(java.security.Principal principal,
                          com.aoindustries.creditcards.Transaction transaction)
                   throws java.sql.SQLException
Stores the results of a sale transaction:
  1. authorizationResult
  2. captureTime
  3. capturePrincipalName
  4. captureResult
  5. status
The current status must be PROCESSING.

Specified by:
saleCompleted in interface com.aoindustries.creditcards.PersistenceMechanism
Throws:
java.sql.SQLException

authorizeCompleted

public void authorizeCompleted(java.security.Principal principal,
                               com.aoindustries.creditcards.Transaction transaction)
                        throws java.sql.SQLException
Stores the results of an authorize transaction:
  1. authorizationResult
  2. status
The current status must be PROCESSING.

Specified by:
authorizeCompleted in interface com.aoindustries.creditcards.PersistenceMechanism
Throws:
java.sql.SQLException

voidCompleted

public void voidCompleted(java.security.Principal principal,
                          com.aoindustries.creditcards.Transaction transaction)
                   throws java.sql.SQLException
Specified by:
voidCompleted in interface com.aoindustries.creditcards.PersistenceMechanism
Throws:
java.sql.SQLException