[IMP] Payment providers - Stripe: Add missing webhook events

task-3373642

closes odoo/documentation#4732

Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
This commit is contained in:
“Audrey 2023-06-15 12:52:19 +00:00
parent eb68fc18d5
commit 394246d043

View File

@ -18,8 +18,8 @@ The method to acquire your credentials depends on your hosting type:
.. tabs:: .. tabs::
.. group-tab:: Odoo Online .. group-tab:: Odoo Online
#. Go to the **eCommerce** or the **Sales** app and click on the *Activate Stripe* or the *Set #. Go to the **eCommerce** or the **Sales** app and click the :guilabel:`Activate Stripe` or
payments* button on the onboarding banner. the :guilabel:`Set payments` button on the onboarding banner.
#. Fill in the requested information and submit the form. #. Fill in the requested information and submit the form.
#. Confirm your email address when Stripe sends you a confirmation email. #. Confirm your email address when Stripe sends you a confirmation email.
#. At the end of the process, you are redirected to Odoo. If you submitted all the requested #. At the end of the process, you are redirected to Odoo. If you submitted all the requested
@ -34,24 +34,25 @@ The method to acquire your credentials depends on your hosting type:
.. group-tab:: Odoo.sh or On-premise .. group-tab:: Odoo.sh or On-premise
#. Go to the **eCommerce** or the **Sales** app and click on the *Activate Stripe* or the *Set #. Go to the **eCommerce** or the **Sales** app and click the :guilabel:`Activate Stripe` or
payments* button on the onboarding banner. the :guilabel:`Set payments` button on the onboarding banner.
#. Fill in the requested information and submit the form. #. Fill in the requested information and submit the form.
#. Confirm your email address when Stripe sends you a confirmation email. #. Confirm your email address when Stripe sends you a confirmation email.
#. At the end of the process, you are redirected to the payment provider **Stripe** on Odoo. #. At the end of the process, you are redirected to the payment provider **Stripe** in Odoo.
#. :ref:`Fill in your credentials <stripe/api-keys>`. #. :ref:`Fill in your credentials <stripe/api-keys>`.
#. :ref:`Generate a webhook <stripe/webhook>`. #. :ref:`Generate a webhook <stripe/webhook>`.
#. Enable the payment provider. #. Enable the payment provider.
#. You are all set and can continue to :ref:`stripe/local-payment-methods`. #. You are all set and can continue to :ref:`stripe/local-payment-methods`.
.. tip:: .. tip::
To connect your Stripe account after the onboarding is already completed, go to To connect your Stripe account after the onboarding has already been completed, go to
:menuselection:`Accounting --> Configuration --> Payment Providers --> Stripe` and click on the :menuselection:`Accounting --> Configuration --> Payment Providers --> Stripe` and click the
*Connect Stripe* button. :guilabel:`Connect Stripe` button.
.. important:: .. important::
If you are testing Stripe (in **test mode**), change the **State** to *Test Mode*. We recommend If you are testing Stripe (in **test mode**), change the :guilabel:`State` to
doing this on a test Odoo database rather than on your main database. :guilabel:`Test Mode`. We recommend doing this on a test Odoo database rather than on your main
database.
.. _stripe/api-keys: .. _stripe/api-keys:
@ -82,38 +83,40 @@ create a webhook either automatically or manually.
.. tab:: Manage the webhook automatically .. tab:: Manage the webhook automatically
Make sure your :ref:`Publishable and Secret keys <stripe/api-keys>` are filled in, then click Make sure your :ref:`Publishable and Secret keys <stripe/api-keys>` are filled in, then click
on the :guilabel:`Generate your Webhook` button. the :guilabel:`Generate your Webhook` button.
.. tip:: .. tip::
To update the webhook, click once again on the :guilabel:`Generate your Webhook` button. To update the webhook, click once again the :guilabel:`Generate your Webhook` button.
.. tab:: Manage the webhook manually .. tab:: Manage the webhook manually
Visit the `webhooks page on Stripe <https://dashboard.stripe.com/webhooks>`_, or log into your Visit the `webhooks page on Stripe <https://dashboard.stripe.com/webhooks>`_, or log into your
Stripe dashboard and go to :menuselection:`Developers --> Webhooks`. Then, click on Stripe dashboard and go to :menuselection:`Developers --> Webhooks`. Then, click
:guilabel:`Add endpoint` in your :guilabel:`Hosted endpoints` and insert the following data :guilabel:`Add endpoint` and insert the following data in the
into the pop-up form: :guilabel:`Listen to Stripe events` form:
- | In the :guilabel:`Endpoint URL`, enter your Odoo database's URL followed by - | In the :guilabel:`Endpoint URL` field, enter your Odoo database's URL followed by
| `/payment/stripe/webhook`. `/payment/stripe/webhook`.
| For example: `https://yourcompany.odoo.com/payment/stripe/webhook` | For example: `https://yourcompany.odoo.com/payment/stripe/webhook`
- At the bottom of the form, you can select events to listen to. Click on :guilabel:`Select - At the bottom of the form, click :guilabel:`+ Select events`, then:
events`. Then:
- In the :guilabel:`Charge` section, select :guilabel:`charge.refunded` and
:guilabel:`charge.refund.updated`.
- In the :guilabel:`Payment Intent` section, select - In the :guilabel:`Payment Intent` section, select
:guilabel:`payment_intent.amount_capturable_updated` and :guilabel:`payment_intent.amount_capturable_updated`,
:guilabel:`payment_intent.payment_failed` and
:guilabel:`payment_intent.succeeded`. :guilabel:`payment_intent.succeeded`.
- In the :guilabel:`Setup Intent` section, select :guilabel:`setup_intent.succeeded`. - In the :guilabel:`Setup Intent` section, select :guilabel:`setup_intent.succeeded`.
.. note:: .. note::
It is possible to select other events, but they are currently not processed by Odoo. It is possible to select other events, but they are currently not processed by Odoo.
When you click on :guilabel:`Add endpoint`, your Webhook is configured. Click on Once you have selected the events, click :guilabel:`Add events`, then :guilabel:`Add endpoint`
:guilabel:`reveal` to display your signing secret. to generate your webhook. Click :guilabel:`Reveal` to display your signing secret.
.. tip:: .. tip::
To update an existing webhook, click on it. Then, click on the three dots at the right side To update an existing webhook, click on it. Then, click the three dots at the right side
of the **Webhook URL** and on :guilabel:`Update details`. of the **Webhook URL** and select :guilabel:`Update details`.
Configuration tab Configuration tab
----------------- -----------------
@ -127,7 +130,7 @@ Stripe allows you to **capture an amount manually** instead of having an immedia
feature earmarks an amount on the customer's account for a determined period of time that depends on feature earmarks an amount on the customer's account for a determined period of time that depends on
the payment method used. the payment method used.
To set it up, enable the :guilabel:`Capture Amount Manually` option on Odoo, as explained in the To set it up, enable the :guilabel:`Capture Amount Manually` option in Odoo, as explained in the
:ref:`payment providers documentation <payment_providers/features/manual_capture>`. :ref:`payment providers documentation <payment_providers/features/manual_capture>`.
.. warning:: .. warning::
@ -157,10 +160,10 @@ Odoo supports the following local payment methods:
- iDEAL - iDEAL
- Przelewy24 (P24) - Przelewy24 (P24)
To enable some of these local payment methods with Stripe, list them as supported payment icons. To To enable some of these local payment methods with Stripe go to
do so, go to :menuselection:`Payment Providers --> Stripe --> Configuration` and add the desired :menuselection:`Payment Providers --> Stripe --> Configuration` and add the desired payment methods
payment methods in the **Supported Payment Icons** field. If the desired payment method is already in the :guilabel:`Supported Payment Methods` field. If the desired payment method is already listed,
listed, you don't have anything to do. you don't have anything to do.
.. image:: stripe/stripe_enable_local_payment_method.png .. image:: stripe/stripe_enable_local_payment_method.png
:align: center :align: center
@ -169,7 +172,7 @@ listed, you don't have anything to do.
.. note:: .. note::
- If a payment icon record does not exist in the database and its related local payment method is - If a payment icon record does not exist in the database and its related local payment method is
listed above, it is considered enabled with Stripe. listed above, it is considered enabled with Stripe.
- If a local payment method is not listed above, it is not supported and cannot be enabled. - If a local payment method is not listed, it is not supported and cannot be enabled.
.. _stripe/express-checkout: .. _stripe/express-checkout:
@ -187,7 +190,7 @@ be done either automatically from Odoo, or manually from Stripe.
.. tab:: Register automatically from Odoo .. tab:: Register automatically from Odoo
#. Navigate to your payment provider and make sure that it is :guilabel:`enabled`. #. Navigate to your payment provider and make sure that it is :guilabel:`enabled`.
#. Go to the :guilabel:`Configuration` tab and click on the :guilabel:`Enable Apple Pay` #. Go to the :guilabel:`Configuration` tab and click the :guilabel:`Enable Apple Pay`
button. A notification shows that the web domain was successfully registered with Apple. button. A notification shows that the web domain was successfully registered with Apple.
.. tab:: Register manually from Stripe .. tab:: Register manually from Stripe
@ -195,9 +198,9 @@ be done either automatically from Odoo, or manually from Stripe.
Visit the `Apple pay web domains page on Stripe Visit the `Apple pay web domains page on Stripe
<https://dashboard.stripe.com/settings/payments/apple_pay>`_, or log into your Stripe <https://dashboard.stripe.com/settings/payments/apple_pay>`_, or log into your Stripe
dashboard and go to :menuselection:`Settings --> Payments methods --> Apple Pay --> Configure dashboard and go to :menuselection:`Settings --> Payments methods --> Apple Pay --> Configure
--> Web domains`. Then, click on :guilabel:`Add new domain` and insert the web domain of your --> Web domains`. Then, click :guilabel:`Add new domain` and insert the web domain of your
Odoo database into the pop-up form. Odoo already hosts the verification file of Stripe. Click Odoo database into the pop-up form. Odoo already hosts the verification file of Stripe. Click
on :guilabel:`Add` to register your web domain with Apple. :guilabel:`Add` to register your web domain with Apple.
.. important:: .. important::
This operation must be repeated whenever your web domain changes. This operation must be repeated whenever your web domain changes.