You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by le...@apache.org on 2010/06/12 00:33:13 UTC
svn commit: r953894 -
/ofbiz/branches/release10.04/applications/accounting/src/org/ofbiz/accounting/thirdparty/paypal/PayPalServices.java
Author: lektran
Date: Fri Jun 11 22:33:12 2010
New Revision: 953894
URL: http://svn.apache.org/viewvc?rev=953894&view=rev
Log:
Merged from trunk r953889:
Fix bug where the service's responseMessage was being used to return error messages instead of the proper payment gateway parameters
Modified:
ofbiz/branches/release10.04/applications/accounting/src/org/ofbiz/accounting/thirdparty/paypal/PayPalServices.java
Modified: ofbiz/branches/release10.04/applications/accounting/src/org/ofbiz/accounting/thirdparty/paypal/PayPalServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release10.04/applications/accounting/src/org/ofbiz/accounting/thirdparty/paypal/PayPalServices.java?rev=953894&r1=953893&r2=953894&view=diff
==============================================================================
--- ofbiz/branches/release10.04/applications/accounting/src/org/ofbiz/accounting/thirdparty/paypal/PayPalServices.java (original)
+++ ofbiz/branches/release10.04/applications/accounting/src/org/ofbiz/accounting/thirdparty/paypal/PayPalServices.java Fri Jun 11 22:33:12 2010
@@ -775,9 +775,11 @@ public class PayPalServices {
result.put("authRefNum", "N/A");
result.put("processAmount", BigDecimal.ZERO);
if (errors.size() == 1) {
- result.put("responseMessage", errors.get(0));
+ Map.Entry<String, String> error = errors.entrySet().iterator().next();
+ result.put("authCode", error.getKey());
+ result.put("authMessage", error.getValue());
} else {
- result.put("responseMessage", "Multiple errors occurred, please refer to the gateway response messages");
+ result.put("authMessage", "Multiple errors occurred, please refer to the gateway response messages");
result.put("internalRespMsgs", errors);
}
} else {
@@ -824,9 +826,11 @@ public class PayPalServices {
result.put("captureRefNum", "N/A");
result.put("captureAmount", BigDecimal.ZERO);
if (errors.size() == 1) {
- result.put("responseMessage", errors.get(0));
+ Map.Entry<String, String> error = errors.entrySet().iterator().next();
+ result.put("captureCode", error.getKey());
+ result.put("captureMessage", error.getValue());
} else {
- result.put("responseMessage", "Multiple errors occurred, please refer to the gateway response messages");
+ result.put("captureMessage", "Multiple errors occurred, please refer to the gateway response messages");
result.put("internalRespMsgs", errors);
}
} else {
@@ -867,9 +871,11 @@ public class PayPalServices {
result.put("releaseRefNum", authTrans.getString("referenceNum"));
result.put("releaseAmount", BigDecimal.ZERO);
if (errors.size() == 1) {
- result.put("responseMessage", errors.get(0));
+ Map.Entry<String, String> error = errors.entrySet().iterator().next();
+ result.put("releaseCode", error.getKey());
+ result.put("releaseMessage", error.getValue()t);
} else {
- result.put("responseMessage", "Multiple errors occurred, please refer to the gateway response messages");
+ result.put("releaseMessage", "Multiple errors occurred, please refer to the gateway response messages");
result.put("internalRespMsgs", errors);
}
} else {
@@ -916,9 +922,11 @@ public class PayPalServices {
result.put("refundRefNum", captureTrans.getString("referenceNum"));
result.put("refundAmount", BigDecimal.ZERO);
if (errors.size() == 1) {
- result.put("responseMessage", errors.get(0));
+ Map.Entry<String, String> error = errors.entrySet().iterator().next();
+ result.put("refundCode", error.getKey());
+ result.put("refundMessage", error.getValue());
} else {
- result.put("responseMessage", "Multiple errors occurred, please refer to the gateway response messages");
+ result.put("refundMessage", "Multiple errors occurred, please refer to the gateway response messages");
result.put("internalRespMsgs", errors);
}
} else {