<feed xmlns='http://www.w3.org/2005/Atom'>
<title>Odoo/addons/payment/controllers/portal.py, branch 14.0</title>
<subtitle>The current checkout of upstream Odoo</subtitle>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/'/>
<entry>
<title>[FIX] payment_stripe_sca, *: use setup_future_usage when saving card</title>
<updated>2021-04-23T15:20:02+00:00</updated>
<author>
<name>nie</name>
<email>nie@odoo.com</email>
</author>
<published>2021-04-22T13:33:30+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=45c839deaa45225b3613805aebf88e167535bc71'/>
<id>45c839deaa45225b3613805aebf88e167535bc71</id>
<content type='text'>
*: 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
&gt; Indicates that you intend to make future payments with the payment
&gt; 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 &lt;backspac@users.noreply.github.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
*: 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
&gt; Indicates that you intend to make future payments with the payment
&gt; 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 &lt;backspac@users.noreply.github.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] payment: link transaction to invoice with payment link</title>
<updated>2021-03-04T18:09:37+00:00</updated>
<author>
<name>nie</name>
<email>nie@odoo.com</email>
</author>
<published>2021-03-01T15:25:01+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=46de40dc54d04139b2319b342a7f0c7cb9318e84'/>
<id>46de40dc54d04139b2319b342a7f0c7cb9318e84</id>
<content type='text'>
Steps:
- Install account,payment
- Go to Invoicing
- Create an invoice
- Click Actions &gt; Generate a Payment Link
- Follow the generated link
- Pay

Bug:
The transaction is not linked to the sale order in the link table
`account_invoice_transaction_rel`

Explanation:
This fix is broadly mimicking the behavior of the sales module regarding
the link of an order to a transaction, adding `invoice_id`s where they
are needed throughout the payment process in order to link the
transaction to the invoice.

opw:2451534

closes odoo/odoo#67289

X-original-commit: 7c6d06fa5858f79f3b22cdeaf74cdc26a642742f
Signed-off-by: Nicolas Lempereur (nle) &lt;nle@odoo.com&gt;
Signed-off-by: backspac &lt;backspac@users.noreply.github.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Steps:
- Install account,payment
- Go to Invoicing
- Create an invoice
- Click Actions &gt; Generate a Payment Link
- Follow the generated link
- Pay

Bug:
The transaction is not linked to the sale order in the link table
`account_invoice_transaction_rel`

Explanation:
This fix is broadly mimicking the behavior of the sales module regarding
the link of an order to a transaction, adding `invoice_id`s where they
are needed throughout the payment process in order to link the
transaction to the invoice.

opw:2451534

closes odoo/odoo#67289

X-original-commit: 7c6d06fa5858f79f3b22cdeaf74cdc26a642742f
Signed-off-by: Nicolas Lempereur (nle) &lt;nle@odoo.com&gt;
Signed-off-by: backspac &lt;backspac@users.noreply.github.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] payment: link to order when not connected</title>
<updated>2021-02-22T15:15:58+00:00</updated>
<author>
<name>nie</name>
<email>nie@odoo.com</email>
</author>
<published>2021-02-19T17:08:50+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=2adc9750fa844f53e05c4b95474daf8ca3755a8e'/>
<id>2adc9750fa844f53e05c4b95474daf8ca3755a8e</id>
<content type='text'>
Steps:
- Install sales,payment
- Go to Sales
- Create a quotation
- Click Actions &gt; Generate a Payment Link
- Browse the link in a private window
- Pay

Bug:
The transaction is not linked to the sale order in the link table
`sale_order_transaction_rel`

Explanation:
When not connected, the user doesn't have the rights to read the order.
This leads `order_id` to be set to `None`:
https://github.com/odoo/odoo/blob/d2f3c9e7975188753fa17c06db3fc5c73c773944/addons/payment/controllers/portal.py#L177-L178
When paying without `order_id`, the app is not able to make a link
with the transactions:
https://github.com/odoo/odoo/blob/d2f3c9e7975188753fa17c06db3fc5c73c773944/addons/payment/controllers/portal.py#L276-L277
This raises problems such as not being able to capture an amount as seen
here:
https://github.com/odoo/odoo/blob/d2f3c9e7975188753fa17c06db3fc5c73c773944/addons/sale/views/sale_views.xml#L254-L257

