[FIX] payment_authorize: confirm refunded validation transactions
As validation transactions are authorized rather than captured, they are refunded with a void request. Before this commit, a voided validation transaction was mistakenly flagged as canceled while it should have been confirmed. This commit makes the distinction between a voided regular transaction and a validation transaction. task-2612977 closes odoo/odoo#74581 Signed-off-by: Antoine Vandevenne (anv) <AntoineVDV@users.noreply.github.com>
This commit is contained in:
@@ -132,7 +132,10 @@ class PaymentTransaction(models.Model):
|
||||
if self.tokenize and not self.token_id:
|
||||
self._authorize_tokenize()
|
||||
elif status_type == 'void':
|
||||
self._set_canceled()
|
||||
if self.operation == 'validation': # Validation txs are authorized and then voided
|
||||
self._set_done() # If the refund went through, the validation tx is confirmed
|
||||
else:
|
||||
self._set_canceled()
|
||||
elif status_code == '2': # Declined
|
||||
self._set_canceled()
|
||||
elif status_code == '4': # Held for Review
|
||||
|
||||
Reference in New Issue
Block a user