I have the same problem as this thread: Cancel partial delivery and payment
We have two deliveries, the first delivery is delivered and the related payment is paid. We cancel the second delivery, but the payment is still stuck in reserved. We have a custom payment addon, which implements IPaymentProvider. The CancelPayment
method basically looks like this:
if (!CanCancelCurrentTransaction) return false;
var success = false;
var previousStatus = (short)PaymentInfo.PaymentStatus;
PaymentInfo.SetPaymentStatus((short)PaymentStatus.ExecuteCancel, token);
// ... call payment provider to refund money
if (success)
{
PaymentInfo.SetPaymentStatus((short)PaymentStatus.Cancelled, token);
}
else
{
PaymentInfo.SetPaymentStatus(prevStatus, token);
}
The method is successful, but the PaymentInfo status is stuck as Reserved. No errors or any logging regarding the state transition for the payment.
Litium version: 7.7.9