If we ensure a `partner_id` is present, using `sudo` here shouldn't be a
problem as the data is protected by the token. Everything we get from
`order_id` should already be in the URL.

opw:2451564

closes odoo/odoo#66616

X-original-commit: f1f73fd2f8efdbac18d33d4e0b866ca50a28d537
Signed-off-by: backspac &lt;backspac@users.noreply.github.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Steps:
- Install sales,payment
- Go to Sales
- Create a quotation
- Click Actions &gt; Generate a Payment Link
- Browse the link in a private window
- Pay

Bug:
The transaction is not linked to the sale order in the link table
`sale_order_transaction_rel`

Explanation:
When not connected, the user doesn't have the rights to read the order.
This leads `order_id` to be set to `None`:
https://github.com/odoo/odoo/blob/d2f3c9e7975188753fa17c06db3fc5c73c773944/addons/payment/controllers/portal.py#L177-L178
When paying without `order_id`, the app is not able to make a link
with the transactions:
https://github.com/odoo/odoo/blob/d2f3c9e7975188753fa17c06db3fc5c73c773944/addons/payment/controllers/portal.py#L276-L277
This raises problems such as not being able to capture an amount as seen
here:
https://github.com/odoo/odoo/blob/d2f3c9e7975188753fa17c06db3fc5c73c773944/addons/sale/views/sale_views.xml#L254-L257

If we ensure a `partner_id` is present, using `sudo` here shouldn't be a
problem as the data is protected by the token. Everything we get from
`order_id` should already be in the URL.

opw:2451564

closes odoo/odoo#66616

X-original-commit: f1f73fd2f8efdbac18d33d4e0b866ca50a28d537
Signed-off-by: backspac &lt;backspac@users.noreply.github.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] payment: crash when using payment page</title>
<updated>2020-08-20T11:42:24+00:00</updated>
<author>
<name>Toufik Ben Jaa</name>
<email>tbe@odoo.com</email>
</author>
<published>2020-08-18T13:35:44+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=9df742d3c7c00afb0375317748b66dcdc02327bb'/>
<id>9df742d3c7c00afb0375317748b66dcdc02327bb</id>
<content type='text'>
- The PR https://github.com/odoo/odoo/pull/55122 introduced a typo,
  that breaks the payment page.

opw-2322033

closes odoo/odoo#56204

X-original-commit: 125683bbbb7b1f43bec29bdd07e81886c4e6e139
Signed-off-by: Toufik Benjaa (tbe) &lt;tbe@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- The PR https://github.com/odoo/odoo/pull/55122 introduced a typo,
  that breaks the payment page.

opw-2322033

closes odoo/odoo#56204

X-original-commit: 125683bbbb7b1f43bec29bdd07e81886c4e6e139
Signed-off-by: Toufik Benjaa (tbe) &lt;tbe@odoo.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] payment: fix payment processing via external link</title>
<updated>2020-07-23T08:04:43+00:00</updated>
<author>
<name>Andrea Grazioso (agr-odoo)</name>
<email>agr@odoo.com</email>
</author>
<published>2020-07-01T13:06:12+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=b8df9444162302494d61722af2502139cf5179ce'/>
<id>b8df9444162302494d61722af2502139cf5179ce</id>
<content type='text'>
Select a sales order.
Go to action &gt; generate payment link.
Open private browser, reach the link.

User will receive error message because of access denied to the
res.partner data.

opw-2287534

closes odoo/odoo#54808

X-original-commit: 3b4f3a8ad2880721cf6de9fb08387412df85d356
Signed-off-by: Nicolas Martinelli (nim) &lt;nim@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Select a sales order.
Go to action &gt; generate payment link.
Open private browser, reach the link.

User will receive error message because of access denied to the
res.partner data.

opw-2287534

closes odoo/odoo#54808

