Author: mor
Date: Thu Jul 2 10:09:09 2009 New Revision: 790536 URL: http://svn.apache.org/viewvc?rev=790536&view=rev Log: Applied fix from trunk for revision: 790535 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/branches/release09.04/applications/accounting/src/org/ofbiz/accounting/payment/GiftCertificateServices.java ofbiz/branches/release09.04/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java Modified: ofbiz/branches/release09.04/applications/accounting/src/org/ofbiz/accounting/payment/GiftCertificateServices.java URL: http://svn.apache.org/viewvc/ofbiz/branches/release09.04/applications/accounting/src/org/ofbiz/accounting/payment/GiftCertificateServices.java?rev=790536&r1=790535&r2=790536&view=diff ============================================================================== --- ofbiz/branches/release09.04/applications/accounting/src/org/ofbiz/accounting/payment/GiftCertificateServices.java (original) +++ ofbiz/branches/release09.04/applications/accounting/src/org/ofbiz/accounting/payment/GiftCertificateServices.java Thu Jul 2 10:09:09 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/branches/release09.04/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java URL: http://svn.apache.org/viewvc/ofbiz/branches/release09.04/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java?rev=790536&r1=790535&r2=790536&view=diff ============================================================================== --- ofbiz/branches/release09.04/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java (original) +++ ofbiz/branches/release09.04/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java Thu Jul 2 10:09:09 2009 @@ -643,6 +643,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 { @@ -1589,7 +1593,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 captureResult = null; try { |
Free forum by Nabble | Edit this page |