[IMP] payment_providers/stripe: improve structure and add Enable Apple Pay button

task-3697828

closes odoo/documentation#7641

Signed-off-by: Audrey Vandromme (auva) <auva@odoo.com>
This commit is contained in:
“Audrey 2024-02-02 11:37:29 +01:00
parent c966184d3c
commit dbfcdc22d5
2 changed files with 77 additions and 69 deletions

View File

@ -2,113 +2,117 @@
Stripe Stripe
====== ======
`Stripe <https://stripe.com/>`_ is a United States-based online payment solution provider, allowing `Stripe <https://stripe.com/>`_ is a United States-based online payment solution provider allowing
businesses to accept **credit cards** and other payment methods. businesses to accept **credit cards** and other payment methods.
Link your Stripe Account with Odoo Create your Stripe account with Odoo
================================== ====================================
.. seealso::
- :ref:`payment_providers/add_new`
The method to acquire your credentials depends on your hosting type: 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 #. :ref:`Navigate to the payment provider Stripe <payment_providers/supported_providers>` and
payments* button on the onboarding banner. click :guilabel:`Connect Stripe`.
#. Fill in the requested information and submit the form. #. Go through the setup process and confirm your email address when Stripe sends you a
#. Confirm your email address when Stripe sends you a confirmation email. 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, click :guilabel:`Agree and submit`. If all requested information
information, you are all set and your payment provider is enabled. has been submitted, you are then redirected to Odoo, and your payment provider is enabled.
#. Your can continue to :ref:`stripe/local-payment-methods`. #. :ref:`stripe/local-payment-methods`.
.. tip::
To use your own API keys, :ref:`activate the Developer mode <developer-mode>` and
:ref:`enable Stripe manually <payment_providers/add_new>`. You can then :ref:`Fill in your
credentials <stripe/api_keys>`, :ref:`generate a webhook <stripe/webhook>` and enable the
payment provider.
.. 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 #. :ref:`Navigate to the payment provider Stripe <payment_providers/supported_providers>` and
payments* button on the onboarding banner. click :guilabel:`Connect Stripe`.
#. Fill in the requested information and submit the form. #. Go through the setup process and confirm your email address when Stripe sends you a
#. Confirm your email address when Stripe sends you a confirmation email. confirmation email.
#. At the end of the process, you are redirected to the payment provider **Stripe** on Odoo. #. At the end of the process, click :guilabel:`Agree and submit`; you are then 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. #. Select a :ref:`payment journal <payment_providers/journal>`.
#. You are all set and can continue to :ref:`stripe/local-payment-methods`. #. Set the :guilabel:`State` field to :guilabel:`Enabled`.
#. :ref:`stripe/local-payment-methods`.
.. tip:: .. tip::
To connect your Stripe account after the onboarding is already completed, go to - To use an existing Stripe account, :ref:`activate the Developer mode <developer-mode>` and
:menuselection:`Accounting --> Configuration --> Payment Providers --> Stripe` and click on the :ref:`enable Stripe manually <payment_providers/add_new>`. You can then :ref:`Fill in your
*Connect Stripe* button. credentials <stripe/api_keys>`, :ref:`generate a webhook <stripe/webhook>`, and enable the
payment provider.
.. important:: - You can also test Stripe using the :ref:`payment_providers/test-mode`. To do so, first,
If you are testing Stripe (in **test mode**), change the **State** to *Test Mode*. We recommend `log into your Stripe dashboard <https://dashboard.stripe.com/dashboard>`_ and switch to the
doing this on a test Odoo database rather than on your main database. **Test mode**. Then, in Odoo, :ref:`activate the Developer mode <developer-mode>`,
:ref:`navigate to the payment provider Stripe <payment_providers/supported_providers>`,
:ref:`fill in your API credentials <stripe/api_keys>` with the test keys, and set the
:guilabel:`State` field to :guilabel:`Test Mode`.
.. _stripe/api_keys: .. _stripe/api_keys:
Fill in your credentials Fill in your credentials
------------------------ ------------------------
In case your **API Credentials** are required to connect with your Stripe account, these are the If your **API credentials** are required to connect with your Stripe account, proceed as follows:
credentials that must be completed:
- :ref:`Publishable Key <stripe/api_keys>`: The key solely used to identify the account with Stripe. #. Go to `the API keys page on Stripe <https://dashboard.stripe.com/account/apikeys>`_, or log into
- :ref:`Secret Key <stripe/api_keys>`: The key to sign the merchant account with Stripe. your Stripe dashboard and go to :menuselection:`Developers --> API Keys`.
- :ref:`Webhook Signing Secret <stripe/webhook>`: When you enable your webhook on your Stripe #. In the :guilabel:`Standard keys` section, copy the :guilabel:`Publishable key` and the
account, this signing secret must be set to authenticate the messages sent from Stripe to Odoo. :guilabel:`Secret key` and save them for later.
#. In Odoo, :ref:`navigate to the payment provider Stripe <payment_providers/supported_providers>`.
To retrieve the publishable and secret keys, follow this `link to your API keys #. In the :guilabel:`Credentials` tab, fill in the :guilabel:`Publishable Key` and
<https://dashboard.stripe.com/account/apikeys>`_, or log into your Stripe dashboard and go to :guilabel:`Secret Key` fields with the values you previously saved.
:menuselection:`Developers --> API Keys --> Standard Keys`.
.. _stripe/webhook: .. _stripe/webhook:
Generate a webhook Generate a webhook
------------------ ------------------
In case your **Webhook Signing Secret** is required to connect with your Stripe account, you can If your **Webhook Signing Secret** is required to connect with your Stripe account, you can
create a webhook either automatically or manually. create a webhook automatically or manually.
.. tabs:: .. tabs::
.. tab:: Create the webhook automatically .. tab:: Create 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 *Generate your Webhook* button. :guilabel:`Generate your Webhook`.
.. tab:: Create the webhook manually .. tab:: Create the webhook manually
Visit the `webhooks page on Stripe <https://dashboard.stripe.com/webhooks>`_, or log into your #. Go to the `Webhooks page on Stripe <https://dashboard.stripe.com/webhooks>`_, or log into
Stripe dashboard and go to :menuselection:`Developers --> Webhooks`. Then, click on **Add your Stripe dashboard and go to :menuselection:`Developers --> Webhooks`.
endpoint** in your **Hosted endpoints** and insert the following data into the pop-up form: #. In the :guilabel:`Hosted endpoints` section, click :guilabel:`Add endpoint`. Then, in the
:guilabel:`Endpoint URL` field, enter your Odoo database's URL, followed by
`/payment/stripe/webhook`, e.g., `https://yourcompany.odoo.com/payment/stripe/webhook`.
#. Click :guilabel:`Select events` at the bottom of the form, then select the following
events:
- | In the **Endpoint URL**, enter your Odoo database's URL followed by - in the :guilabel:`Charge` section: :guilabel:`charge.refunded` and
| `/payment/stripe/webhook`. :guilabel:`charge.refund.updated`;
| For example: `https://yourcompany.odoo.com/payment/stripe/webhook` - in the :guilabel:`Payment intent` section:
- At the end of the form, you can **Select events** to listen to. Click on it and, in the :guilabel:`payment_intent.amount_capturable_updated`,
**Checkout** section, select **checkout.session.completed**. :guilabel:`payment_intent.succeeded` and :guilabel:`payment_intent.payment_failed`;
- in the :guilabel:`Setup intent` section: :guilabel:`setup_intent.succeeded`.
#. Click :guilabel:`Add events`.
#. Click :guilabel:`Add endpoint`, then click :guilabel:`Reveal` and save your
:guilabel:`Signing secret` for later.
#. In Odoo, :ref:`navigate to the payment provider Stripe
<payment_providers/supported_providers>`.
#. In the :guilabel:`Credentials` tab, fill the :guilabel:`Webhook Signing Secret` field with
the value you previously saved.
.. note:: .. note::
It is possible to select other events, but they are currently not processed by Odoo. You can select other events, but they are currently not processed by Odoo.
When you click on **Add endpoint**, your Webhook is configured. You can then click on
**reveal** to display your signing secret.
.. _stripe/local-payment-methods: .. _stripe/local-payment-methods:
Enable local payment methods Enable local payment methods
============================ ============================
Local payment methods are payment methods that are only available for certain merchants and Local payment methods are payment methods that are only available for specific providers and for
customers countries and currencies. specific countries and currencies.
Odoo supports the following local payment methods: Odoo supports the following local payment methods for Stripe:
- Bancontact - Bancontact
- EPS - EPS
@ -116,18 +120,22 @@ 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 adapt the list of enabled payment methods, go to the :guilabel:`Configuration` tab and edit the
do so, go to :menuselection:`Payment Providers --> Stripe --> Configuration` and add the desired list of :guilabel:`Supported Payment Icons`.
payment methods in the **Supported Payment Icons** field. If the desired payment method is already
listed, you do not have anything to do.
.. image:: stripe/payments-config.png
:alt: Select and add icons of the payment methods you want to enable
.. 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 automatically 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 above, it is not supported and cannot be enabled.
Enable Apple Pay
================
To allow customers to use the Apple Pay button to pay their eCommerce orders, go to the
:guilabel:`Configuration` tab, enable :guilabel:`Allow Express Checkout`, and click
:guilabel:`Enable Apple Pay`.
.. seealso:: .. seealso::
- :ref:`Express checkout and Google Pay <payment_providers/express_checkout>`
- :doc:`../payment_providers` - :doc:`../payment_providers`
- :doc:`Use Stripe as a payment terminal in Point of Sale <../../sales/point_of_sale/payment_methods/terminals/stripe>`

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB