[ 
https://issues.apache.org/jira/browse/OFBIZ-5064?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14224102#comment-14224102
 ] 

Divesh Dutta commented on OFBIZ-5064:
-------------------------------------

By reading these logs it seems that code written by developer  is trying to 
save more than one character in field RESULT_DECLINED of PaymentGatewayResponse 
table. RESULT_DECLINED is of type CHAR(1) . So it should always have Single 
character. In most of the cases you put Y or N based on result from Payment 
gateway you are using. It may happen that Payment Gateway returns TRUE or FALSE 
for "resultDeclined" field or it may happen that Payment Gateway does not even 
return any thing specific to this field. It depends on developer how he process 
response from Payment Gateway and save those results in PGR table. 

Handling for TRUE or FALSE is already done in Authorization process . This can 
be seen in processAuthResult service in PaymentGatewayServices.java This code 
can be seen. 
{code}
if (Boolean.TRUE.equals(context.get("resultDeclined"))) 
response.set("resultDeclined", "Y");
{code}

Similar code can be added when you are processing capture response as this 
error is coming when you are processing capture response. But question is what 
are you getting in your response when you are interacting with Payment Gateway. 

So I think, you can also handle this in your custom code (integration code with 
Payment Gateway , For eg: PaypalServices.java, OrbitalPaymentServices.java), so 
that what ever response is returned from Payment Gateway, you process it and 
save desired result (i.e Y or N) in RESULT_DECLINED field of PGR table. 

So I think this is not bug of  OFBiz. Developer's Integration code can be fixed 
to fix this problem. 




