atg.integrations.payflowpro
Class PayFlowProConnection

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.integrations.payflowpro.PayFlowProConnection
All Implemented Interfaces:
NameContextBindingListener, NameContextElement, NameResolver, AdminableService, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, CreditCardProcessor, atg.payment.creditcard.DecreaseCreditCardAuthorizationProcessor, java.util.EventListener

public class PayFlowProConnection
extends GenericService
implements CreditCardProcessor, atg.payment.creditcard.DecreaseCreditCardAuthorizationProcessor

PayFlowProConnection This is the main class for the Pay Flow Pro server connection.


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
static java.lang.String M_AMPERSAND
           
static java.lang.String M_AVS_MATCH
           
static java.lang.String M_AVS_NOMATCH
           
static java.lang.String M_AVS_NOT_SUPPORTED
           
static java.lang.String M_EQUALS
           
static java.lang.String M_MESSAGE_CLIENT_STARTED
           
static java.lang.String M_MESSAGE_CLIENT_STOPPED
           
static java.lang.String M_MESSAGE_FIELD_NULL
           
static java.lang.String M_MESSAGE_NO_AVS_RESPONSE
           
static java.lang.String M_MESSAGE_NO_VALID_RESPONSE
           
static java.lang.String M_MESSAGE_TRANSACTION_FAILED
           
static java.lang.String M_PARAM_AMOUNT
           
static java.lang.String M_PARAM_AVS_ADDRESS_MATCH
           
static java.lang.String M_PARAM_AVS_ZIP_MATCH
           
static java.lang.String M_PARAM_CREDIT_CARD_NUMBER
           
static java.lang.String M_PARAM_EXPIRATION_DATE
           
static java.lang.String M_PARAM_NAME
           
static java.lang.String M_PARAM_ORIGINATOR_ID
           
static java.lang.String M_PARAM_PARTNER
           
static java.lang.String M_PARAM_PASSWORD
           
static java.lang.String M_PARAM_PAYMENT_REFERENCE
           
static java.lang.String M_PARAM_RESPONSE_MESSAGE
           
static java.lang.String M_PARAM_RESULT
           
static java.lang.String M_PARAM_STREET
           
static java.lang.String M_PARAM_TENDER
           
static java.lang.String M_PARAM_TENDER_CREDIT_CARD
           
static java.lang.String M_PARAM_TRANSACTION_TYPE
           
static java.lang.String M_PARAM_TRANSACTION_TYPE_AUTHORIZATION
           
static java.lang.String M_PARAM_TRANSACTION_TYPE_CREDIT
           
static java.lang.String M_PARAM_TRANSACTION_TYPE_DELAYED_CAPTURE
           
static java.lang.String M_PARAM_USER
           
static java.lang.String M_PARAM_VENDOR
           
static java.lang.String M_PARAM_ZIP
           
static java.lang.String M_SPACE
           
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging
DEFAULT_LOG_TRACE_STATUS
 
Fields inherited from interface atg.nucleus.logging.ApplicationLogging
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
 
Constructor Summary
PayFlowProConnection()
          Constructor.
 
Method Summary
 CreditCardStatus authorize(CreditCardInfo creditCardInfo)
          authorize Authorize the amount on the credit card
 float convertToUSD(float amount, java.lang.String currency)
          convertToUSD This function is used to convert from non USD currency to USD currency.
 java.lang.String createParameterList(CreditCardInfo creditCardInfo, CreditCardStatus creditCardStatus, java.lang.String transactionType)
          createParameterList Creates the parameter list for presentation to the Verisign Payment Server.
 CreditCardStatus credit(CreditCardInfo creditCardInfo)
          credit Credit when no previous debit exists (a new order)
 CreditCardStatus credit(CreditCardInfo creditCardInfo, CreditCardStatus creditCardStatus)
          credit Credit after the capture (previous debit) was processed
 CreditCardStatus debit(CreditCardInfo creditCardInfo, CreditCardStatus creditCardStatus)
          debit Capture the amount after the authorization was processed
 CreditCardStatus decreaseAuthorization(CreditCardInfo pCreditCardInfo, PaymentStatus pAuthStatus)
          Decreases the authorized amount for the credit card.
 void doStartService()
          doStartService Initialize data structures when service is started.
 void doStopService()
          doStopService Release resources when service is stopped.
 java.lang.String getHostAddress()
          getHostAddress
 int getHostPort()
          getHostPort
 java.lang.String getPartner()
          getPartner
 java.lang.String getPassword()
          getPassword
 java.lang.String getProxyAddress()
          getProxyAddress
 java.lang.String getProxyLogon()
          getProxyLogon
 java.lang.String getProxyPassword()
          getProxyPassword
 int getProxyPort()
          getProxyPort
 int getTimeout()
          getTimeout
 java.lang.String getUser()
          getUser
 java.lang.String getVendor()
          getVendor
