diff --git a/applications/accounting/config/payment.properties b/applications/accounting/config/payment.properties
index c825d87eba..c9c617d52e 100644
--- a/applications/accounting/config/payment.properties
+++ b/applications/accounting/config/payment.properties
@@ -118,6 +118,12 @@ payment.cybersource.ignoreAvs=false
# AVS Decline Codes -- May not be supported any longer
#payment.cybersource.avsDeclineCodes=
+# Ignore status of cybersource transaction reply (Y|N) (if cybersource response transaction status not equals "ACCEPT" then OFBiz will still create the order but in status 'created'.
+# default N = Don't create order if cybersource reported transaction status not equals "ACCEPT".
+payment.cybersource.ignoreStatus=N
+# It happens pretty often that a creditcard is rejected for not valid reasons, one can check to Cybersource fraud queue and after that the order can still be rejected or approved.
+
+
############################################
# ClearCommerce Configuration
############################################
diff --git a/applications/accounting/servicedef/services_paymentmethod.xml b/applications/accounting/servicedef/services_paymentmethod.xml
index e33a5ae94f..83775de2b7 100644
--- a/applications/accounting/servicedef/services_paymentmethod.xml
+++ b/applications/accounting/servicedef/services_paymentmethod.xml
@@ -267,6 +267,7 @@ under the License.
+
+
reply, Map result) {
String decision = getDecision(reply);
+ String checkModeStatus = UtilProperties.getPropertyValue("payment.properties", "payment.cybersource.ignoreStatus");
if ("ACCEPT".equalsIgnoreCase(decision)) {
result.put("authCode", reply.get("ccAuthReply_authorizationCode"));
result.put("authResult", Boolean.TRUE);
} else {
result.put("authCode", decision);
- result.put("authResult", Boolean.FALSE);
+ if ("N".equals(checkModeStatus)) {
+ result.put("authResult", Boolean.FALSE);
+ } else {
+ result.put("authResult", Boolean.TRUE);
+ }
// TODO: based on reasonCode populate the following flags as applicable: resultDeclined, resultNsf, resultBadExpire, resultBadCardNumber
}
diff --git a/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java b/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java
index 94a004e765..1ffd035c37 100644
--- a/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java
+++ b/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java
@@ -1067,9 +1067,27 @@ public class CheckOutHelper {
// set the order and item status to approved
if (autoApproveOrder) {
- boolean ok = OrderChangeHelper.approveOrder(dispatcher, userLogin, orderId, manualHold);
- if (!ok) {
- throw new GeneralException("Problem with order change; see above error");
+ List productStorePaymentSettingList = delegator.findByAnd("ProductStorePaymentSetting", UtilMisc.toMap("productStoreId", productStore.getString("productStoreId"), "paymentMethodTypeId", "CREDIT_CARD", "paymentService", "cyberSourceCCAuth"));
+ if (productStorePaymentSettingList.size() > 0) {
+ String decision = (String) paymentResult.get("authCode");
+ if (UtilValidate.isNotEmpty(decision)) {
+ if ("ACCEPT".equalsIgnoreCase(decision)) {
+ boolean ok = OrderChangeHelper.approveOrder(dispatcher, userLogin, orderId, manualHold);
+ if (!ok) {
+ throw new GeneralException("Problem with order change; see above error");
+ }
+ }
+ } else {
+ boolean ok = OrderChangeHelper.approveOrder(dispatcher, userLogin, orderId, manualHold);
+ if (!ok) {
+ throw new GeneralException("Problem with order change; see above error");
+ }
+ }
+ } else {
+ boolean ok = OrderChangeHelper.approveOrder(dispatcher, userLogin, orderId, manualHold);
+ if (!ok) {
+ throw new GeneralException("Problem with order change; see above error");
+ }
}
}
} else if (authResp.equals("ERROR")) {