You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by mr...@apache.org on 2011/02/09 22:59:21 UTC
svn commit: r1069134 - in /ofbiz/trunk/applications/accounting: config/
src/org/ofbiz/accounting/invoice/ src/org/ofbiz/accounting/tax/
src/org/ofbiz/accounting/thirdparty/sagepay/
Author: mrisaliti
Date: Wed Feb 9 21:59:21 2011
New Revision: 1069134
URL: http://svn.apache.org/viewvc?rev=1069134&view=rev
Log:
Internationalization of return messages of java services of accounting component (OFBIZ-4091)
Modified:
ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml
ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java
ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/tax/TaxAuthorityServices.java
ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/sagepay/SagePayServices.java
Modified: ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml?rev=1069134&r1=1069133&r2=1069134&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml (original)
+++ ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml Wed Feb 9 21:59:21 2011
@@ -7619,6 +7619,10 @@
<value xml:lang="zh">没ææ¾å°å票</value>
<value xml:lang="zh_TW">æ²ææ¾å°ç¼ç¥¨</value>
</property>
+ <property key="AccountingNoInvoiceItemsFoundForInvoice">
+ <value xml:lang="en">No invoice items found for invoice ${invoiceId} to match payment against...</value>
+ <value xml:lang="it">Nessuna riga fattura trovata per la fattura ${invoiceId} che corrisponde al pagamento...</value>
+ </property>
<property key="AccountingNoInvoicesReadyOrOutstandingAmountZero">
<value xml:lang="de">Es sind entweder keine der ausgewählten Rechnungen im Status 'erledigt' oder der Betrag beträgt Null.</value>
<value xml:lang="en">Either no selected invoices in ready state or selected invoices outstanding amount equals to zero.</value>
@@ -8642,6 +8646,14 @@
<value xml:lang="zh">没ææ¾å°æ¯ä»åºç¨çè®°å½[${paymentApplicationId}]</value>
<value xml:lang="zh_TW">æ²ææ¾å°æ¯ä»æç¨çè¨é[${paymentApplicationId}]</value>
</property>
+ <property key="AccountingPaymentApplicationParameterUnsuitable">
+ <value xml:lang="en">??unsuitable parameters passed...?? This message.... should never be shown\n</value>
+ <value xml:lang="it">??parametri passati non corretti...?? Questo messaggio.... non dovrebbe essere mai mostrato\n</value>
+ </property>
+ <property key="AccountingPaymentApplicationParameterListUnsuitable">
+ <value xml:lang="en">--Input parameters...InvoiceId: ${invoiceId} invoiceItemSeqId: ${invoiceItemSeqId} PaymentId: ${paymentId} toPaymentId: ${toPaymentId} \n paymentApplicationId: ${paymentApplicationId} amountApplied: ${amountApplied}</value>
+ <value xml:lang="it">--Parametri...Fattura: ${invoiceId} riga fattura: ${invoiceItemSeqId} pagamento: ${paymentId} al pagamento: ${toPaymentId} \n paymentApplicationId: ${paymentApplicationId} importo applicato: ${amountApplied}</value>
+ </property>
<property key="AccountingPaymentApplicationParameterMissing">
<value xml:lang="de">Zahlungs-Zuweisung benötigt entweder eine Rechnungs-Nr, eine Rechnungskonto-Nr, eine Steuerbehörde oder ein Buchungskonto</value>
<value xml:lang="en">Payment application requires either an invoiceId, a billingAccountId, a taxAuthGeoId or a glAccountId</value>
@@ -10359,6 +10371,54 @@
<value xml:lang="en">Authorisation Url</value>
<value xml:lang="pt">Url de Autorização</value>
</property>
+ <property key="AccountingSagePayErrorEncodingParameters">
+ <value xml:lang="en">Error occured in encoding parameters for HttpPost (${errorString})</value>
+ <value xml:lang="it">Errore accaduto durante encoding parametri per HttpPost (${errorString})</value>
+ </property>
+ <property key="AccountingSagePayErrorHttpClientExecute">
+ <value xml:lang="en">Error occured in HttpClient execute (${errorString})</value>
+ <value xml:lang="it">Errore accaduto durante esecuzione HttpClient (${errorString})</value>
+ </property>
+ <property key="AccountingSagePayErrorHttpClientExecuteOrGettingResponse">
+ <value xml:lang="en">Error occured in HttpClient execute or getting response (${errorString})</value>
+ <value xml:lang="it">Errore accaduto durante esecuzione HttpClient o ottendendo la risposta (${errorString})</value>
+ </property>
+ <property key="AccountingSagePayPaymentError">
+ <value xml:lang="en">Problem at SagePay</value>
+ <value xml:lang="it">Problemi di SagePay</value>
+ </property>
+ <property key="AccountingSagePayPaymentInvalidInformationPassed">
+ <value xml:lang="en">Invalid information passed in parameters</value>
+ <value xml:lang="it">Informazioni invalide passate nei paramatri</value>
+ </property>
+ <property key="AccountingSagePayPaymentRefundNotAuthorized">
+ <value xml:lang="en">Refund not authorized by the acquiring bank</value>
+ <value xml:lang="it">Rimborso non autorizzato dalla banca</value>
+ </property>
+ <property key="AccountingSagePayPaymentRefundRequestMalformed">
+ <value xml:lang="en">Refund request not formed properly or parameters missing</value>
+ <value xml:lang="it">Richiesta rimborso pagamento non formato correttamente o parametro mancante</value>
+ </property>
+ <property key="AccountingSagePayPaymentRefunded">
+ <value xml:lang="en">Payment Refunded</value>
+ <value xml:lang="it">Pagamento rimborsato</value>
+ </property>
+ <property key="AccountingSagePayPaymentReleaseRequestMalformed">
+ <value xml:lang="en">Released request not formed properly or parameters missing</value>
+ <value xml:lang="it">Richiesta rilascio pagamento non formato correttamente o parametro mancante</value>
+ </property>
+ <property key="AccountingSagePayPaymentReleased">
+ <value xml:lang="en">Payment Released</value>
+ <value xml:lang="it">Pagamento rilasciato</value>
+ </property>
+ <property key="AccountingSagePayPaymentVoidRequestMalformed">
+ <value xml:lang="en">Void request not formed properly or parameters missing</value>
+ <value xml:lang="it">Richiesta annullamento pagamento non formato correttamente o parametro mancante</value>
+ </property>
+ <property key="AccountingSagePayPaymentVoided">
+ <value xml:lang="en">Payment Voided</value>
+ <value xml:lang="it">Pagamento annullato</value>
+ </property>
<property key="AccountingSagePayMode">
<value xml:lang="en">Mode</value>
<value xml:lang="pt">Modo</value>
@@ -10956,6 +11016,14 @@
<value xml:lang="it">Non è possibile calcolare le tasse, nessuna spedizione o.......</value>
<value xml:lang="pt">Não é possÃvel calcular o imposto, não envio ou .......</value>
</property>
+ <property key="AccountingTaxNoAddressSpecified">
+ <value xml:lang="en">The address(es) used for tax calculation did not have State/Province or Country or other tax jurisdiction values set, so we cannot determine the taxes to charge.</value>
+ <value xml:lang="it">L'indirizzo(i) usato per il calcolo delle tasse non ha impostato i valori dello stato/provincia o paese o giurisdizione tasse, così non è possibile determinare le tasse.</value>
+ </property>
+ <property key="AccountingTaxNoAddressSpecifiedDetails">
+ <value xml:lang="en"> [ID: ${contactMechId}, Address 1: ${address1}, Postal Code/ID: ${postalCodeGeoId} / ${postalCodeGeoId}, State/Province: ${stateProvinceGeoId}, Country: ${countryGeoId}}</value>
+ <value xml:lang="it"> [ID: ${contactMechId}, Indirizzo 1: ${address1}, C.A.P.: ${postalCodeGeoId} / ${postalCodeGeoId}, Stato/Provincia: ${stateProvinceGeoId}, Paese: ${countryGeoId}}</value>
+ </property>
<property key="AccountingTaxProductIdCannotCalculate">
<value xml:lang="en">productId don't have value, cannot call calcTax service.</value>
<value xml:lang="it">Codice prodotto non ha nessun valore, non è possibile eseguire il servizio calcTax.</value>
Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java?rev=1069134&r1=1069133&r2=1069134&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java (original)
+++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java Wed Feb 9 21:59:21 2011
@@ -3018,7 +3018,7 @@ public class InvoiceServices {
return ServiceUtil.returnError(e.getMessage());
}
if (invoiceItems.size() == 0) {
- errorMessageList.add("No invoice items found for invoice " + invoiceId + " to match payment against...\n");
+ errorMessageList.add(UtilProperties.getMessage(resource, "AccountingNoInvoiceItemsFoundForInvoice", UtilMisc.toMap("invoiceId", invoiceId), locale));
return ServiceUtil.returnError(errorMessageList);
} else { // we found some invoice items, start processing....
// check if the user want to apply a smaller amount than the maximum possible on the payment
@@ -3143,8 +3143,8 @@ public class InvoiceServices {
}
// should never come here...
- errorMessageList.add("??unsuitable parameters passed...?? This message.... should never be shown\n");
- errorMessageList.add("--Input parameters...InvoiceId:" + invoiceId + " invoiceItemSeqId:" + invoiceItemSeqId + " PaymentId:" + paymentId + " toPaymentId:" + toPaymentId + "\n paymentApplicationId:" + paymentApplicationId + " amountApplied:" + amountApplied);
+ errorMessageList.add(UtilProperties.getMessage(resource, "AccountingPaymentApplicationParameterUnsuitable", locale));
+ errorMessageList.add(UtilProperties.getMessage(resource, "AccountingPaymentApplicationParameterListUnsuitable", UtilMisc.toMap("invoiceId", invoiceId, "invoiceItemSeqId", invoiceItemSeqId, "paymentId", paymentId, "toPaymentId", toPaymentId, "paymentApplicationId", paymentApplicationId, "amountApplied", amountApplied), locale));
return ServiceUtil.returnError(errorMessageList);
}
Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/tax/TaxAuthorityServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/tax/TaxAuthorityServices.java?rev=1069134&r1=1069133&r2=1069134&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/tax/TaxAuthorityServices.java (original)
+++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/tax/TaxAuthorityServices.java Wed Feb 9 21:59:21 2011
@@ -62,6 +62,7 @@ public class TaxAuthorityServices {
public static int salestaxFinalDecimals = UtilNumber.getBigDecimalScale("salestax.final.decimals");
public static int salestaxCalcDecimals = UtilNumber.getBigDecimalScale("salestax.calc.decimals");
public static int salestaxRounding = UtilNumber.getBigDecimalRoundingMode("salestax.rounding");
+ public static final String resource = "AccountingUiLabels";
public static Map<String, Object> rateProductTaxCalcForDisplay(DispatchContext dctx, Map<String, ? extends Object> context) {
Delegator delegator = dctx.getDelegator();
@@ -123,7 +124,7 @@ public class TaxAuthorityServices {
}
} catch (GenericEntityException e) {
Debug.logError(e, "Data error getting tax settings: " + e.toString(), module);
- return ServiceUtil.returnError(UtilProperties.getMessage("AccountingUiLabels", "AccountingTaxSettingError", UtilMisc.toMap("errorString", e.toString()), locale));
+ return ServiceUtil.returnError(UtilProperties.getMessage(resource, "AccountingTaxSettingError", UtilMisc.toMap("errorString", e.toString()), locale));
}
// round to 2 decimal places for display/etc
@@ -163,7 +164,7 @@ public class TaxAuthorityServices {
}
} catch (GenericEntityException e) {
Debug.logError(e, "Data error getting tax settings: " + e.toString(), module);
- return ServiceUtil.returnError(UtilProperties.getMessage("AccountingUiLabels", "AccountingTaxSettingError", UtilMisc.toMap("errorString", e.toString()), locale));
+ return ServiceUtil.returnError(UtilProperties.getMessage(resource, "AccountingTaxSettingError", UtilMisc.toMap("errorString", e.toString()), locale));
}
if (productStore == null && payToPartyId == null) {
@@ -180,13 +181,13 @@ public class TaxAuthorityServices {
}
} catch (GenericEntityException e) {
Debug.logError(e, "Data error getting tax settings: " + e.toString(), module);
- return ServiceUtil.returnError(UtilProperties.getMessage("AccountingUiLabels", "AccountingTaxSettingError", UtilMisc.toMap("errorString", e.toString()), locale));
+ return ServiceUtil.returnError(UtilProperties.getMessage(resource, "AccountingTaxSettingError", UtilMisc.toMap("errorString", e.toString()), locale));
}
}
if (shippingAddress == null || (shippingAddress.get("countryGeoId") == null && shippingAddress.get("stateProvinceGeoId") == null && shippingAddress.get("postalCodeGeoId") == null)) {
- String errMsg = "The address(es) used for tax calculation did not have State/Province or Country or other tax jurisdiction values set, so we cannot determine the taxes to charge.";
+ String errMsg = UtilProperties.getMessage(resource, "AccountingTaxNoAddressSpecified", locale);
if (shippingAddress != null) {
- errMsg += " [ID:" + shippingAddress.getString("contactMechId") + ", Address 1: " + shippingAddress.get("address1") + ", Postal Code/ID: " + shippingAddress.get("postalCodeGeoId") + "/" + shippingAddress.get("postalCodeGeoId") + ", State/Province: " + shippingAddress.get("stateProvinceGeoId") + ", Country: " + shippingAddress.get("countryGeoId") + "]";
+ errMsg += UtilProperties.getMessage(resource, "AccountingTaxNoAddressSpecifiedDetails", UtilMisc.toMap("contactMechId", shippingAddress.getString("contactMechId"), "address1", shippingAddress.get("address1"), "postalCodeGeoId", shippingAddress.get("postalCodeGeoId"), "stateProvinceGeoId", shippingAddress.get("stateProvinceGeoId"), "countryGeoId", shippingAddress.get("countryGeoId")), locale);
Debug.logError(errMsg, module);
}
return ServiceUtil.returnError(errMsg);
@@ -198,7 +199,7 @@ public class TaxAuthorityServices {
getTaxAuthorities(delegator, shippingAddress, taxAuthoritySet);
} catch (GenericEntityException e) {
Debug.logError(e, "Data error getting tax settings: " + e.toString(), module);
- return ServiceUtil.returnError(UtilProperties.getMessage("AccountingUiLabels", "AccountingTaxSettingError", UtilMisc.toMap("errorString", e.toString()), locale));
+ return ServiceUtil.returnError(UtilProperties.getMessage(resource, "AccountingTaxSettingError", UtilMisc.toMap("errorString", e.toString()), locale));
}
// Setup the return lists.
Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/sagepay/SagePayServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/sagepay/SagePayServices.java?rev=1069134&r1=1069133&r2=1069134&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/sagepay/SagePayServices.java (original)
+++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/sagepay/SagePayServices.java Wed Feb 9 21:59:21 2011
@@ -22,6 +22,7 @@ package org.ofbiz.accounting.thirdparty.
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.HashMap;
+import java.util.Locale;
import java.util.Map;
import java.util.Set;
@@ -32,6 +33,7 @@ import org.apache.http.client.HttpClient
import org.apache.http.client.methods.HttpPost;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.UtilMisc;
+import org.ofbiz.base.util.UtilProperties;
import org.ofbiz.base.util.UtilValidate;
import org.ofbiz.entity.Delegator;
import org.ofbiz.entity.GenericEntityException;
@@ -43,6 +45,7 @@ import org.ofbiz.service.ServiceUtil;
public class SagePayServices
{
public static final String module = SagePayServices.class.getName();
+ public static final String resource = "AccountingUiLabels";
private static Map<String, String> buildSagePayProperties(Map<String, Object> context, Delegator delegator) {
@@ -116,6 +119,7 @@ public class SagePayServices
String issueNumber = (String) context.get("issueNumber");
String basket = (String) context.get("basket");
String clientIPAddress = (String) context.get("clientIPAddress");
+ Locale locale = (Locale) context.get("locale");
HttpClient httpClient = SagePayUtil.getHttpClient();
HttpHost host = SagePayUtil.getHost(props);
@@ -263,19 +267,16 @@ public class SagePayServices
} catch(UnsupportedEncodingException uee) {
//exception in encoding parameters in httpPost
- String errorMsg = "Error occured in encoding parameters for HttpPost (" + uee.getMessage() + ")";
- Debug.logError(uee, errorMsg, module);
- resultMap = ServiceUtil.returnError(errorMsg);
+ Debug.logError(uee, "Error occured in encoding parameters for HttpPost (" + uee.getMessage() + ")", module);
+ resultMap = ServiceUtil.returnError(UtilProperties.getMessage(resource, "AccountingSagePayErrorEncodingParameters", UtilMisc.toMap("errorString", uee.getMessage()), locale));
} catch(ClientProtocolException cpe) {
//from httpClient execute
- String errorMsg = "Error occured in HttpClient execute(" + cpe.getMessage() + ")";
- Debug.logError(cpe, errorMsg, module);
- resultMap = ServiceUtil.returnError(errorMsg);
+ Debug.logError(cpe, "Error occured in HttpClient execute(" + cpe.getMessage() + ")", module);
+ resultMap = ServiceUtil.returnError(UtilProperties.getMessage(resource, "AccountingSagePayErrorHttpClientExecute", UtilMisc.toMap("errorString", cpe.getMessage()), locale));
} catch(IOException ioe) {
//from httpClient execute or getResponsedata
- String errorMsg = "Error occured in HttpClient execute or getting response (" + ioe.getMessage() + ")";
- Debug.logError(ioe, errorMsg, module);
- resultMap = ServiceUtil.returnError(errorMsg);
+ Debug.logError(ioe, "Error occured in HttpClient execute or getting response (" + ioe.getMessage() + ")", module);
+ resultMap = ServiceUtil.returnError(UtilProperties.getMessage(resource, "AccountingSagePayErrorHttpClientExecuteOrGettingResponse", UtilMisc.toMap("errorString", ioe.getMessage()), locale));
} finally {
httpClient.getConnectionManager().shutdown();
}
@@ -297,6 +298,7 @@ public class SagePayServices
String securityKey = (String) context.get("securityKey");
String txAuthNo = (String) context.get("txAuthNo");
String amount = (String) context.get("amount");
+ Locale locale = (Locale) context.get("locale");
HttpClient httpClient = SagePayUtil.getHttpClient();
HttpHost host = SagePayUtil.getHost(props);
@@ -334,25 +336,25 @@ public class SagePayServices
//start - payment refunded
if ("OK".equals(status)) {
- successMessage = "Payment Released";
+ successMessage = UtilProperties.getMessage(resource, "AccountingSagePayPaymentReleased", locale);
}
//end - payment refunded
//start - refund request not formed properly or parameters missing
if ("MALFORMED".equals(status)) {
- successMessage = "Released request not formed properly or parameters missing";
+ successMessage = UtilProperties.getMessage(resource, "AccountingSagePayPaymentReleaseRequestMalformed", locale);
}
//end - refund request not formed properly or parameters missing
//start - invalid information passed in parameters
if ("INVALID".equals(status)) {
- successMessage = "Invalid information passed in parameters";
+ successMessage = UtilProperties.getMessage(resource, "AccountingSagePayPaymentInvalidInformationPassed", locale);
}
//end - invalid information passed in parameters
//start - problem at Sagepay
if ("ERROR".equals(status)) {
- successMessage = "Problem at SagePay";
+ successMessage = UtilProperties.getMessage(resource, "AccountingSagePayPaymentError", locale);
}
//end - problem at Sagepay
@@ -361,19 +363,16 @@ public class SagePayServices
} catch(UnsupportedEncodingException uee) {
//exception in encoding parameters in httpPost
- String errorMsg = "Error occured in encoding parameters for HttpPost (" + uee.getMessage() + ")";
- Debug.logError(uee, errorMsg, module);
- resultMap = ServiceUtil.returnError(errorMsg);
+ Debug.logError(uee, "Error occured in encoding parameters for HttpPost (" + uee.getMessage() + ")", module);
+ resultMap = ServiceUtil.returnError(UtilProperties.getMessage(resource, "AccountingSagePayErrorEncodingParameters", UtilMisc.toMap("errorString", uee.getMessage()), locale));
} catch(ClientProtocolException cpe) {
//from httpClient execute
- String errorMsg = "Error occured in HttpClient execute(" + cpe.getMessage() + ")";
- Debug.logError(cpe, errorMsg, module);
- resultMap = ServiceUtil.returnError(errorMsg);
+ Debug.logError(cpe, "Error occured in HttpClient execute(" + cpe.getMessage() + ")", module);
+ resultMap = ServiceUtil.returnError(UtilProperties.getMessage(resource, "AccountingSagePayErrorHttpClientExecute", UtilMisc.toMap("errorString", cpe.getMessage()), locale));
} catch(IOException ioe) {
//from httpClient execute or getResponsedata
- String errorMsg = "Error occured in HttpClient execute or getting response (" + ioe.getMessage() + ")";
- Debug.logError(ioe, errorMsg, module);
- resultMap = ServiceUtil.returnError(errorMsg);
+ Debug.logError(ioe, "Error occured in HttpClient execute or getting response (" + ioe.getMessage() + ")", module);
+ resultMap = ServiceUtil.returnError(UtilProperties.getMessage(resource, "AccountingSagePayErrorHttpClientExecuteOrGettingResponse", UtilMisc.toMap("errorString", ioe.getMessage()), locale));
} finally {
httpClient.getConnectionManager().shutdown();
}
@@ -394,6 +393,7 @@ public class SagePayServices
String vpsTxId = (String) context.get("vpsTxId");
String securityKey = (String) context.get("securityKey");
String txAuthNo = (String) context.get("txAuthNo");
+ Locale locale = (Locale) context.get("locale");
HttpClient httpClient = SagePayUtil.getHttpClient();
HttpHost host = SagePayUtil.getHost(props);
@@ -430,25 +430,25 @@ public class SagePayServices
//start - payment released
if ("OK".equals(status)) {
- successMessage = "Payment Released";
+ successMessage = UtilProperties.getMessage(resource, "AccountingSagePayPaymentReleased", locale);
}
//end - payment released
//start - release request not formed properly or parameters missing
if ("MALFORMED".equals(status)) {
- successMessage = "Release request not formed properly or parameters missing";
+ successMessage = UtilProperties.getMessage(resource, "AccountingSagePayPaymentReleaseRequestMalformed", locale);
}
//end - release request not formed properly or parameters missing
//start - invalid information passed in parameters
if ("INVALID".equals(status)) {
- successMessage = "Invalid information passed in parameters";
+ successMessage = UtilProperties.getMessage(resource, "AccountingSagePayPaymentInvalidInformationPassed", locale);
}
//end - invalid information passed in parameters
//start - problem at Sagepay
if ("ERROR".equals(status)) {
- successMessage = "Problem at SagePay";
+ successMessage = UtilProperties.getMessage(resource, "AccountingSagePayPaymentError", locale);
}
//end - problem at Sagepay
@@ -457,19 +457,16 @@ public class SagePayServices
} catch(UnsupportedEncodingException uee) {
//exception in encoding parameters in httpPost
- String errorMsg = "Error occured in encoding parameters for HttpPost (" + uee.getMessage() + ")";
- Debug.logError(uee, errorMsg, module);
- resultMap = ServiceUtil.returnError(errorMsg);
+ Debug.logError(uee, "Error occured in encoding parameters for HttpPost (" + uee.getMessage() + ")", module);
+ resultMap = ServiceUtil.returnError(UtilProperties.getMessage(resource, "AccountingSagePayErrorEncodingParameters", UtilMisc.toMap("errorString", uee.getMessage()), locale));
} catch(ClientProtocolException cpe) {
//from httpClient execute
- String errorMsg = "Error occured in HttpClient execute(" + cpe.getMessage() + ")";
- Debug.logError(cpe, errorMsg, module);
- resultMap = ServiceUtil.returnError(errorMsg);
+ Debug.logError(cpe, "Error occured in HttpClient execute(" + cpe.getMessage() + ")", module);
+ resultMap = ServiceUtil.returnError(UtilProperties.getMessage(resource, "AccountingSagePayErrorHttpClientExecute", UtilMisc.toMap("errorString", cpe.getMessage()), locale));
} catch(IOException ioe) {
//from httpClient execute or getResponsedata
- String errorMsg = "Error occured in HttpClient execute or getting response (" + ioe.getMessage() + ")";
- Debug.logError(ioe, errorMsg, module);
- resultMap = ServiceUtil.returnError(errorMsg);
+ Debug.logError(ioe, "Error occured in HttpClient execute or getting response (" + ioe.getMessage() + ")", module);
+ resultMap = ServiceUtil.returnError(UtilProperties.getMessage(resource, "AccountingSagePayErrorHttpClientExecuteOrGettingResponse", UtilMisc.toMap("errorString", ioe.getMessage()), locale));
} finally {
httpClient.getConnectionManager().shutdown();
}
@@ -490,6 +487,7 @@ public class SagePayServices
String vpsTxId = (String) context.get("vpsTxId");
String securityKey = (String) context.get("securityKey");
String txAuthNo = (String) context.get("txAuthNo");
+ Locale locale = (Locale) context.get("locale");
HttpClient httpClient = SagePayUtil.getHttpClient();
HttpHost host = SagePayUtil.getHost(props);
@@ -524,25 +522,25 @@ public class SagePayServices
//start - payment void
if ("OK".equals(status)) {
- successMessage = "Payment Voided";
+ successMessage = UtilProperties.getMessage(resource, "AccountingSagePayPaymentVoided", locale);
}
//end - payment void
//start - void request not formed properly or parameters missing
if ("MALFORMED".equals(status)) {
- successMessage = "Void request not formed properly or parameters missing";
+ successMessage = UtilProperties.getMessage(resource, "AccountingSagePayPaymentVoidRequestMalformed", locale);
}
//end - void request not formed properly or parameters missing
//start - invalid information passed in parameters
if ("INVALID".equals(status)) {
- successMessage = "Invalid information passed in parameters";
+ successMessage = UtilProperties.getMessage(resource, "AccountingSagePayPaymentInvalidInformationPassed", locale);
}
//end - invalid information passed in parameters
//start - problem at Sagepay
if ("ERROR".equals(status)) {
- successMessage = "Problem at SagePay";
+ successMessage = UtilProperties.getMessage(resource, "AccountingSagePayPaymentError", locale);
}
//end - problem at Sagepay
@@ -551,19 +549,16 @@ public class SagePayServices
} catch(UnsupportedEncodingException uee) {
//exception in encoding parameters in httpPost
- String errorMsg = "Error occured in encoding parameters for HttpPost (" + uee.getMessage() + ")";
- Debug.logError(uee, errorMsg, module);
- resultMap = ServiceUtil.returnError(errorMsg);
+ Debug.logError(uee, "Error occured in encoding parameters for HttpPost (" + uee.getMessage() + ")", module);
+ resultMap = ServiceUtil.returnError(UtilProperties.getMessage(resource, "AccountingSagePayErrorEncodingParameters", UtilMisc.toMap("errorString", uee.getMessage()), locale));
} catch(ClientProtocolException cpe) {
//from httpClient execute
- String errorMsg = "Error occured in HttpClient execute(" + cpe.getMessage() + ")";
- Debug.logError(cpe, errorMsg, module);
- resultMap = ServiceUtil.returnError(errorMsg);
+ Debug.logError(cpe, "Error occured in HttpClient execute(" + cpe.getMessage() + ")", module);
+ resultMap = ServiceUtil.returnError(UtilProperties.getMessage(resource, "AccountingSagePayErrorHttpClientExecute", UtilMisc.toMap("errorString", cpe.getMessage()), locale));
} catch(IOException ioe) {
//from httpClient execute or getResponsedata
- String errorMsg = "Error occured in HttpClient execute or getting response (" + ioe.getMessage() + ")";
- Debug.logError(ioe, errorMsg, module);
- resultMap = ServiceUtil.returnError(errorMsg);
+ Debug.logError(ioe, "Error occured in HttpClient execute or getting response (" + ioe.getMessage() + ")", module);
+ resultMap = ServiceUtil.returnError(UtilProperties.getMessage(resource, "AccountingSagePayErrorHttpClientExecuteOrGettingResponse", UtilMisc.toMap("errorString", ioe.getMessage()), locale));
} finally {
httpClient.getConnectionManager().shutdown();
}
@@ -589,6 +584,7 @@ public class SagePayServices
String relatedVendorTxCode = (String) context.get("relatedVendorTxCode");
String relatedSecurityKey = (String) context.get("relatedSecurityKey");
String relatedTxAuthNo = (String) context.get("relatedTxAuthNo");
+ Locale locale = (Locale) context.get("locale");
HttpClient httpClient = SagePayUtil.getHttpClient();
HttpHost host = SagePayUtil.getHost(props);
@@ -631,31 +627,31 @@ public class SagePayServices
if ("OK".equals(status)) {
resultMap.put("vpsTxId", responseData.get("VPSTxId"));
resultMap.put("txAuthNo", responseData.get("TxAuthNo"));
- successMessage = "Payment Refunded";
+ successMessage = UtilProperties.getMessage(resource, "AccountingSagePayPaymentRefunded", locale);
}
//end - payment refunded
//start - refund not authorized by the acquiring bank
if ("NOTAUTHED".equals(status)) {
- successMessage = "Refund not authorized by the acquiring bank";
+ successMessage = UtilProperties.getMessage(resource, "AccountingSagePayPaymentRefundNotAuthorized", locale);
}
//end - refund not authorized by the acquiring bank
//start - refund request not formed properly or parameters missing
if ("MALFORMED".equals(status)) {
- successMessage = "Refund request not formed properly or parameters missing";
+ successMessage = UtilProperties.getMessage(resource, "AccountingSagePayPaymentRefundRequestMalformed", locale);
}
//end - refund request not formed properly or parameters missing
//start - invalid information passed in parameters
if ("INVALID".equals(status)) {
- successMessage = "Invalid information passed in parameters";
+ successMessage = UtilProperties.getMessage(resource, "AccountingSagePayPaymentInvalidInformationPassed", locale);
}
//end - invalid information passed in parameters
//start - problem at Sagepay
if ("ERROR".equals(status)) {
- successMessage = "Problem at SagePay";
+ successMessage = UtilProperties.getMessage(resource, "AccountingSagePayPaymentError", locale);
}
//end - problem at Sagepay
@@ -664,19 +660,16 @@ public class SagePayServices
} catch(UnsupportedEncodingException uee) {
//exception in encoding parameters in httpPost
- String errorMsg = "Error occured in encoding parameters for HttpPost (" + uee.getMessage() + ")";
- Debug.logError(uee, errorMsg, module);
- resultMap = ServiceUtil.returnError(errorMsg);
+ Debug.logError(uee, "Error occured in encoding parameters for HttpPost (" + uee.getMessage() + ")", module);
+ resultMap = ServiceUtil.returnError(UtilProperties.getMessage(resource, "AccountingSagePayErrorEncodingParameters", UtilMisc.toMap("errorString", uee.getMessage()), locale));
} catch(ClientProtocolException cpe) {
//from httpClient execute
- String errorMsg = "Error occured in HttpClient execute(" + cpe.getMessage() + ")";
- Debug.logError(cpe, errorMsg, module);
- resultMap = ServiceUtil.returnError(errorMsg);
+ Debug.logError(cpe, "Error occured in HttpClient execute(" + cpe.getMessage() + ")", module);
+ resultMap = ServiceUtil.returnError(UtilProperties.getMessage(resource, "AccountingSagePayErrorHttpClientExecute", UtilMisc.toMap("errorString", cpe.getMessage()), locale));
} catch(IOException ioe) {
//from httpClient execute or getResponsedata
- String errorMsg = "Error occured in HttpClient execute or getting response (" + ioe.getMessage() + ")";
- Debug.logError(ioe, errorMsg, module);
- resultMap = ServiceUtil.returnError(errorMsg);
+ Debug.logError(ioe, "Error occured in HttpClient execute or getting response (" + ioe.getMessage() + ")", module);
+ resultMap = ServiceUtil.returnError(UtilProperties.getMessage(resource, "AccountingSagePayErrorHttpClientExecuteOrGettingResponse", UtilMisc.toMap("errorString", ioe.getMessage()), locale));
} finally {
httpClient.getConnectionManager().shutdown();
}