Revert status of "Return Form" from Complete back to Awaiting Completion when refund transaction was failed

Vote:
 

My approach is creating a return form and then process my refund to payment gateway. The status of return form is alway Completed after I click Complete Return and then it will trigger the ProcessPayment which process the refund payment transaction.

In case of the refund transaction is failed, the return form has already completed and cannot trigger refund transaction again. So in this situiation, return form was marked as completed but customer does not recieve money back.

First attemp: I've tried to set the return form status back to Awaiting Completion but the problem is that I cannot determine which was the correct return form to revert. The refund transaction which was failed does not have any relationship to any return form than refund amount.

Second attemp: I try to create new payment transaction to process refund but have no Idea about doing this.

Have anyone dealed with this kind of refund situiation ?

EPiServer Commerce - 13.26.0.0

Episerver Web Content Management System - 11.17.0.0

#259007
Edited, Jul 16, 2021 11:06
Vote:
 

Hi Tuan,

In a standard payment gateway solution; the return will not get completed unless the PaymentProcess method returns a PaymentProcessResult variable marked as successful.

Can you post me a screenshot of the PaymentProcess method inside your payment gateway? Specifically the area where you are checking where the TransactionType is Credit.

#259025
Jul 16, 2021 17:56
Vote:
 

Hi Surjit, thanks for replying to me.

I've used the QuickSilver sample site & also PayPal payment gateway plugin provided by Episerver.

I just change the code to return an PaymentUnsuccessfulResult to pretend the situiation that error happen like this:

if (cart == null && orderGroup is IPurchaseOrder)
{
     // When "Refund" shipment in Commerce Manager, this method will be invoked with the TransactionType is Credit
     if (payment.TransactionType == TransactionType.Credit.ToString())
     {
           // Errors happened
           return PaymentProcessingResult.CreateUnsuccessfulResult("some errors happen here");
     }
}

And then after this, the return was completed and a failed credit payment transaction has been created.

#259026
Jul 16, 2021 19:23
Vote:
 

That is out of the ordinary.

Are you using Commerce Manager or Order Management to mark the return as complete?

Both use a different set of methods to call the gateway and move the return status along. Try the other one to see if you experience the same behaviour.

#259027
Jul 16, 2021 21:40
Vote:
 

I've used both Commerce Manager & Order Management.

With Order Management, I return PaymentUnsuccessfulResult it seem like a bug in the Episerver when the Order Management was blank, not thing happen.

And the "completed return when refund fail" issues occcurred when I processed with Commerce Manager.

#259121
Jul 19, 2021 3:06
Vote:
 

I guess from here it feels like you'll need to do some exploratory debugging.

Posting a screenshot of Order Management blank screen would be good to give more context.

Make sure the breakpoint hits at the point where you think the PaymentUnsuccessfulResult is being returning in the PayPal gateway.

Even making sure the payment settings in Commerce Manager are all correct.

#259122
Jul 19, 2021 8:00
Vote:
 

Thank you

<a href = "https://www.sanantoniotruckingpros.com/car-transport-auto-transport-san-antonio">https://www.sanantoniotruckingpros.com/car-transport-auto-transport-san-antonio</a>

#259298
Edited, Jul 22, 2021 14:48
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.