X-original-commit: 3b4f3a8ad2880721cf6de9fb08387412df85d356
Signed-off-by: Nicolas Martinelli (nim) &lt;nim@odoo.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] account_payment, payment: filter providers</title>
<updated>2020-06-23T08:27:29+00:00</updated>
<author>
<name>Nicolas Martinelli</name>
<email>nim@odoo.com</email>
</author>
<published>2020-06-19T11:45:10+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=7a4e90de8aef581cb78ddfbd3cb5f5abcc1137ec'/>
<id>7a4e90de8aef581cb78ddfbd3cb5f5abcc1137ec</id>
<content type='text'>
- Install 3 payment providers:
  P1: no countries set
  P2: country set to USA
  P3: country set to Canada
- Activate online payment of invoices
- Create an invoice for portal user A (country of user is USA)
- Login with A
- Pay the invoice

All 3 providers are available, while only 1 &amp; 2 should be available.

The providers are filtered in the sale module, but not in the account
module:

https://github.com/odoo/odoo/blob/586ee04a6296c13868011b3afaca61be5c6ff3c6/addons/sale/controllers/portal.py#L190-L193

The same issue occurs with the direct link `/website_payment/pay`.

We apply the same filtering in all modules.

opw-2279710

closes odoo/odoo#53483

X-original-commit: aaac93b551e2a5f331dd14ee5aefbe4ced173691
Signed-off-by: Nicolas Martinelli (nim) &lt;nim@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- Install 3 payment providers:
  P1: no countries set
  P2: country set to USA
  P3: country set to Canada
- Activate online payment of invoices
- Create an invoice for portal user A (country of user is USA)
- Login with A
- Pay the invoice

All 3 providers are available, while only 1 &amp; 2 should be available.

The providers are filtered in the sale module, but not in the account
module:

https://github.com/odoo/odoo/blob/586ee04a6296c13868011b3afaca61be5c6ff3c6/addons/sale/controllers/portal.py#L190-L193

The same issue occurs with the direct link `/website_payment/pay`.

We apply the same filtering in all modules.

opw-2279710

closes odoo/odoo#53483

X-original-commit: aaac93b551e2a5f331dd14ee5aefbe4ced173691
Signed-off-by: Nicolas Martinelli (nim) &lt;nim@odoo.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] payment,sale: company information in payment wizard link</title>
<updated>2020-05-18T12:07:34+00:00</updated>
<author>
<name>Damien Bouvy</name>
<email>dbo@odoo.com</email>
</author>
<published>2020-05-18T07:50:33+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=34867df7286e188f589c15cef44d758ea5c95a5a'/>
<id>34867df7286e188f589c15cef44d758ea5c95a5a</id>
<content type='text'>
When generating a payment link through the payment link wizard, the
company was previously not included. This could cause accounting issues
if the acquirer displayed to the customer were not part of the same
company as the underlying document that generated the link.

This commit add a new computed field 'company_id' on the wizard model
that gets computed based on the underlying model; this field will be
included in links generated by the wizard to limit the acquirers
displayed to those of the that company, preventing extra acocunting
steps (interco reconciliation).

opw-2254011

closes odoo/odoo#51441

X-original-commit: a6fcd7e0cfec8d4c62620a53b5fa806561e239af
Signed-off-by: Damien Bouvy (dbo) &lt;dbo@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When generating a payment link through the payment link wizard, the
company was previously not included. This could cause accounting issues
if the acquirer displayed to the customer were not part of the same
company as the underlying document that generated the link.

This commit add a new computed field 'company_id' on the wizard model
that gets computed based on the underlying model; this field will be
included in links generated by the wizard to limit the acquirers
displayed to those of the that company, preventing extra acocunting
steps (interco reconciliation).

opw-2254011

closes odoo/odoo#51441