static void main(java.lang.String[] args)
          main
 PayFlowProStatus processExceptionMessage(java.lang.String exceptionMessage, double amount)
          processExceptionMessage Create a PayFlowProStatus object from the internal exception.
 PayFlowProStatus processTransactionResponse(java.lang.String responseParameterList, double amount)
          processTransactionResponse Parse the transaction response.
 void setHostAddress(java.lang.String hostAddress)
          setHostAddress
 void setHostPort(int hostPort)
          setHostPort
 void setPartner(java.lang.String partner)
          setPartner
 void setPassword(java.lang.String password)
          setPassword
 void setProxyAddress(java.lang.String proxyAddress)
          setProxyAddress
 void setProxyLogon(java.lang.String proxyLogon)
          setProxyLogon
 void setProxyPassword(java.lang.String proxyPassword)
          setProxyPassword
 void setProxyPort(int proxyPort)
          setProxyPort
 void setTimeout(int timeout)
          setTimeout
 void setUser(java.lang.String user)
          setUser
 void setVendor(java.lang.String vendor)
          setVendor
 java.lang.String toString()
          toString
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, getAbsoluteName, getAdminServlet, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string


M_PARAM_TRANSACTION_TYPE

public static java.lang.String M_PARAM_TRANSACTION_TYPE

M_PARAM_TENDER

public static java.lang.String M_PARAM_TENDER

M_PARAM_PARTNER

public static java.lang.String M_PARAM_PARTNER

M_PARAM_VENDOR

public static java.lang.String M_PARAM_VENDOR

M_PARAM_USER

public static java.lang.String M_PARAM_USER

M_PARAM_PASSWORD

public static java.lang.String M_PARAM_PASSWORD

M_PARAM_TENDER_CREDIT_CARD

public static java.lang.String M_PARAM_TENDER_CREDIT_CARD

M_PARAM_TRANSACTION_TYPE_CREDIT

public static java.lang.String M_PARAM_TRANSACTION_TYPE_CREDIT

M_PARAM_TRANSACTION_TYPE_AUTHORIZATION

public static java.lang.String M_PARAM_TRANSACTION_TYPE_AUTHORIZATION

M_PARAM_TRANSACTION_TYPE_DELAYED_CAPTURE

public static java.lang.String M_PARAM_TRANSACTION_TYPE_DELAYED_CAPTURE

M_PARAM_ORIGINATOR_ID

public static java.lang.String M_PARAM_ORIGINATOR_ID

M_PARAM_AMOUNT

public static java.lang.String M_PARAM_AMOUNT

M_PARAM_CREDIT_CARD_NUMBER

public static java.lang.String M_PARAM_CREDIT_CARD_NUMBER

M_PARAM_EXPIRATION_DATE

public static java.lang.String M_PARAM_EXPIRATION_DATE

M_PARAM_NAME

public static java.lang.String M_PARAM_NAME

M_PARAM_STREET

public static java.lang.String M_PARAM_STREET

M_PARAM_ZIP

public static java.lang.String M_PARAM_ZIP

M_AMPERSAND

public static java.lang.String M_AMPERSAND

M_EQUALS

public static java.lang.String M_EQUALS

M_SPACE

public static java.lang.String M_SPACE

M_PARAM_RESULT

public static java.lang.String M_PARAM_RESULT

