com.konakartadmin.modules.payment.authorizenet
Class AdminPayment

java.lang.Object
  extended by com.konakartadmin.bl.AdminBaseMgr
      extended by com.konakartadmin.modules.payment.AdminBasePayment
          extended by com.konakartadmin.modules.payment.authorizenet.AdminPayment
All Implemented Interfaces:
AdminPaymentIf

public class AdminPayment
extends AdminBasePayment
implements AdminPaymentIf

Class used to communicate with the payment gateway from the admin app


Nested Class Summary
protected  class AdminPayment.ConfigVariables
          Used to store the configuration data of this module
 
Nested classes/interfaces inherited from class com.konakartadmin.modules.payment.AdminBasePayment
AdminBasePayment.AdminPaymentDetails
 
Nested classes/interfaces inherited from class com.konakartadmin.bl.AdminBaseMgr
AdminBaseMgr.StaticData
 
Field Summary
private static java.lang.String approved
           
private static java.lang.String code
           
private static java.lang.String declined
           
private static java.lang.String error
           
protected static org.apache.commons.logging.Log log
          the log
private static java.lang.String MODULE_PAYMENT_AUTHORIZENET_ARB_REQUEST_URL
          The Authorize.Net Url used to POST the Automated Recurring Billing request.
private static java.lang.String MODULE_PAYMENT_AUTHORIZENET_LOGIN
          The Authorize.Net API Login ID for this installation
private static java.lang.String MODULE_PAYMENT_AUTHORIZENET_REQUEST_URL
          The Authorize.Net Url used to POST the payment request.
private static java.lang.String MODULE_PAYMENT_AUTHORIZENET_SHOW_CVV
          To show CVV field
private static java.lang.String MODULE_PAYMENT_AUTHORIZENET_SORT_ORDER
          The order for displaying this payment gateway on the UI
private static java.lang.String MODULE_PAYMENT_AUTHORIZENET_TESTMODE
          Used to make test transactions
private static java.lang.String MODULE_PAYMENT_AUTHORIZENET_TXNKEY
          The Authorize.Net transaction key for this installation
private static java.lang.String MODULE_PAYMENT_AUTHORIZENET_ZONE
          The Authorize.Net zone, if greater than zero, should reference a GeoZone.
private static java.lang.String ORDER_HISTORY_COMMENT_KO
           
private static java.lang.String ORDER_HISTORY_COMMENT_OK
           
private static int respCodePosition
           
private static int respTextPosition
           
private static int RET0
           
private static java.lang.String RET0_DESC
           
private static int RET1
           
private static java.lang.String RET1_DESC
           
private static int RET2
           
private static java.lang.String RET2_DESC
           
private static int txnIdPosition
           
 
Fields inherited from class com.konakartadmin.bl.AdminBaseMgr
adminEng, baseMgrMutex, baseStaticDataHM, cDataEnd, cDataStart, kkConf, kkInstanceId, mgrFactory, STORE_ID, templateBaseDir
 
Constructor Summary
AdminPayment(KKAdminIf eng)
          Constructor
 
Method Summary
protected  com.konakart.app.NameValue[] cancelSubscription(com.konakart.app.PaymentOptions options)
          Method that needs to be implemented to cancel a subscription
protected  com.konakart.app.NameValue[] createSubscription(com.konakart.app.PaymentOptions options)
          This method calls AuthorizeNet to create a subscription.
 com.konakart.app.NameValue[] execute(com.konakart.app.PaymentOptions options)
          This method executes the transaction with the payment gateway.
 AdminPayment.ConfigVariables getConfigVariables()
          Get the configuration variables
private  java.lang.String getRespDesc(int position)
          Authorize.net returns a response as delimiter separated variables.
protected  com.konakart.app.NameValue[] getSubscriptionStatus(com.konakart.app.PaymentOptions options)
          Return the status of a subscription.
private  java.lang.String manageARBGatewayPost(AdminPayment.ConfigVariables configs, ARBAPI api, AdminSubscription kkSubscription, boolean create)
          Common code for all recurring billing requests.
protected  com.konakart.app.NameValue[] updateSubscription(com.konakart.app.PaymentOptions options)
          Method that needs to be implemented to update a subscription
 
Methods inherited from class com.konakartadmin.modules.payment.AdminBasePayment
customizeConnection, getData, getGatewayRequest, postData
 
