[
https://issues.apache.org/jira/browse/OFBIZ-5640?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14047326#comment-14047326 ]
Vyom Jain commented on OFBIZ-5640:
----------------------------------
I can confirm this is a bug.
For steps you can follow the ones listed in the Description of
https://issues.apache.org/jira/browse/OFBIZ-5565.
Thereafter,
1. Once the order has been created, the payment has to be captured (manually)
2. Cancel the order, you will notice the error related to payment status.
The proposed patch looks fine to me, however, it would be better to discuss it with the community before committing.
Personally, when I had encountered this issue, to avoid the error, I would simply change gift card's related OrderPaymentPreference.statusId to PAYMENT_CAPTURED from PAYMENT_SETTLED which would prevent this error.
> Order cancel is throwing error with FIN_ACCOUNT payment
> -------------------------------------------------------
>
> Key: OFBIZ-5640
> URL:
https://issues.apache.org/jira/browse/OFBIZ-5640> Project: OFBiz
> Issue Type: Bug
> Components: order
> Affects Versions: Release Branch 11.04, SVN trunk, Release Branch 12.04, Release Branch 13.07
> Reporter: Ritu Raj Lakhera
> Priority: Minor
> Fix For: SVN trunk
>
> Attachments: OFBIZ-5640.patch
>
>
> Generally if payment is PAYMENT_AUTHORIZED (authorized) then OOTB services process the release and if payment is PAYMENT_SETTLED
> (captured) then process the refund.
> Service 'releaseOrderPayments' is called by SECA service engine after the 'changeOrderStatus' service at the time of canceling the order. This service checks the authorized
> payment for release and if does not find any payment then return success with out processing. And If this service found any authorized payment
> then release the amount and change the status from PAYMENT_AUTHORIZED to PAYMENT_CANCELLED (canceled) by calling the service 'setPaymentStatus'
> But in case of GIFT_CARD, EFT_ACCOUNT and FIN_ACCOUNT this service is not checking the authorized payment and trying to release the payment
> even payment has already been captured (See PaymentGatewayServices.java line 736 in trunk).
> And thus service 'setPaymentStatus'(See PaymentGatewayServices.java line 1060) is going to fail because status change from PAYMENT_SETTLED to PAYMENT_CANCELLED is not valid
> (see StatusValidChange entity)
--
This message was sent by Atlassian JIRA
(v6.2#6252)