From 45c839deaa45225b3613805aebf88e167535bc71 Mon Sep 17 00:00:00 2001 From: nie Date: Thu, 22 Apr 2021 13:33:30 +0000 Subject: [FIX] payment_stripe_sca, *: use setup_future_usage when saving card *: account_payment, payment, sale Steps: - Install eCommerce - Go to Website / Configuration / eCommerce / Payment Acquirers - Configure Stripe: - Save Cards: Always - Payment Flow: Redirection to the acquirer website - Go to /shop - Add a product to the cart - Process Checkout - Select Stripe - Pay Now - Enter test data in Stripe Checkout form (https://stripe.com/docs/testing#cards) - Pay - Go to /shop - Add a product to the cart - Process Checkout - Select your saved card - Pay Now Bug: Stripe Error: The provided PaymentMethod was previously used with a PaymentIntent without Customer attachment, shared with a connected account without Customer attachment, or was detached from a Customer. It may not be used again. To use a PaymentMethod multiple times, you must attach it to a Customer first. Explanation: https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-payment_intent_data-setup_future_usage > Indicates that you intend to make future payments with the payment > method collected by this Checkout Session. According to this doc, `setup_future_usage` must be set in order to use the saved card afterwards. opw:2452452 opw:2498571 opw:2509897 closes odoo/odoo#69772 X-original-commit: 43e666f21f488067cf09a994fba7782271446b84 Signed-off-by: backspac --- addons/payment/controllers/portal.py | 1 + 1 file changed, 1 insertion(+) (limited to 'addons/payment') diff --git a/addons/payment/controllers/portal.py b/addons/payment/controllers/portal.py index 5fcc0147ab7..906424265cd 100644 --- a/addons/payment/controllers/portal.py +++ b/addons/payment/controllers/portal.py @@ -306,6 +306,7 @@ class WebsitePayment(http.Controller): render_values = { 'partner_id': partner_id, + 'type': tx.type, } return acquirer.sudo().render(tx.reference, float(amount), int(currency_id), values=render_values) -- cgit v1.2.3