Mehdi Outagant (MOU) 3b569aed65 [FIX] website_payment: fix Stripe payment base URL configuration
Steps to reproduce:

- Configure a non-ASCII custom domain (Punycode encoded) on a database
(e.g. `test-môu.com` <> `xn--test-mu-y0a.com`).
- Setup test API keys on a Stripe account ("Publishable" & "Secret").
- Install and activate the Stripe payment acquirer (in "Test Mode").
- Go to the Stripe Odoo config (Invoicing > Payment Acquirers > Stripe).
- Configure Stripe API keys and click on the button to "GENERATE YOUR
WEBHOOK" > traceback: `Invalid URL: Non-ASCII characters in URLs must
be percent-encoded in order for the URL to be valid`.
The same error occurs in every interaction with the Stripe API.

The `get_base_url()` refactoring (exactly [1]) introduced a way to get
the most suited URL for a record in the following order:

`record.website_id` > `record.company_id.website_id` > The ICP:
`web.base.url`.

For payment acquirers, and to handle multi-website scenarios, the code
uses the base URL: `httprequest.url_root` which explains why the error
occurs even when the domain name is configured in punycode.

The goal of this commit is to fix this behavior by correctly encoding
the returned base URL.

[1] https://github.com/odoo/odoo/commit/92175d3341b576676a550c60db7c759f71cb17ea

opw-3619608

closes odoo/odoo#149947

X-original-commit: ffb19d0481f623c969266b14dce2b78127ec2391
Signed-off-by: Valentin Chevalier <vcr@odoo.com>
2024-01-18 23:10:29 +00:00
2024-01-16 09:55:28 +00:00
2024-01-16 22:40:02 +00:00
…
…
…
…
…

Build Status Tech Doc Help Nightly Builds

Odoo

Odoo is a suite of web based open source business apps.

The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, ...

Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps.

Getting started with Odoo

For a standard installation please follow the Setup instructions from the documentation.

To learn the software, we recommend the Odoo eLearning, or Scale-up, the business game. Developers can start with the developer tutorials

S
Description
No description provided
Readme LGPL-3.0
3.4 GiB
Languages
Python 49.6%
JavaScript 47.8%
SCSS 2%
CSS 0.3%
HTML 0.2%