Methods inherited from class com.konakartadmin.bl.AdminBaseMgr
addInsertAttr, addInsertAttr, checkIntIsSet, checkRequired, getAdminAddressMgr, getAdminAuditMgr, getAdminBillingMgr, getAdminBookableProductMgr, getAdminCatMgr, getAdminConfigMgr, getAdminCurrMgr, getAdminCustMgr, getAdminCustTagMgr, getAdminEmailMgr, getAdminEng, getAdminHtmlMgr, getAdminLanguageMgr, getAdminManuMgr, getAdminMessageMgr, getAdminMiscItemMgr, getAdminModulesMgr, getAdminMultiStoreMgr, getAdminOrderMgr, getAdminPdfMgr, getAdminProdAttrMgr, getAdminProdMgr, getAdminPromMgr, getAdminPublishProdMgr, getAdminReviewMgr, getAdminSearchRuleMgr, getAdminSecMgr, getAdminSolrMgr, getAdminStoreMgr, getAdminTagMgr, getAdminTaxMgr, getAdminValidationMgr, getAdminVelocityContextMgr, getAdminWishListMgr, getBooleanFromString, getExportXMLData, getIntFromString, getKkConfig, getKkInstanceId, getMode, getModeString, getMqMgr, getNewCriteria, getNewCriteria, getPostSearchText, getPreSearchText, getPropertyValue, getRecordCount, getRewardPointMgr, getSingleIntResult, getStoreId, getTemplate, getTemplateBase, getXml_io, init, isConfigSet, isEnterprise, isMultiStoreLanguagesShared, isMultiStoreMode, isMultiStoreShareCategories, isMultiStoreShareCustomers, isMultiStoreShareProducts, isMultiStoreSingleDBCSMode, isMultiStoreSingleDBMode, isMultiStoreSingleDBNonCSMode, manageException, refreshConfigs, removeCData, setAdminEng, setupWildCardRules, setWildCardAfter, setWildCardBefore, shutdownGracefully, shutdownGracefully, timestampStr
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static org.apache.commons.logging.Log log
the log


code

private static java.lang.String code

MODULE_PAYMENT_AUTHORIZENET_ZONE

private static final java.lang.String MODULE_PAYMENT_AUTHORIZENET_ZONE
The Authorize.Net zone, if greater than zero, should reference a GeoZone. If the DeliveryAddress of the order isn't within that GeoZone, then we throw an exception

See Also:
Constant Field Values

MODULE_PAYMENT_AUTHORIZENET_SORT_ORDER

private static final java.lang.String MODULE_PAYMENT_AUTHORIZENET_SORT_ORDER
The order for displaying this payment gateway on the UI

See Also:
Constant Field Values

MODULE_PAYMENT_AUTHORIZENET_REQUEST_URL

private static final java.lang.String MODULE_PAYMENT_AUTHORIZENET_REQUEST_URL
The Authorize.Net Url used to POST the payment request. "https://secure.authorize.net/gateway/transact.dll"

See Also:
Constant Field Values

MODULE_PAYMENT_AUTHORIZENET_ARB_REQUEST_URL

private static final java.lang.String MODULE_PAYMENT_AUTHORIZENET_ARB_REQUEST_URL
The Authorize.Net Url used to POST the Automated Recurring Billing request. "https://apitest.authorize.net/xml/v1/request.api"

See Also:
Constant Field Values

MODULE_PAYMENT_AUTHORIZENET_LOGIN

private static final java.lang.String MODULE_PAYMENT_AUTHORIZENET_LOGIN
The Authorize.Net API Login ID for this installation

See Also:
Constant Field Values

MODULE_PAYMENT_AUTHORIZENET_TXNKEY

private static final java.lang.String MODULE_PAYMENT_AUTHORIZENET_TXNKEY
The Authorize.Net transaction key for this installation

See Also:
Constant Field Values

MODULE_PAYMENT_AUTHORIZENET_TESTMODE

private static final java.lang.String MODULE_PAYMENT_AUTHORIZENET_TESTMODE
Used to make test transactions

See Also:
Constant Field Values

MODULE_PAYMENT_AUTHORIZENET_SHOW_CVV

private static final java.lang.String MODULE_PAYMENT_AUTHORIZENET_SHOW_CVV
To show CVV field

See Also:
Constant Field Values

respCodePosition

private static final int respCodePosition
See Also:
Constant Field Values

respTextPosition

private static final int respTextPosition
See Also:
Constant Field Values

txnIdPosition

private static final int txnIdPosition
See Also:
Constant Field Values

approved

private static final java.lang.String approved
See Also:
Constant Field Values