> Failure in create operation for entity PaymentGatewayResponse
> -------------------------------------------------------------
>
>                 Key: OFBIZ-5064
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-5064
>             Project: OFBiz
>          Issue Type: Bug
>          Components: accounting
>         Environment: Linux
>            Reporter: Nilesh S Patil
>
> An error appear in the log and gradually add records in JOBSANDBOX entity:
> 2012-08-08 19:26:33,917 (default#36-invoker-Thread-22) [ 
> GenericDelegator.java:866:ERROR] Failure in create operation for entity 
> [PaymentGatewayResponse]: org.ofbiz.entity.GenericEntityException: Error 
> while inserting: 
> [GenericEntity:PaymentGatewayResponse][altReference,[null-field](java.lang.String)][amount,3.00(java.math.BigDecimal)][createdStamp,2012-08-08
>  19:26:33.915(java.sql.Timestamp)][createdTxStamp,2012-08-08 
> 19:26:33.915(java.sql.Timestamp)][currencyUomId,USD][gatewayAvsResult,[null-field](java.lang.String)][gatewayCode,57355P(java.lang.String)][gatewayCvResult,[null-field](java.lang.String)][gatewayFlag,1(java.lang.String)][gatewayMessage,This
>  transaction has been 
> approved.(java.lang.String)][gatewayScoreResult,[null-field](java.lang.String)][lastUpdatedStamp,2012-08-08
>  19:26:33.915(java.sql.Timestamp)][lastUpdatedTxStamp,2012-08-08 
> 19:26:33.915(java.sql.Timestamp)][orderPaymentPreferenceId,10021(java.lang.String)][paymentGatewayResponseId,10013(java.lang.String)][paymentMethodId,10220(java.lang.String)][paymentMethodTypeId,CREDIT_CARD(java.lang.String)][paymentServiceTypeEnumId,PRDS_PAY_CAPTURE(java.lang.String)][referenceNum,4547539856(java.lang.String)][resultBadCardNumber,[null-field](java.lang.String)][resultBadExpire,[null-field](java.lang.String)][resultDeclined,[null-field](java.lang.String)][resultNsf,[null-field](java.lang.String)][subReference,[null-field](java.lang.String)][transCodeEnumId,PGT_CAPTURE(java.lang.String)][transactionDate,2012-08-01
>  22:12:33.145(java.sql.Timestamp)] (SQL Exception while executing the 
> following:INSERT INTO PAYMENT_GATEWAY_RESPONSE (PAYMENT_GATEWAY_RESPONSE_ID, 
> PAYMENT_SERVICE_TYPE_ENUM_ID, ORDER_PAYMENT_PREFERENCE_ID, 
> PAYMENT_METHOD_TYPE_ID, PAYMENT_METHOD_ID, TRANS_CODE_ENUM_ID, AMOUNT, 
> CURRENCY_UOM_ID, REFERENCE_NUM, ALT_REFERENCE, SUB_REFERENCE, GATEWAY_CODE, 
> GATEWAY_FLAG, GATEWAY_AVS_RESULT, GATEWAY_CV_RESULT, GATEWAY_SCORE_RESULT, 
> GATEWAY_MESSAGE, TRANSACTION_DATE, RESULT_DECLINED, RESULT_NSF, 
> RESULT_BAD_EXPIRE, RESULT_BAD_CARD_NUMBER, LAST_UPDATED_STAMP, 
> LAST_UPDATED_TX_STAMP, CREATED_STAMP, CREATED_TX_STAMP) VALUES (?, ?, ?, ?, 
> ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) (Data 
> truncation: Data too long for column 'RESULT_DECLINED' at row 1)). Rolling 
> back transaction.
> 2012-08-08 19:26:33,918 (default#36-invoker-Thread-22) 
> [PaymentGatewayServices.java:2969:ERROR] 
> ---- exception report 
> ----------------------------------------------------------
> Exception: org.ofbiz.entity.GenericEntityException
> Message: Error while inserting: 
> [GenericEntity:PaymentGatewayResponse][altReference,[null-field](java.lang.String)][amount,3.00(java.math.BigDecimal)][createdStamp,2012-08-08
>  19:26:33.915(java.sql.Timestamp)][createdTxStamp,2012-08-08 
> 19:26:33.915(java.sql.Timestamp)][currencyUomId,USD][gatewayAvsResult,[null-field](java.lang.String)][gatewayCode,57355P(java.lang.String)][gatewayCvResult,[null-field](java.lang.String)][gatewayFlag,1(java.lang.String)][gatewayMessage,This
>  transaction has been 
> approved.(java.lang.String)][gatewayScoreResult,[null-field](java.lang.String)][lastUpdatedStamp,2012-08-08
>  19:26:33.915(java.sql.Timestamp)][lastUpdatedTxStamp,2012-08-08 
> 19:26:33.915(java.sql.Timestamp)][orderPaymentPreferenceId,10021(java.lang.String)][paymentGatewayResponseId,10013(java.lang.String)][paymentMethodId,10220(java.lang.String)][paymentMethodTypeId,CREDIT_CARD(java.lang.String)][paymentServiceTypeEnumId,PRDS_PAY_CAPTURE(java.lang.String)][referenceNum,4547539856(java.lang.String)][resultBadCardNumber,[null-field](java.lang.String)][resultBadExpire,[null-field](java.lang.String)][resultDeclined,[null-field](java.lang.String)][resultNsf,[null-field](java.lang.String)][subReference,[null-field](java.lang.String)][transCodeEnumId,PGT_CAPTURE(java.lang.String)][transactionDate,2012-08-01
>  22:12:33.145(java.sql.Timestamp)] (SQL Exception while executing the 
> following:INSERT INTO PAYMENT_GATEWAY_RESPONSE (PAYMENT_GATEWAY_RESPONSE_ID, 
> PAYMENT_SERVICE_TYPE_ENUM_ID, ORDER_PAYMENT_PREFERENCE_ID, 
> PAYMENT_METHOD_TYPE_ID, PAYMENT_METHOD_ID, TRANS_CODE_ENUM_ID, AMOUNT, 
> CURRENCY_UOM_ID, REFERENCE_NUM, ALT_REFERENCE, SUB_REFERENCE, GATEWAY_CODE, 
> GATEWAY_FLAG, GATEWAY_AVS_RESULT, GATEWAY_CV_RESULT, GATEWAY_SCORE_RESULT, 
> GATEWAY_MESSAGE, TRANSACTION_DATE, RESULT_DECLINED, RESULT_NSF, 
> RESULT_BAD_EXPIRE, RESULT_BAD_CARD_NUMBER, LAST_UPDATED_STAMP, 
> LAST_UPDATED_TX_STAMP, CREATED_STAMP, CREATED_TX_STAMP) VALUES (?, ?, ?, ?, 
> ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) (Data 
> truncation: Data too long for column 'RESULT_DECLINED' at row 1))
> ---- cause 
> ---------------------------------------------------------------------



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to