From 80edfc069fb43f129cb947c9bcadfa72ee31b357 Mon Sep 17 00:00:00 2001 From: far-mastercore Date: Thu, 28 Jan 2021 14:09:52 -0300 Subject: [PATCH 1/2] [FIX] AttributeError with 'payment.acquirer' --- payment_todopago/models/payment_transaction.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/payment_todopago/models/payment_transaction.py b/payment_todopago/models/payment_transaction.py index f1bc5a09..75332c84 100644 --- a/payment_todopago/models/payment_transaction.py +++ b/payment_todopago/models/payment_transaction.py @@ -75,10 +75,10 @@ def _todopago_form_validate(self, data): return True # we need to get answer form todopago todopago_client_id = self.acquirer_id.todopago_client_id \ - if self.acquirer_id.self.state == 'enabled' \ + if self.acquirer_id.state == 'enabled' \ else self.acquirer_id.todopago_test_client_id todopago_secret_key = self.acquirer_id.todopago_secret_key \ - if self.acquirer_id.self.state == 'enabled' \ + if self.acquirer_id.state == 'enabled' \ else self.acquirer_id.todopago_test_secret_key answer_data = { From b02d9060d0cbf02520f040a595bff8524b7f7c38 Mon Sep 17 00:00:00 2001 From: far-mastercore Date: Wed, 3 Feb 2021 13:10:47 -0300 Subject: [PATCH 2/2] [IMP] Catch approved response for 2 cards payment --- payment_mercadopago/models/payment_transaction.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/payment_mercadopago/models/payment_transaction.py b/payment_mercadopago/models/payment_transaction.py index 949bff2a..fdc6cdb6 100644 --- a/payment_mercadopago/models/payment_transaction.py +++ b/payment_mercadopago/models/payment_transaction.py @@ -68,7 +68,7 @@ def _mercadopago_form_validate(self, data): 'mercadopago_txn_id': data.get('merchant_order_id', False), # otros parametros que vuevlven son 'collection_id' } - if status in ['approved', 'processed']: + if status in ['approved', 'approved,approved', 'processed', 'processed,processed']: _logger.info( 'Validated MercadoPago payment for tx %s: set as done' % ( self.reference))