declined

private static final java.lang.String declined
See Also:
Constant Field Values

error

private static final java.lang.String error
See Also:
Constant Field Values

RET0

private static final int RET0
See Also:
Constant Field Values

RET0_DESC

private static final java.lang.String RET0_DESC
See Also:
Constant Field Values

RET1

private static final int RET1
See Also:
Constant Field Values

RET1_DESC

private static final java.lang.String RET1_DESC
See Also:
Constant Field Values

RET2

private static final int RET2
See Also:
Constant Field Values

RET2_DESC

private static final java.lang.String RET2_DESC
See Also:
Constant Field Values

ORDER_HISTORY_COMMENT_OK

private static final java.lang.String ORDER_HISTORY_COMMENT_OK
See Also:
Constant Field Values

ORDER_HISTORY_COMMENT_KO

private static final java.lang.String ORDER_HISTORY_COMMENT_KO
See Also:
Constant Field Values
Constructor Detail

AdminPayment

public AdminPayment(KKAdminIf eng)
             throws org.apache.torque.TorqueException,
                    com.workingdogs.village.DataSetException,
                    java.lang.Exception
Constructor

Parameters:
eng -
Throws:
java.lang.Exception
com.workingdogs.village.DataSetException
org.apache.torque.TorqueException
Method Detail

execute

public com.konakart.app.NameValue[] execute(com.konakart.app.PaymentOptions options)
                                     throws java.lang.Exception
This method executes the transaction with the payment gateway. The action attribute of the options object instructs the method as to what transaction should be executed. E.g. It could be a payment or a payment confirmation for a transaction that has already been authorized etc.

Specified by:
execute in interface AdminPaymentIf
Parameters:
options -
Returns:
Returns an array of NameValue objects that may contain any return information considered useful by the caller.
Throws:
java.lang.Exception

getConfigVariables

public AdminPayment.ConfigVariables getConfigVariables()
                                                throws org.apache.torque.TorqueException,
                                                       com.workingdogs.village.DataSetException,
                                                       java.lang.Exception
Get the configuration variables

Returns:
Returns an object containing the values of the configuration variables
Throws:
java.lang.Exception
com.workingdogs.village.DataSetException
org.apache.torque.TorqueException

getRespDesc

private java.lang.String getRespDesc(int position)
Authorize.net returns a response as delimiter separated variables. In order to make them readable, we tag each one with a description before saving in the ipnHistory table.

Parameters:
position -
Returns:
Response Description

createSubscription

protected com.konakart.app.NameValue[] createSubscription(com.konakart.app.PaymentOptions options)
                                                   throws java.lang.Exception
This method calls AuthorizeNet to create a subscription. The KK subscription object is updated to include the AuthorizeNet subscription id. All transaction information is stored in the IPN History.

Parameters:
options - PaymentOptions containing information necessary to carry out the transaction
Returns:
Returns an array of NameValue objects
Throws:
java.lang.Exception

updateSubscription

protected com.konakart.app.NameValue[] updateSubscription(com.konakart.app.PaymentOptions options)
                                                   throws java.lang.Exception
Method that needs to be implemented to update a subscription

Parameters:
options -
Returns:
Returns an array of NameValue objects that may contain any return information considered useful by the caller.
Throws:
java.lang.Exception

cancelSubscription

protected com.konakart.app.NameValue[] cancelSubscription(com.konakart.app.PaymentOptions options)
                                                   throws java.lang.Exception
Method that needs to be implemented to cancel a subscription

Parameters:
options -
Returns:
Returns an array of NameValue objects that may contain any return information considered useful by the caller.
Throws:
java.lang.Exception

getSubscriptionStatus

protected com.konakart.app.NameValue[] getSubscriptionStatus(com.konakart.app.PaymentOptions options)
                                                      throws java.lang.Exception
Return the status of a subscription. When active it returns the string "active"

Parameters:
options -
Returns:
Returns an array of NameValue objects that may contain any return information considered useful by the caller.
Throws:
java.lang.Exception

manageARBGatewayPost

private java.lang.String manageARBGatewayPost(AdminPayment.ConfigVariables configs,
                                              ARBAPI api,
                                              AdminSubscription kkSubscription,
                                              boolean create)
                                       throws java.lang.Exception
Common code for all recurring billing requests. Returns the status which is valid for the getSubscriptionStatus() API call.

Parameters:
configs -
api -
Throws:
java.lang.Exception


Copyright © 2011 DS Data Systems UK Ltd.