You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by as...@apache.org on 2011/04/08 14:54:33 UTC
svn commit: r1090226 - in /ofbiz/trunk/applications/accounting:
config/payment.properties entitydef/entitymodel.xml
src/org/ofbiz/accounting/thirdparty/authorizedotnet/AIMPaymentServices.java
Author: ashish
Date: Fri Apr 8 12:54:33 2011
New Revision: 1090226
URL: http://svn.apache.org/viewvc?rev=1090226&view=rev
Log:
Bug fix. 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/trunk/applications/accounting/config/payment.properties
ofbiz/trunk/applications/accounting/entitydef/entitymodel.xml
ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/authorizedotnet/AIMPaymentServices.java
Modified: ofbiz/trunk/applications/accounting/config/payment.properties
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/config/payment.properties?rev=1090226&r1=1090225&r2=1090226&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/config/payment.properties (original)
+++ ofbiz/trunk/applications/accounting/config/payment.properties Fri Apr 8 12:54:33 2011
@@ -383,6 +383,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/trunk/applications/accounting/entitydef/entitymodel.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/entitydef/entitymodel.xml?rev=1090226&r1=1090225&r2=1090226&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/entitydef/entitymodel.xml (original)
+++ ofbiz/trunk/applications/accounting/entitydef/entitymodel.xml Fri Apr 8 12:54:33 2011
@@ -3266,6 +3266,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/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/authorizedotnet/AIMPaymentServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/authorizedotnet/AIMPaymentServices.java?rev=1090226&r1=1090225&r2=1090226&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/authorizedotnet/AIMPaymentServices.java (original)
+++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/authorizedotnet/AIMPaymentServices.java Fri Apr 8 12:54:33 2011
@@ -377,6 +377,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";
}
@@ -414,6 +415,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", cc.get("cardType"));
}
@@ -447,6 +449,12 @@ public class AIMPaymentServices {
if (UtilValidate.isNotEmpty(cpVersion)) {
AIMRequest.put("x_cpversion", cpVersion);
}
+
+ // Check duplicateWindow time frame. If same transaction happens in the predefined time frame then return error.
+ String duplicateWindow = props.getProperty("duplicateWindow");
+ if (UtilValidate.isNotEmpty(duplicateWindow)) {
+ AIMRequest.put("x_duplicate_window", props.getProperty("duplicateWindow"));
+ }
// CP market type
String cpMarketType = props.getProperty("cpMarketType");