M_PARAM_PAYMENT_REFERENCE

public static java.lang.String M_PARAM_PAYMENT_REFERENCE

M_PARAM_RESPONSE_MESSAGE

public static java.lang.String M_PARAM_RESPONSE_MESSAGE

M_PARAM_AVS_ADDRESS_MATCH

public static java.lang.String M_PARAM_AVS_ADDRESS_MATCH

M_PARAM_AVS_ZIP_MATCH

public static java.lang.String M_PARAM_AVS_ZIP_MATCH

M_AVS_MATCH

public static java.lang.String M_AVS_MATCH

M_AVS_NOMATCH

public static java.lang.String M_AVS_NOMATCH

M_AVS_NOT_SUPPORTED

public static java.lang.String M_AVS_NOT_SUPPORTED

M_MESSAGE_TRANSACTION_FAILED

public static java.lang.String M_MESSAGE_TRANSACTION_FAILED

M_MESSAGE_FIELD_NULL

public static java.lang.String M_MESSAGE_FIELD_NULL

M_MESSAGE_NO_VALID_RESPONSE

public static java.lang.String M_MESSAGE_NO_VALID_RESPONSE

M_MESSAGE_NO_AVS_RESPONSE

public static java.lang.String M_MESSAGE_NO_AVS_RESPONSE

M_MESSAGE_CLIENT_STARTED

public static java.lang.String M_MESSAGE_CLIENT_STARTED

M_MESSAGE_CLIENT_STOPPED

public static java.lang.String M_MESSAGE_CLIENT_STOPPED
Constructor Detail

PayFlowProConnection

public PayFlowProConnection()
Constructor.

Method Detail

doStartService

public void doStartService()
                    throws ServiceException
doStartService Initialize data structures when service is started.

Overrides:
doStartService in class GenericService
Throws:
ServiceException - if something went wrong

doStopService

public void doStopService()
                   throws ServiceException
doStopService Release resources when service is stopped.

Overrides:
doStopService in class GenericService
Throws:
ServiceException - if something went wrong

authorize

public CreditCardStatus authorize(CreditCardInfo creditCardInfo)
authorize Authorize the amount on the credit card

Specified by:
authorize in interface CreditCardProcessor
Parameters:
creditCardInfo - The credit card data and customer information
Returns:
The credit card status object with the results of this request

debit

public CreditCardStatus debit(CreditCardInfo creditCardInfo,
                              CreditCardStatus creditCardStatus)
debit Capture the amount after the authorization was processed

Specified by:
debit in interface CreditCardProcessor
Parameters:
creditCardInfo - The credit card data and customer information
creditCardStatus - The status object from a previous authorization call
Returns:
The credit card status object with the results of this request

credit

public CreditCardStatus credit(CreditCardInfo creditCardInfo,
                               CreditCardStatus creditCardStatus)
credit Credit after the capture (previous debit) was processed

Specified by:
credit in interface CreditCardProcessor
Parameters:
creditCardInfo - The credit card data and customer information
creditCardStatus - The status object from a previous billing call
Returns:
The credit card status object with the results of this request

credit

public CreditCardStatus credit(CreditCardInfo creditCardInfo)
credit Credit when no previous debit exists (a new order)

Specified by:
credit in interface CreditCardProcessor
Parameters:
creditCardInfo - The credit card data and customer information
Returns:
The credit card status object with the results of this request

createParameterList

public java.lang.String createParameterList(CreditCardInfo creditCardInfo,
                                            CreditCardStatus creditCardStatus,
                                            java.lang.String transactionType)
                                     throws PayFlowProException
createParameterList Creates the parameter list for presentation to the Verisign Payment Server.

Parameters:
creditCardInfo - The credit card data and customer information.
Returns:
The parameter list.
Throws:
PayFlowProException

processExceptionMessage

public PayFlowProStatus processExceptionMessage(java.lang.String exceptionMessage,
                                                double amount)
processExceptionMessage Create a PayFlowProStatus object from the internal exception.

Parameters:
exceptionMessage - The internal exception message.
amount - The amount of the transaction.
Returns:
A PayFlowProStatus object filled with an error message.

