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 the
field mapping ?


On Wed, Sep 30, 2009 at 1:56 PM, Abdullah Shaikh <
[email protected]> wrote:

> The savePgr method of PaymentGatewayServices, is called from multiple
> places, 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 some
> places.
>
> The savePgr method in turn calls savePaymentGatewayResponse service.
>
> I guess we need to have one more method which will work if
> PaymentGatewayRespMsg as GenericValue is passed or may be a condition based
> on 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 is
>> attempting to use it for saving both PaymentGatewayResponses and
>> PaymentGatewayResponseMsgs, but it is only capable of handling the former.
>>  The fix I think would be to have a separate service for saving
>> PaymentGatewayResponseMsgs 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, but
>>> the
>>> GenericValue 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 be
>>> of
>>> type PaymentGatewayResponse, which currently is PaymentGatewayRespMsg
>>>
>>> or
>>>
>>> 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 field
>>> of
>>> PaymentGatewayRespMsg)
>>>    [java] ---- cause
>>> ---------------------------------------------------------------------
>>>    [java] Exception: java.lang.IllegalArgumentException
>>>    [java] Message: [GenericEntity.get] "gatewayMessage" is not a field of
>>> PaymentGatewayRespMsg
>>>    [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 please
>>>>>
>>>>> Regards
>>>>> 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,
>>>>>> we
>>>>>>
>>>>>>> are setting the "gatewayMessage" field on the GenericValue of
>>>>>>> PaymentGatewayRespMsg, but there is no field named "gatewayMessage"
>>>>>>> in
>>>>>>> entity PaymentGatewayRespMsg but instead we need to use "pgrMessage"
>>>>>>> in
>>>>>>> place of "gatewayMessage".
>>>>>>>
>>>>>>> I guess we mistakely assumed the GenericValue which we get from the
>>>>>>> context, 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 the
>>>>>>> patch,
>>>>>>> but before submitting I would like to confirm this.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>
>>>>
>>
>

Reply via email to