Author: mor
Date: Thu Jul  2 10:07:34 2009
New Revision: 790535

URL: http://svn.apache.org/viewvc?rev=790535&view=rev
Log:
Fix: Payment Processing through Gift Card. Applied patch from Arun Patidar, 
part of OFBIZ-2680 (https://issues.apache.org/jira/browse/OFBIZ-2680)

Modified:
    
ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/GiftCertificateServices.java
    
ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java

Modified: 
ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/GiftCertificateServices.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/GiftCertificateServices.java?rev=790535&r1=790534&r2=790535&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/GiftCertificateServices.java
 (original)
+++ 
ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/GiftCertificateServices.java
 Thu Jul  2 10:07:34 2009
@@ -404,6 +404,7 @@
                 return releaseResult;
             }
 
+            String authRefNum = authTransaction.getString("referenceNum");
             Map result = ServiceUtil.returnSuccess();
             if (redeemResult != null) {
                 Boolean processResult = (Boolean) 
redeemResult.get("processResult");
@@ -411,6 +412,7 @@
                 result.put("captureResult", processResult);
                 result.put("captureCode", "C");
                 result.put("captureRefNum", redeemResult.get("referenceNum"));
+                result.put("authRefNum", authRefNum);
             }
 
             return result;

Modified: 
ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java?rev=790535&r1=790534&r2=790535&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java
 (original)
+++ 
ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java
 Thu Jul  2 10:07:34 2009
@@ -639,6 +639,10 @@
             // type gift card
             GenericValue giftCard = paymentMethod.getRelatedOne("GiftCard");
             toContext.put("giftCard", giftCard);
+            GenericValue orderHeader = 
paymentPreference.getRelatedOne("OrderHeader");
+            List<GenericValue> orderItems = 
orderHeader.getRelated("OrderItem");
+            toContext.put("orderId", orderHeader.getString("orderId"));
+            toContext.put("orderItems", orderItems);
         } else if ("FIN_ACCOUNT".equals(paymentMethodTypeId)) {
             toContext.put("finAccountId", 
paymentPreference.getString("finAccountId"));
         } else {
@@ -1654,7 +1658,14 @@
         }
 
         Debug.logInfo("Capture [" + serviceName + "] : " + captureContext, 
module);
-
+        try {
+            String paymentMethodTypeId = 
paymentPref.getString("paymentMethodTypeId");
+            if (paymentMethodTypeId != null && 
"GIFT_CARD".equals(paymentMethodTypeId)) {
+                getBillingInformation(orh, paymentPref, captureContext);
+            }
+        } catch (GenericEntityException e) {
+            Debug.logError(e, module);
+        }
         // now invoke the capture service
         Map<String, Object> captureResult = null;
         try {


Reply via email to