Author: ashish
Date: Fri Apr 8 13:01:50 2011 New Revision: 1090228 URL: http://svn.apache.org/viewvc?rev=1090228&view=rev Log: Bug fix(Hand merged changes from trunk r1090226). Adding support of x_duplicate_window that will help us not to see any duplicate authorization that can occur with customer in the predefined time limit. The time limit for this duplicate window is 120(2 minutes) - 28800 (8 hours). For more details please refer Authorize.net developer guide - Here is the screenshot for direct reference - http://oi55.tinypic.com/2ziah51.jpg. We have made this settings configurable so anyone can enable it if they are facing this issue on production instance. Modified: ofbiz/branches/release10.04/applications/accounting/config/payment.properties ofbiz/branches/release10.04/applications/accounting/entitydef/entitymodel.xml ofbiz/branches/release10.04/applications/accounting/src/org/ofbiz/accounting/thirdparty/authorizedotnet/AIMPaymentServices.java Modified: ofbiz/branches/release10.04/applications/accounting/config/payment.properties URL: http://svn.apache.org/viewvc/ofbiz/branches/release10.04/applications/accounting/config/payment.properties?rev=1090228&r1=1090227&r2=1090228&view=diff ============================================================================== --- ofbiz/branches/release10.04/applications/accounting/config/payment.properties (original) +++ ofbiz/branches/release10.04/applications/accounting/config/payment.properties Fri Apr 8 13:01:50 2011 @@ -377,6 +377,9 @@ payment.authorizedotnet.password= # Default Transaction Description payment.authorizedotnet.transdescription=OFBizAuthNet +# Default Duplicate Window - Check the duplicate transaction in the specified time duration which is specified in seconds. If found in the defined time limit then return error. +payment.authorizedotnet.duplicatewindow=120 + # For testing authorize.net, set the properties # payment.authorizedotnet.url=https://certification.authorize.net/gateway/transact.dll # payment.authorizedotnet.test=TRUE Modified: ofbiz/branches/release10.04/applications/accounting/entitydef/entitymodel.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/release10.04/applications/accounting/entitydef/entitymodel.xml?rev=1090228&r1=1090227&r2=1090228&view=diff ============================================================================== --- ofbiz/branches/release10.04/applications/accounting/entitydef/entitymodel.xml (original) +++ ofbiz/branches/release10.04/applications/accounting/entitydef/entitymodel.xml Fri Apr 8 13:01:50 2011 @@ -3251,6 +3251,7 @@ under the License. <field name="userId" type="value"><description>Username - your authorize.net userid</description></field> <field name="pwd" type="value" encrypt="true"><description>Password - your authorize.net password</description></field> <field name="transDescription" type="value"><description>Default Transaction Description</description></field> + <field name="duplicateWindow" type="numeric"><description>Check the duplicate transaction in the specified time duration which is specified in seconds. If duplicate transaction occurs in the defined time limit then return error.</description></field> <prim-key field="paymentGatewayConfigId"/> <relation type="one" fk-name="PGAN_PGC" rel-entity-name="PaymentGatewayConfig"> <key-map field-name="paymentGatewayConfigId"/> Modified: ofbiz/branches/release10.04/applications/accounting/src/org/ofbiz/accounting/thirdparty/authorizedotnet/AIMPaymentServices.java URL: http://svn.apache.org/viewvc/ofbiz/branches/release10.04/applications/accounting/src/org/ofbiz/accounting/thirdparty/authorizedotnet/AIMPaymentServices.java?rev=1090228&r1=1090227&r2=1090228&view=diff ============================================================================== --- ofbiz/branches/release10.04/applications/accounting/src/org/ofbiz/accounting/thirdparty/authorizedotnet/AIMPaymentServices.java (original) +++ ofbiz/branches/release10.04/applications/accounting/src/org/ofbiz/accounting/thirdparty/authorizedotnet/AIMPaymentServices.java Fri Apr 8 13:01:50 2011 @@ -354,6 +354,7 @@ public class AIMPaymentServices { String login = getPaymentGatewayConfigValue(delegator, paymentGatewayConfigId, "userId", configStr, "payment.authorizedotnet.login"); String password = getPaymentGatewayConfigValue(delegator, paymentGatewayConfigId, "pwd", configStr, "payment.authorizedotnet.password"); String transDescription = getPaymentGatewayConfigValue(delegator, paymentGatewayConfigId, "transDescription", configStr, "payment.authorizedotnet.transdescription"); + String duplicateWindow = getPaymentGatewayConfigValue(delegator, paymentGatewayConfigId, "duplicateWindow", configStr, "payment.authorizedotnet.duplicateWindow"); if (UtilValidate.isEmpty(ver)) { ver = "3.0"; } @@ -384,6 +385,7 @@ public class AIMPaymentServices { props.put("login", login); props.put("password", password); props.put("trankey", tranKey); + props.put("duplicateWindow", duplicateWindow); if (cc != null) { props.put("cardtype", (String)cc.get("cardType")); } @@ -404,6 +406,10 @@ public class AIMPaymentServices { } AIMRequest.put("x_Password",props.getProperty("password")); AIMRequest.put("x_Version", props.getProperty("ver")); + String duplicateWindow = props.getProperty("duplicateWindow"); + if (UtilValidate.isNotEmpty(duplicateWindow)) { + AIMRequest.put("x_duplicate_window", props.getProperty("duplicateWindow")); + } } private static void buildGatewayResponeConfig(Map<String, Object> params, Properties props, Map<String, Object> AIMRequest) { |
Free forum by Nabble | Edit this page |