processTransactionResponse

public PayFlowProStatus processTransactionResponse(java.lang.String responseParameterList,
                                                   double amount)
                                            throws PayFlowProException
processTransactionResponse Parse the transaction response.

Parameters:
responseParameterList - The list of parameters returned from the Verisign Payment Server
Returns:
A PayFlowProStatus object.
Throws:
PayFlowProException

getPartner

public java.lang.String getPartner()
getPartner

Returns:
the value for Partner.

setPartner

public void setPartner(java.lang.String partner)
setPartner

Parameters:
the - new value for Partner.

getVendor

public java.lang.String getVendor()
getVendor

Returns:
the value for Vendor.

setVendor

public void setVendor(java.lang.String vendor)
setVendor

Parameters:
the - new value for Vendor.

getUser

public java.lang.String getUser()
getUser

Returns:
the value for Partner.

setUser

public void setUser(java.lang.String user)
setUser

Parameters:
the - new value for User.

getPassword

public java.lang.String getPassword()
getPassword

Returns:
the value for Partner.

setPassword

public void setPassword(java.lang.String password)
setPassword

Parameters:
the - new value for Password.

getHostAddress

public java.lang.String getHostAddress()
getHostAddress

Returns:
the value for Partner.

setHostAddress

public void setHostAddress(java.lang.String hostAddress)
setHostAddress

Parameters:
the - new value for Host Address.

getHostPort

public int getHostPort()
getHostPort

Returns:
the value for Host Port.

setHostPort

public void setHostPort(int hostPort)
setHostPort

Parameters:
the - new value for Host Port

getTimeout

public int getTimeout()
getTimeout

Returns:
the value for Timeout.

setTimeout

public void setTimeout(int timeout)
setTimeout

Parameters:
the - new value for Timeout.

getProxyAddress

public java.lang.String getProxyAddress()
getProxyAddress

Returns:
the value for Partner.

setProxyAddress

public void setProxyAddress(java.lang.String proxyAddress)
setProxyAddress

Parameters:
the - new value for Proxy Address.

getProxyPort

public int getProxyPort()
getProxyPort

Returns:
the value for Partner.

setProxyPort

public void setProxyPort(int proxyPort)
setProxyPort

Parameters:
the - new value for Proxy Port.

getProxyLogon

public java.lang.String getProxyLogon()
getProxyLogon

Returns:
the value for Partner.

setProxyLogon

public void setProxyLogon(java.lang.String proxyLogon)
setProxyLogon

Parameters:
the - new value for Proxy Logon.

getProxyPassword

public java.lang.String getProxyPassword()
getProxyPassword

Returns:
the value for Partner.

setProxyPassword

public void setProxyPassword(java.lang.String proxyPassword)
setProxyPassword

Parameters:
the - new value for Proxy Password.

convertToUSD

public float convertToUSD(float amount,
                          java.lang.String currency)
convertToUSD This function is used to convert from non USD currency to USD currency. This is needed if DCS is running in a non-USD currency and using a non-USD locale.

Parameters:
amount - The amount of the transaction.
currency - The currency code of the transaction.
Returns:
The amount converted to USD representation. This currently returns what was passed in.

This currently is a dummy call, which returns what is passed in. The user needs to override this.


toString

public java.lang.String toString()
toString

Overrides:
toString in class java.lang.Object
Returns:
string value for object.

decreaseAuthorization

public CreditCardStatus decreaseAuthorization(CreditCardInfo pCreditCardInfo,
                                              PaymentStatus pAuthStatus)
Decreases the authorized amount for the credit card.

This implementation does nothing but return a successful CreditCardStatus object.

Extend this method to do any payflow credit card specific processing.

Specified by:
decreaseAuthorization in interface atg.payment.creditcard.DecreaseCreditCardAuthorizationProcessor
Parameters:
pCreditCardInfo - the CreditCardInfo reference which contains all the credit data
Returns:
a CreditCardStatus object detailing the results of the decrease

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
main

Parameters:
args - the method arguments
Throws:
java.lang.Exception