X-original-commit: a6fcd7e0cfec8d4c62620a53b5fa806561e239af
Signed-off-by: Damien Bouvy (dbo) &lt;dbo@odoo.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] payment: float consistency enforcement in access_token generation</title>
<updated>2020-05-05T09:55:15+00:00</updated>
<author>
<name>jerome hanke (jhk)</name>
<email>jhk@odoo.com</email>
</author>
<published>2020-05-04T13:01:12+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=03eea7c4811e7edcccf813d6bb358361b7b685a4'/>
<id>03eea7c4811e7edcccf813d6bb358361b7b685a4</id>
<content type='text'>
Steps to reproduce:
- install sales, ecommerce and payment_authorize
- setup authorize.net (test mode)
- go to sales and select the quotation S00007 (demo data) or create a quotation
with multiple items that add up to a float
- select action &gt; generate a payment link &gt; go to the link &gt; select pay with authorize
- you are redirected to authorize.net use 4111 1111 1111 1111 as card number and 1223
as expiration date &gt; pay
- you are redirected to the odoo payment process page
- wait for the result

Previous behavior:
the user is returned to a 404 error page but the payment went trough

Current behavior:
access_token generation is consistent and will not fail because of
float representation
the user is returned to the "payment confirmed" page

WARNINGS:
- watching the values in vscode prevents bug reproduction
- when setting up authorize.net, do not forget to add your test url to
the account's allowed return urls
- use https for authorize.net connection

opw-2223135

closes odoo/odoo#50633

X-original-commit: 0fe7fa0f95b7393d8829ba4b216d6c41d0c0dc3d
Signed-off-by: mightyjol &lt;jhk-odoo@users.noreply.github.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Steps to reproduce:
- install sales, ecommerce and payment_authorize
- setup authorize.net (test mode)
- go to sales and select the quotation S00007 (demo data) or create a quotation
with multiple items that add up to a float
- select action &gt; generate a payment link &gt; go to the link &gt; select pay with authorize
- you are redirected to authorize.net use 4111 1111 1111 1111 as card number and 1223
as expiration date &gt; pay
- you are redirected to the odoo payment process page
- wait for the result

Previous behavior:
the user is returned to a 404 error page but the payment went trough

Current behavior:
access_token generation is consistent and will not fail because of
float representation
the user is returned to the "payment confirmed" page

WARNINGS:
- watching the values in vscode prevents bug reproduction
- when setting up authorize.net, do not forget to add your test url to
the account's allowed return urls
- use https for authorize.net connection

opw-2223135

closes odoo/odoo#50633

X-original-commit: 0fe7fa0f95b7393d8829ba4b216d6c41d0c0dc3d
Signed-off-by: mightyjol &lt;jhk-odoo@users.noreply.github.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] payment: handle tx in error in /website_payment/pay</title>
<updated>2020-04-22T16:54:27+00:00</updated>
<author>
<name>Damien Bouvy</name>
<email>dbo@odoo.com</email>
</author>
<published>2020-04-16T08:32:20+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=e3021499a4fc1c9d40f2c2f39d601e667e8c3213'/>
<id>e3021499a4fc1c9d40f2c2f39d601e667e8c3213</id>
<content type='text'>
opw-2231276

X-original-commit: 7b62c95d44c0abce9b53b476bb1e65fc873da24d</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
opw-2231276

X-original-commit: 7b62c95d44c0abce9b53b476bb1e65fc873da24d</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] payment: use order company on payment page</title>
<updated>2020-04-06T09:24:28+00:00</updated>
<author>
<name>Toufik Ben Jaa</name>
<email>tbe@odoo.com</email>
</author>
<published>2020-03-16T08:59:48+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=b0cd9c13a0456e22c8dcd3e8f314fa23bf835f81'/>
<id>b0cd9c13a0456e22c8dcd3e8f314fa23bf835f81</id>
<content type='text'>
  - The payment link generated by using the wizard
    `payment.link.wizard` are overriden to generate
    URL linked to sale orders.

    If so, we want the payment acquirer displayed to
    be in the same company as the sale order.

closes odoo/odoo#49018

X-original-commit: 8c299efb6cb4355cec39cdedd8d7c3134f53d199
Signed-off-by: Toufik Benjaa (tbe) &lt;tbe@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
  - The payment link generated by using the wizard
    `payment.link.wizard` are overriden to generate
    URL linked to sale orders.

    If so, we want the payment acquirer displayed to
    be in the same company as the sale order.

closes odoo/odoo#49018

X-original-commit: 8c299efb6cb4355cec39cdedd8d7c3134f53d199
Signed-off-by: Toufik Benjaa (tbe) &lt;tbe@odoo.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
