svn commit: r540046 - /ofbiz/branches/release4.0/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r540046 - /ofbiz/branches/release4.0/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java

lektran
Author: lektran
Date: Mon May 21 00:20:46 2007
New Revision: 540046

URL: http://svn.apache.org/viewvc?view=rev&rev=540046
Log:
Applied fix from trunk for revision: 538680

Modified:
    ofbiz/branches/release4.0/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java

Modified: ofbiz/branches/release4.0/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release4.0/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java?view=diff&rev=540046&r1=540045&r2=540046
==============================================================================
--- ofbiz/branches/release4.0/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java (original)
+++ ofbiz/branches/release4.0/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java Mon May 21 00:20:46 2007
@@ -1503,6 +1503,10 @@
 
         String responseId = delegator.getNextSeqId("PaymentGatewayResponse");
         GenericValue response = delegator.makeValue("PaymentGatewayResponse", null);
+        String message = ServiceUtil.getErrorMessage(result);
+        if (message.length() > 255) {
+            message = message.substring(0, 255);
+        }
         response.set("paymentGatewayResponseId", responseId);
         response.set("paymentServiceTypeEnumId", serviceType);
         response.set("orderPaymentPreferenceId", paymentPref.get("orderPaymentPreferenceId"));
@@ -1510,7 +1514,7 @@
         response.set("paymentMethodId", paymentPref.get("paymentMethodId"));
         response.set("transCodeEnumId", transactionCode);
         response.set("referenceNum", "ERROR");
-        response.set("gatewayMessage", ServiceUtil.getErrorMessage(result));
+        response.set("gatewayMessage", message);
         response.set("transactionDate", UtilDateTime.nowTimestamp());
 
         try {
@@ -2507,6 +2511,10 @@
     public static Map savePaymentGatewayResponse(DispatchContext dctx, Map context) {
         GenericDelegator delegator = dctx.getDelegator();
         GenericValue pgr = (GenericValue) context.get("paymentGatewayResponse");
+        String message = pgr.getString("gatewayMessage");
+        if (message.length() > 255) {
+            pgr.set("gatewayMessage", message.substring(0, 255));
+        }
 
         try {
             delegator.create(pgr);