|
2 | 2 | PayPal
|
3 | 3 | ======
|
4 | 4 |
|
5 |
| -`Paypal <https://www.paypal.com/>`_ is an American online payment provider available worldwide, and |
| 5 | +`Paypal <https://www.paypal.com/>`_ is an American online payment provider available worldwide and |
6 | 6 | one of the few that does not charge a subscription fee.
|
7 | 7 |
|
8 | 8 | .. note::
|
9 | 9 | While PayPal is available in `over 200 countries/regions
|
10 | 10 | <https://www.paypal.com/webapps/mpp/country-worldwide>`_, only `a selection of currencies are
|
11 | 11 | supported <https://developer.paypal.com/docs/reports/reference/paypal-supported-currencies>`_.
|
12 | 12 |
|
13 |
| -Settings in PayPal |
14 |
| -================== |
| 13 | +.. _payment_providers/paypal/configuration-paypal: |
15 | 14 |
|
16 |
| -To access your PayPal account settings, log into PayPal, open the :guilabel:`Account Settings`, and |
17 |
| -open the :guilabel:`Website payments` menu. |
| 15 | +Configuration in PayPal |
| 16 | +======================= |
18 | 17 |
|
19 |
| -.. image:: paypal/paypal-account.png |
20 |
| - :align: center |
21 |
| - :alt: PayPal account menu |
| 18 | +#. `Log into your PayPal Developer Dashboard <https://developer.paypal.com/dashboard/>`_. |
| 19 | +#. Click :guilabel:`Apps & Credentials` and click :guilabel:`Create App`. |
| 20 | +#. Enter an :guilabel:`App Name` and click :guilabel:`Create App`. |
| 21 | +#. Copy the :guilabel:`Client ID` and :guilabel:`Secret` and save them for |
| 22 | + :ref:`later <payment_providers/paypal/configuration-odoo>`. |
22 | 23 |
|
23 | 24 | .. important::
|
24 |
| - Note that for PayPal to work **in Odoo**, the options :ref:`Auto Return <paypal/auto-return>` and |
25 |
| - :ref:`PDT <paypal/pdt>` **must** be enabled. |
| 25 | + If you use customer names or addresses that include accented or non-Latin characters, you |
| 26 | + **must** configure the encoding format of the payment request sent by Odoo to PayPal to avoid |
| 27 | + transaction failures without notice. To do so, access the `PayPal button language encoding |
| 28 | + setting <https://www.paypal.com/cgi-bin/websrc?cmd=_profile-language-encoding>`_, click |
| 29 | + :guilabel:`More Options`, and set the :guilabel:`Encoding` field to :guilabel:`UTF-8`. |
26 | 30 |
|
27 |
| -.. _paypal/auto-return: |
28 |
| - |
29 |
| -Auto Return |
30 |
| ------------ |
31 |
| - |
32 |
| -The **Auto Return** feature automatically redirects customers to Odoo once the payment is processed. |
33 |
| - |
34 |
| -From :guilabel:`Website payments`, go to :menuselection:`Website preferences --> Update --> Auto |
35 |
| -return for website payments --> Auto return` and select :guilabel:`On`. Enter the address of your |
36 |
| -Odoo database (e.g., `https://yourcompany.odoo.com`) in the :guilabel:`Return URL` field, and |
37 |
| -:guilabel:`Save`. |
38 |
| - |
39 |
| -.. note:: |
40 |
| - Any URL does the job. Odoo only needs the setting to be enabled since it uses another URL. |
41 |
| - |
42 |
| -.. _paypal/pdt: |
43 |
| - |
44 |
| -Payment Data Transfer (PDT) |
45 |
| ---------------------------- |
46 |
| - |
47 |
| -:abbr:`PDT (Payment Data Transfer)` allows to receive payment confirmations, displays the payment |
48 |
| -status to the customers, and verifies the authenticity of the payments. From :menuselection:`Website |
49 |
| -preferences --> Update`, scroll down to :guilabel:`Payment data transfer` and select :guilabel:`On`. |
50 |
| - |
51 |
| -.. tip:: |
52 |
| - PayPal displays your **PDT Identity Token** as soon as :ref:`Auto return <paypal/auto-return>` |
53 |
| - and :ref:`Payment Data Transfer (PDT) <paypal/pdt>` are enabled. If you need the **PDT Identity |
54 |
| - Token**, disable and re-enable :guilabel:`Payment data transfer` to display the token again. |
55 |
| - |
56 |
| -PayPal Account Optional |
57 |
| ------------------------ |
58 |
| - |
59 |
| -We advise not to prompt customers to log in with a PayPal account upon payment. It is better and |
60 |
| -more accessible for customers to pay with a debit/credit card. To disable that prompt, go to |
61 |
| -:menuselection:`Account Settings --> Website payments --> Update` and select :guilabel:`On` for |
62 |
| -:guilabel:`PayPal account optional`. |
63 |
| - |
64 |
| -Payment Messages Format |
65 |
| ------------------------ |
66 |
| - |
67 |
| -If you use accented characters (or anything other than primary Latin characters) for customer names |
68 |
| -or addresses, then you **must** configure the encoding format of the payment request sent by Odoo to |
69 |
| -PayPal. If you do not, some transactions fail without notice. |
70 |
| - |
71 |
| -To do so, go to `your production account <https://www.paypal.com/cgi-bin/customerprofileweb |
72 |
| -?cmd=_profile-language-encoding>`_. Then, click :guilabel:`More Options` and set the two default |
73 |
| -encoding formats as :guilabel:`UTF-8`. |
| 31 | + If you are trying PayPal as a test, access your :ref:`PayPal Sandbox account |
| 32 | + <payment_providers/paypal/testing>` and `configure the encoding format for your sandbox account |
| 33 | + <https://sandbox.paypal.com/cgi-bin/customerprofileweb?cmd=_profile-language-encoding>`_. |
74 | 34 |
|
75 | 35 | .. tip::
|
76 |
| - - For Encrypted Website Payments & EWP_SETTINGS error, please check the `Paypal documentation |
77 |
| - <https://developer.paypal.com/docs/online/>`_. |
78 |
| - - Configure your :ref:`Paypal Sandbox account <paypal/testing>`, then follow this |
79 |
| - `link <https://sandbox.paypal.com/cgi-bin/customerprofileweb?cmd=_profile-language-encoding>`_ |
80 |
| - to configure the encoding format in a test environment. |
81 |
| - |
82 |
| -Settings in Odoo |
83 |
| -================ |
84 |
| - |
85 |
| -.. seealso:: |
86 |
| - :ref:`payment_providers/add_new` |
| 36 | + For encrypted website payments & EWP_SETTINGS errors, please check the `PayPal documentation |
| 37 | + <https://developer.paypal.com/docs/online/>`_. |
87 | 38 |
|
88 |
| -Odoo needs your **API Credentials** to connect with your PayPal account. To do so, go to |
89 |
| -:menuselection:`Accounting --> Configuration --> Payment Providers` and :guilabel:`Activate` PayPal. |
90 |
| -Then, enter your PayPal account credentials in the :guilabel:`Credentials` tab: |
| 39 | +.. _payment_providers/paypal/configuration-odoo: |
91 | 40 |
|
92 |
| -- :guilabel:`Email`: the login email address in Paypal; |
93 |
| -- :guilabel:`PDT Identity Token`: the key used to verify the authenticity of transactions. |
| 41 | +Configuration in Odoo |
| 42 | +===================== |
94 | 43 |
|
95 |
| -.. _paypal/testing: |
| 44 | +#. :ref:`Navigate to the payment provider PayPal <payment_providers/add_new>`. |
| 45 | +#. In the :guilabel:`Credentials` tab, enter the :guilabel:`Email` linked to your PayPal account, |
| 46 | + then fill in the :guilabel:`Client ID` and :guilabel:`Client Secret` fields with the values you |
| 47 | + saved at the step :ref:`payment_providers/paypal/configuration-paypal`. |
| 48 | +#. Click :guilabel:`Generate your webhook` to create the :guilabel:`Webhook ID`. |
| 49 | +#. Set the :guilabel:`State` field to :guilabel:`Enabled`, and make sure the PayPal payment provider |
| 50 | + is :guilabel:`Published`. |
| 51 | +#. Configure the remaining options as desired. |
96 | 52 |
|
97 |
| -Test environment |
98 |
| -================ |
| 53 | +.. _payment_providers/paypal/testing: |
99 | 54 |
|
100 |
| -Configuration |
101 |
| -------------- |
| 55 | +Testing |
| 56 | +======= |
102 | 57 |
|
103 |
| -Thanks to PayPal sandbox accounts, you can test the entire payment flow in Odoo. |
| 58 | +PayPal provides two sandbox accounts that you can use to simulate live transactions: |
104 | 59 |
|
105 |
| -Log into the `Paypal Developer Site <https://developer.paypal.com/>`_ using your PayPal credentials, |
106 |
| -which creates two sandbox accounts: |
| 60 | +- A business account (to use as the merchant account, e.g., `ab-1abc12345678@business.example.com`); |
| 61 | +- A default personal account (to use as the shopper account, e.g., |
| 62 | + `ba-9cba87654321@personal.example.com`). |
107 | 63 |
|
108 |
| -- A business account (to use as merchants, e.g., |
109 |
| - `pp.merch01-facilitator@example.com <mailto:pp.merch01-facilitator@example.com>`_); |
110 |
| -- A default personal account (to use as shoppers, e.g., |
111 |
| - `pp.merch01-buyer@example.com <mailto:pp.merch01-buyer@example.com>`_). |
| 64 | +To test the PayPal payment workflow in Odoo: |
112 | 65 |
|
113 |
| -Log into PayPal sandbox using the merchant account and follow the same configuration instructions. |
114 |
| -Enter your sandbox credentials in Odoo (:menuselection:`Accounting --> Configuration --> Payment |
115 |
| -Providers --> PayPal` in the :guilabel:`Credentials` tab, and make sure the status is set on |
116 |
| -:guilabel:`Test Mode`. |
| 66 | +#. Log into the `Paypal Developer Site <https://developer.paypal.com/>`_ using your PayPal |
| 67 | + credentials and go to :menuselection:`Testing Tools --> Sandbox Accounts`. |
| 68 | +#. Click the :icon:`fa-ellipsis-v` (:guilabel:`ellipsis`) icon next to the sandbox business account |
| 69 | + and select :guilabel:`View/Edit account`. |
| 70 | +#. Copy the :guilabel:`Email`, :guilabel:`Client ID`, and :guilabel:`Secret` and save them for the |
| 71 | + next step. |
| 72 | +#. In Odoo, :ref:`configure the PayPal payment provider <payment_providers/paypal/configuration-odoo>` |
| 73 | + with the values saved at the previous step and set the :guilabel:`State` field to |
| 74 | + :guilabel:`Test Mode`. |
117 | 75 |
|
118 |
| -Run a test transaction from Odoo using the sandbox personal account. |
| 76 | +You can then run a test transaction from Odoo using the sandbox personal account. |
119 | 77 |
|
120 | 78 | .. seealso::
|
| 79 | + - :ref:`payment_providers/test-mode` |
121 | 80 | - :doc:`../payment_providers`
|
0 commit comments