diff options
| author | Levi Siuzdak (sile) <sile@odoo.com> | 2025-02-04 10:30:37 +0000 |
|---|---|---|
| committer | Levi Siuzdak (sile) <sile@odoo.com> | 2025-02-06 10:43:56 +0000 |
| commit | a6a5381b8fdffc736962ea2ca860f63aaf142d3d (patch) | |
| tree | ab420c66fa0b2e07335f30e0499763f1d6a0484b | |
| parent | 83a92605dca3b4a5930d75af9b0ae27e47070227 (diff) | |
[FIX] payment_adyen: log refusal reason for refused payments
Versions
--------
- 17.0+
Steps
-----
1. Enable Adyen as payment provider in test mode;
2. do an eCommerce checkout;
3. select Adyen as payment option;
4. use the following card details:
- Number: 4111111111111111
- expiry: 03/30
- cvc: 737
- name on card: CARD_EXPIRED
5. click Pay Now;
6. check order chatter on the backend.
Issue
-----
> Error: Adyen: Received data with invalid payment state: Refused
Refusal shouldn't be an invalid payment state.
Cause
-----
Commit 04f75728fd3e accidentally removed an `elif` branch that was added
by commit 4d340a330462e specifically to handle refused payments.
Solution
--------
Re-add the `elif` branch.
opw-4481602
closes odoo/odoo#196680
X-original-commit: e0e34292d85d784560000126446f8cc33413f1ef
Signed-off-by: Morgane Demesmaeker <edm@odoo.com>
| -rw-r--r-- | addons/payment_adyen/models/payment_transaction.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/addons/payment_adyen/models/payment_transaction.py b/addons/payment_adyen/models/payment_transaction.py index 6087eda2767..bad2d7cea6e 100644 --- a/addons/payment_adyen/models/payment_transaction.py +++ b/addons/payment_adyen/models/payment_transaction.py @@ -460,6 +460,7 @@ class PaymentTransaction(models.Model): self._log_message_on_linked_documents(_( "The capture of the transaction with reference %s failed.", self.reference )) + elif payment_state in const.RESULT_CODES_MAPPING['refused']: _logger.warning( "the transaction with reference %s was refused. reason: %s", self.reference, refusal_reason |
