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 #159526

Conversation

fw-bot
Copy link
Contributor

@fw-bot fw-bot commented Mar 27, 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: #159433

@robodoo
Copy link
Contributor

robodoo commented Mar 27, 2024

@fw-bot
Copy link
Contributor Author

fw-bot commented Mar 27, 2024

This PR targets saas-16.3 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 27, 2024
@C3POdoo C3POdoo added the RD research & development, internal work label Mar 27, 2024
@fw-bot
Copy link
Contributor Author

fw-bot commented Mar 27, 2024

@alsh-odoo ci/runbot failed on this forward-port PR

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: b945305
@alsh-odoo alsh-odoo force-pushed the saas-16.3-16.0-sentry-5103720097-typeerror-mercado-pago-payment-alsh-DUkg-fw branch from 9e19574 to 45b73e7 Compare March 28, 2024 05:07
@fw-bot
Copy link
Contributor Author

fw-bot commented Mar 28, 2024

@alsh-odoo this PR was modified / updated and has become a normal PR. It should be merged the normal way (via @robodoo)

@alsh-odoo
Copy link
Contributor

@robodoo r+

robodoo pushed a commit that referenced this pull request Mar 28, 2024
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

closes #159526

X-original-commit: b945305
Signed-off-by: Altaf Shaik (alsh) <alsh@odoo.com>
@robodoo robodoo closed this Mar 28, 2024
@fw-bot fw-bot deleted the saas-16.3-16.0-sentry-5103720097-typeerror-mercado-pago-payment-alsh-DUkg-fw branch April 11, 2024 07: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