From 2f51b84313b4452abcc6e38f501daaafd60f3504 Mon Sep 17 00:00:00 2001 From: Valentin Chevalier Date: Thu, 28 Mar 2024 10:56:29 +0100 Subject: [PATCH] [FIX] payment_stripe: incorrect flow mentionned in readme closes odoo/odoo#159788 X-original-commit: 5948e821ce87b78f74150184aa806a43429ae821 Signed-off-by: Valentin Chevalier --- addons/payment_stripe/README.md | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/addons/payment_stripe/README.md b/addons/payment_stripe/README.md index 83b0bb674ae..b423291f965 100644 --- a/addons/payment_stripe/README.md +++ b/addons/payment_stripe/README.md @@ -6,16 +6,26 @@ SDK: [Stripe.js](https://stripe.com/docs/js) version `3` API: [Stripe API](https://stripe.com/docs/api) version `2019-05-16` -This module integrates Stripe using a custom implementation of the payment with redirection flow: no -redirect form is rendered and, instead, a Checkout Session object is created from the server before -the customer is redirected to the session's payment page from the front-end. This is achieved by -following the [Stripe-hosted page](https://stripe.com/docs/checkout/quickstart) guide. +This module relies on the Web Elements SDK to render the list of available payment methods and their +payment detail inputs on the payment form. The JS and CSS assets of the SDK are loaded on the pages +where the form is visible using a script tag. + +When the Web Elements need to fetch/push information from/to Stripe or when a payment operation +(e.g., refund, offline payment) is executed from the backend, a server-to-server API call is made to +the appropriate API endpoint. + +This is achieved by following the [Collect payment details before creating an Intent] +(https://docs.stripe.com/payments/accept-a-payment-deferred) guide. It is preferred over the +recommended "Payment Element" where payment intent is created beforehand because the +`payment.transaction` object doesn't exist yet when the form is rendered, so we don't have any +reference to communicate to Stripe. Also, all the methods to create Stripe objects +(e.g., intents or customers) are defined on the `payment.transaction`​ object. The module also offers a quick onboarding thanks to the Stripe Connect platform solution. ## Supported features -- Payment with redirection flow +- Direct payment flow - Webhook notifications - Tokenization with or without payment - Full manual capture