[FIX] payment_mercado_pago: remove dead code

This commit removes code related to refunds that are not implemented in
this version of the Mercado Pago integration.

closes odoo/odoo#92848

Related: odoo/documentation#2149
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
This commit is contained in:
Antoine Vandevenne (anv)
2022-09-01 19:16:27 +02:00
parent 08a7c779cb
commit 7049e4b110
@@ -130,8 +130,7 @@ class PaymentTransaction(models.Model):
payment_id = notification_data.get('payment_id')
if not payment_id:
raise ValidationError("Mercado Pago: " + _("Received data with missing payment id."))
if self.operation != 'refund':
self.acquirer_reference = payment_id
self.acquirer_reference = payment_id
# Verify the notification data.
verified_payment_data = self.acquirer_id._mercado_pago_make_request(
@@ -146,11 +145,6 @@ class PaymentTransaction(models.Model):
self._set_pending()
elif payment_status in TRANSACTION_STATUS_MAPPING['done']:
self._set_done()
# Immediately post-process the transaction if it is a refund, as the post-processing
# will not be triggered by a customer browsing the transaction from the portal.
if self.operation == 'refund':
self.env.ref('payment.cron_post_process_payment_tx')._trigger()
elif payment_status in TRANSACTION_STATUS_MAPPING['canceled']:
self._set_canceled()
else: # Classify unsupported payment status as the `error` tx state.