Regards Scott
On 30/09/2009, at 9:30 PM, Abdullah Shaikh wrote:
Scott,Should we then have a separate service for saving PaymentGatewayResponseMsgs or should we have a condition in savePaymentGatewayResponse, which will check the entity name (genericvalue.getEntityName()), and decided on thefield mapping ? On Wed, Sep 30, 2009 at 1:56 PM, Abdullah Shaikh < [email protected]> wrote:The savePgr method of PaymentGatewayServices, is called from multipleplaces, this method expects 2 parameters, DispatchContext & GenericValue, but the issue is the calling methods which calls savePgr methods passes PaymentGatewayResponse in some places and PaymentGatewayRespMsg in someplaces. The savePgr method in turn calls savePaymentGatewayResponse service. I guess we need to have one more method which will work ifPaymentGatewayRespMsg as GenericValue is passed or may be a condition basedon the entity name which we can get from the GenericValue ? Any other thoughts ?On Wed, Sep 30, 2009 at 1:54 PM, Scott Gray <[email protected] >wrote:You are right Abdullah, it looks the like the code calling the service isattempting to use it for saving both PaymentGatewayResponses andPaymentGatewayResponseMsgs, but it is only capable of handling the former.The fix I think would be to have a separate service for savingPaymentGatewayResponseMsgs and have the calling code use that where needed.Regards Scott On 30/09/2009, at 8:52 PM, Abdullah Shaikh wrote: Hi Scott,Yes, PaymentGatewayResponse does have a field called gatewayMessage, buttheGenericValue we are getting from the context is of PaymentGatewayRespMsg.There can be two cases here:1) Either the GenericValue that we are getting from the context should beoftype PaymentGatewayResponse, which currently is PaymentGatewayRespMsgor 2) The field name should be changed as I mentioned earlier. Below is the error that I was getting that lead me to this issue : ---- exception report ---------------------------------------------------------- [java] Service [savePaymentGatewayResponse] threw an unexpected exception/error [java] Exception: org.ofbiz.service.GenericServiceException[java] Message: Service [savePaymentGatewayResponse] target threw an unexpected exception ([GenericEntity.get] "gatewayMessage" is not a fieldof PaymentGatewayRespMsg) [java] ---- cause --------------------------------------------------------------------- [java] Exception: java.lang.IllegalArgumentException[java] Message: [GenericEntity.get] "gatewayMessage" is not a field ofPaymentGatewayRespMsg [java] ---- stack trace --------------------------------------------------------------- [java] java.lang.IllegalArgumentException: [GenericEntity.get] "gatewayMessage" is not a field of PaymentGatewayRespMsg [java] org.ofbiz.entity.GenericEntity.get(GenericEntity.java:305) [java] org.ofbiz.entity.GenericEntity.getString(GenericEntity.java:582) [java]org .ofbiz .accounting .payment .PaymentGatewayServices .savePaymentGatewayResponse(PaymentGatewayServices.java:2850)On Wed, Sep 30, 2009 at 12:07 PM, Abdullah Shaikh < [email protected]> wrote: Jira issue created and patch attached,https://issues.apache.org/jira/browse/OFBIZ-2978 On Wed, Sep 30, 2009 at 2:07 AM, Scott Gray <[email protected]wrote:Yes pleaseRegards Scott On 30/09/2009, at 1:45 AM, Abdullah Shaikh wrote: Should I submit the patch ?On Tue, Sep 29, 2009 at 4:00 PM, Abdullah Shaikh < [email protected]> wrote:In savePaymentGatewayResponse method of PaymentGatewayServices class,weare setting the "gatewayMessage" field on the GenericValue ofPaymentGatewayRespMsg, but there is no field named "gatewayMessage"inentity PaymentGatewayRespMsg but instead we need to use "pgrMessage"in place of "gatewayMessage".I guess we mistakely assumed the GenericValue which we get from thecontext, context.get("paymentGatewayResponse");, to be of PaymentGatewayResponse, but its the GenericValue of PaymentGatewayRespMsg but while putting it on the context we named it as "paymentGatewayResponse".I have changed the savePaymentGatewayResponse, and will submit thepatch, but before submitting I would like to confirm this.
smime.p7s
Description: S/MIME cryptographic signature
