Skip to content
Snippets Groups Projects
Commit 737d3b41 authored by Saurabh Choraria's avatar Saurabh Choraria
Browse files

[FIX] payment_stripe: update log when creation of payment intent fails


When the payment method was detached from the customer, trying to pay with the
linked payment token would end up with a crash because Stripe failed to send us
the payment intent, as it could not create it. In that case, a logger error
occurs on the server which creates noise in the sentry.

Error: The creation of the payment intent failed.
Stripe gave us the following info about the problem:
'Your card has insufficient funds.'

The logger is updated to use the 'warning' level instead of the 'error' level.
This change reflects a less severe logging level for cases where the creation
of payment intent fails.

sentry-4363481906

closes odoo/odoo#130802

Signed-off-by: default avatarAntoine Vandevenne (anv) <anv@odoo.com>
parent cc61b926
No related branches found
No related tags found
No related merge requests found
......@@ -248,7 +248,7 @@ class PaymentTransaction(models.Model):
# Extract the error from the response, log it, and set the transaction in error to let
# the calling module handle the issue without rolling back the cursor.
error_msg = response['error'].get('message')
_logger.error(
_logger.warning(
"The creation of the payment intent failed.\n"
"Stripe gave us the following info about the problem:\n'%s'", error_msg
)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment