Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FW][FIX] payment_mercado_pago: fix traceback when the payment status is 404 #159613

Conversation

fw-bot
Copy link
Contributor

@fw-bot fw-bot commented Mar 28, 2024

This traceback arises when the payment status is 404.

A comma at the end is forgotten while creating a tuple with a single record,
which leads to a type error traceback.

Error:- "TypeError: 'in ' requires string as left operand, not int"

TRANSACTION_STATUS_MAPPING = {
'pending': ('pending', 'in_process', 'in_mediation', 'authorized'),
'done': ('approved', 'refunded'),
'canceled': ('cancelled', 'null'),
'error': ('rejected'),

elif payment_status in TRANSACTION_STATUS_MAPPING['error']:
status_detail = verified_payment_data.get('status_detail')
_logger.warning(
"Received data for transaction with reference %s with status %s and error code: %s",
self.reference, payment_status, status_detail
)

sentry-5103720097

Forward-Port-Of: #159526
Forward-Port-Of: #159433

This traceback arises when the payment status is 404

A comma at the end is forgotten while creating a tuple with single
record, which leads to a typeerror traceback.

Error:- "TypeError: 'in <string>' requires string as left operand, not int"

https://github.com/odoo/odoo/blob/7e3267fc69324a3c98d36983705a50420b5143f9/addons/payment_mercado_pago/const.py#L35-L39

sentry-5103720097

X-original-commit: 9094afe
@robodoo
Copy link
Contributor

robodoo commented Mar 28, 2024

@fw-bot
Copy link
Contributor Author

fw-bot commented Mar 28, 2024

This PR targets 17.0 and is part of the forward-port chain. Further PRs will be created up to master.

More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port

@robodoo robodoo added the forwardport This PR was created by @fw-bot label Mar 28, 2024
@C3POdoo C3POdoo added the RD research & development, internal work label Mar 28, 2024
@robodoo robodoo closed this in 9cdeaf7 Mar 28, 2024
@fw-bot fw-bot deleted the 17.0-16.0-sentry-5103720097-typeerror-mercado-pago-payment-alsh-dP9e-fw branch April 11, 2024 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
forwardport This PR was created by @fw-bot RD research & development, internal work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants