Skip to content
Snippets Groups Projects
Commit 5ad97677 authored by Abdelouahab (abla)'s avatar Abdelouahab (abla)
Browse files

[FIX] payment_stripe: use idempotency key only when offline


To Reproduce
============
- on a db with sales, website and Stripe payment aquirer activated
- on the portal of a user add two payment methods, an expired card
and a valid one
- create a SO and generate its payment link
- try to pay with the invalid card first -> and error (card was declined)
- try to pay with the valid card -> error (same idempotency key)

Problem
=======
the generation of the idempotency key is based only on dbuuid, transaction's
reference and the scope. So in this use case it will generate the same key.

Solution
========
The idempotency key prevents issues where the customer is charged twice for
the same thing. In this case, we don't want to prevent anything since the
customer is on the page. It's suggested to use idempotency keys only for offline
payment when the customer is not in front of the payment page (e.g. when the cron
charges the customer for his subscription)

opw-3091354

closes odoo/odoo#107723

Signed-off-by: default avatarAntoine Vandevenne (anv) <anv@odoo.com>
parent ac81d3b8
Branches
Tags
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment