Commit Graph
527 Commits
Author SHA1 Message Date
Saurabh Choraria de782a680d [FIX] payment_stripe: handle error for unsupported country while stripe setup
Currently, When a user tries to set up a stripe account but his country is not
supported by stripe then he receives a error message at backend side and a
ValidationError ("Stripe Proxy: An error occurred when communicating with
the proxy.") on frontend side.

After applying this commit the error message will be updated to a warning level
which will reduce the noise in sentry. I have also added a condition in
'action_stripe_connect_account' method to check whether the country is
supported by stripe or not and if it is not supported the user will be
redirected to other payment providers page.

sentry-3935758343

closes odoo/odoo#128140

X-original-commit: c7b0d8eebe686d9c38f9f5c71577c80718ffb791
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-07-15 04:01:14 +02:00
Antoine Vandevenne (anv) d41b7a1f48 [CLN] payment(_stripe): cleanup of ee963d10
closes odoo/odoo#127054

Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-07-03 15:37:37 +02:00
Florian Charlier 77f9ff50db [REF] *: use onboarding module
* = account{_payment}, base, onboarding, payment{_stripe},
sale{_management}, web, website_sale

Use the dedicated onboarding module introduced in 16.0 instead of
the res.company model to store onboarding progress.

It allows
 * onboarding steps to be reused across panels
 * to support steps that should be completed per-database or per-company
 * to clean the res.company model from many fields and methods,
 * to remove many views, controllers, actions

Module-specific notes:
* account: We also clean the remaining two steps that are not
part of an accounting panel but make the most sense to be kept here.
* account_payment: Following 8e4e8eb8, the payment provider step is
added to the invoicing onboarding panel. We apply this change here too.
Also impacts the website_sale_dashboard panel (see related ENT PR).
(The "sale tax" one is currently used for to the website sale dashboard).
* payment: Note that the step was already not part of an onboarding
panel within this module.
* website_sale: We clean
  * a field not used (The website_sale dashboard onboarding panel used
  the payment_provider_onboarding_state field).
  * a method that was only called from website_sale_dashboard, so it is
  moved there. See related ENT PR.

Includes a few tests.

Moving views/templates/styling, as well as cleaning residual onboarding-related fields and methods in base, including populate.

This also includes restoring the "onboarding_complete" overlay panel
animating it to disappear after a few seconds so that it doesn't hide
text and block buttons to re-open steps.

Task-3025136

Part-of: odoo/odoo#104223
2023-06-30 23:37:50 +02:00
Valeriya(vchu) 2173c252ad [IMP] payment_(adyen, stripe): webhooks transition from json-rpc to http
to return the response with correct status code as json-rpc returned status code 200 even if there was an error
task-2835711

closes odoo/odoo#117940

Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-05-24 14:27:44 +02:00
Louis Wicket (wil) 04189318cc [I18N] *: update master translations
Currently, only stable releases see their translations updated. This has
resulted in master accumulating outdated stuff for years, which can be
confusing for users testing master on runbot.

This one-shot commit resynchronizes master translations based on the
content from 16.0 and removes empty PO files (i.e. no longer containing
translations).

closes odoo/odoo#121629

Related: odoo/enterprise#41171
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-05-22 17:52:07 +02:00
Brieuc-brd fa60bac197 [IMP] *: app icons : add viewBox attribute
Prior to this commit, the SVG's viewBox attribute was missing, which
prevented svgs from being scaled.

This commit fixes this issue.

task-3326633
Part of task-3326263

X-original-commit: 30300c373ad1c63a6cf8b035cae0785a09c6933f
Part-of: odoo/odoo#121886
2023-05-22 13:54:08 +02:00
Brieuc-brdandElisabeth Dickinson 21d87a3da5 [REF] *: milk graphical assets
- apps icons
- base: replace demo avatars Mitchell, Marc and Joel
- mail: replace odoobot avatar

Part-of: odoo/odoo#116641
Co-authored-by: Elisabeth Dickinson <edi@odoo.com>
2023-05-12 22:59:14 +02:00
Antoine Vandevenne (anv) 1ac7b728cb [FIX] payment_stripe: prevent crash if the payment intent can't be created
When the payment method was detached from the customer, trying to pay
with the linked payment token would end up with a crash because Stripe
failed to send us the payment intent, as it could not create it.

With this commit, we test for the existence of the returned payment
intent and prematurely return in `_send_payment_request` to prevent a
cursor rollback. The transaction is set in 'error' and the error
message is logged in the stdout and on the transaction's state message
field.

closes odoo/odoo#120348

X-original-commit: 4ebf0efc16ef78ca568ef93fb2c36ce404cb0c12
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-05-03 11:16:43 +02:00
Valentin Chevalier f18bdad78a [FIX] payment_stripe: add email for shipping partner
Before this commit, the shipping partner was created without an email
address.

After this commit, the shipping partner will be created with the email
given by the customer on the express checkout form.

closes odoo/odoo#120037

X-original-commit: 527b498811d3e3f83ca64bf58f5c0a882432bf87
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-04-28 12:26:46 +02:00
pedrambiria 30ee75cbff [FIX] payment_stripe: provider_sudo has been changed to provider
After this commit https://github.com/odoo/odoo/commit/e534ab41e7b3b71a8286eba849fd4d70f4b27334 the `provider_sudo` has been refactored to
`provider`. But in the `saas_payment_stripe`, it still uses
`provider_sudo`. So it will cause an error in the saas databases.

opw-3271034

closes odoo/odoo#118748

X-original-commit: 3dde24f28ff338a98e6f88641ab592f0b4e6eba6
Signed-off-by: Valentin Chevalier <vcr@odoo.com>
2023-04-17 14:14:24 +02:00
Antoine Vandevenne (anv) 98a834a8de [FIX] payment_stripe: filter out card PMs if none is linked to the provider
Before this commit, the "Card" payment method would always be shown on
Stripe's hosted checkout form, even if there is no related payment icon
(VISA, MasterCard, Discover, American Express) set as "supported payment
icon" in Odoo.

After this commit, Stripe is instructed to hide the "Card" payment
method if all related payment icons are unset in Odoo. If at least one
related payment icon is set, the "Card" payment method is hidden. If the
"Supported payment icons" field is left completely empty, all payment
methods are available on Stripe.

closes odoo/odoo#116917

X-original-commit: d7e96a771e92020938658cdd4dc4a41c45f1644e
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-03-29 09:33:55 +02:00
Aaron Bohy 1f52c8edd3 [REF] *: remove form_view_initial_mode context key support
The purpose of this key was to force the form view to be in edit
mode directly when opening a record, in specific actions. This is
now automatically the case since form views are always in edit
mode. This commit thus removes the support of the key, and removes
all occurrences where it was set in the codebase.

Part of task 3179751

closes odoo/odoo#115172

Related: odoo/enterprise#38130
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-03-16 14:12:37 +01:00
Demesmaeker 7f2ae9ed5b [IMP] payment(_adyen): allow partial capture
Before this commit, it was not possible to partially capture a
transaction from Odoo, and doing so in the provider backend would often
result in a full capture in Odoo when capture was supported.

With this commit, partial captures are made available in Odoo directly
from the sales order or invoice, for providers that support them.
Provider can either only support full capture or also support partial
ones. It also optionally managed the automatic void of the remaining
amount at the user request when multiple captures are supported by the
provider.

As of now, the only acquirer allowing partial capture is Adyen.

task-2728768

closes odoo/odoo#87251

Related: odoo/enterprise#35205
Related: odoo/documentation#2063
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-03-09 10:51:29 +01:00
Anita (anko) 1d846c36d9 [IMP] payment(_*): allow specifying extra allowed states
Some providers require additional allowed states due to their refund or
transaction process justifying it. Until now, these extra states were
specified in the `payment` module, which was not ideal as it allowed
every provider in every flow to accept these additional states.

With this commit, additional states are now specified only in the
coresponding flow of a provider that requires them.

task-2869678

closes odoo/odoo#107110

Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-02-24 18:16:00 +01:00
Valentin Vallaeys (vava) e534ab41e7 [REF] payment, (website_)sale: factorize payment values logic in controllers
The payment values in the Qweb context of sale, sale_subscription and
website_sale were computed separately, although there is a large common
basis. This split made it hard to communicate between modules and
generated a lot of duplicates. The new function `_get_payment_values`
in sales is now used as a common basis method for all sale_* modules to
get the common payment values.

closes odoo/odoo#107788

Related: odoo/enterprise#34922
Signed-off-by: Vallaeys Valentin (vava) <vava@odoo.com>
2023-02-03 17:40:58 +01:00
Valentin Chevalier 3079ea09db [IMP] payment(_stripe),website_sale_delivery: change express checkout shipping heuristic
Before this commit, when using express checkout, the shipping address
was requested only if the technical module 'delivery' was installed.

Now, over express checkout, the shipping address will be requested if
the sale order contains products that aren't services.

task-3149536

closes odoo/odoo#111796

X-original-commit: 9c16e83336b042ab77c267607ac43e0ef0db9997
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-02-03 09:28:49 +01:00
Denis Ledoux b4a7996e96 [IMP] base, *: change the API of init hooks to pass env
This is mostly a cleaning/refactoring change.

The current API for init hooks (pre, post, uninstall) is to pass
`cr, registry`.
But the first thing which was done by most
post init and uninstall hooks was to create an env using
the cr passed
e.g.
`env = api.Environment(cr, SUPERUSER_ID, {})`
and the `registry` argument was unused in all these hooks,
completely.

By changing the API of hooks to pass `env` instead
of `cr, registry`, we gain in average two lines in every
hooks:
- the line creating the env `env = api.Environment(cr, SUPERUSER_ID, {})`
- the line importing `api` and `SUPERUSER_ID`

Therefore removing ~250 lines of repeated code lines accross odoo/odoo and
odoo/enterprise.
In addition to these lines removed,
it also ease the API of init hooks for Odoo developers,
who are used to that `env` and not so much how to create an `env`
from a cursor.

Part-of: odoo/odoo#108254
2023-02-01 10:25:01 +01:00
Valentin Vallaeys (vava) 956d0d26a3 [IMP] payment_stripe: prevent enabling Stripe if onboarding is ongoing
For now, you can enable the Stripe payment provider while onboarding
with Stripe Connect.

This raises two issues:
- This will raise errors in online payments because Stripe is not
completely configured;
- The button to continue the onboarding is not working anymore,
preventing the user to finish the configuration of his account from
Odoo.

This commit prevents enabling Stripe if the onboarding has been
initiated but is not finished. It also changes the way constants are
read from const.py to allow patching one of them if needed.

OPW-3149159

closes odoo/odoo#111534

X-original-commit: fa3bcac71d1699aa9b9a7bc1d6b6181a70171662
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Signed-off-by: Vallaeys Valentin (vava) <vava@odoo.com>
2023-01-31 21:16:56 +01:00
Anita (anko) 5cc86c3bb1 [IMP] payment: Rename Payment Icon to Payment Method.
Payment Icon sounds confusig comparing to what it really is,
payment method name makes it clearer for user to understand
what it is.

task-2882564

closes odoo/odoo#105678

Related: odoo/enterprise#33908
Related: odoo/upgrade#4029
Related: odoo/documentation#2955
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-01-20 18:54:44 +01:00
Yas-Elak cea588b1ed [FIX] payment_stripe: Limit phone number to 20 characters
Before this commit, the string with the phone number sent to Stripe for the request is not checked and we got this error on the checkout page
---------------------
We are not able to process your payment.
Stripe: The communication with the API failed. Stripe gave us the following info about the problem: 'Invalid string: +1 555-555...5678456789; must be at most 20 characters'
-----------------------
The stripe API does not accept phone numbers with more than 20 characters
The problematic phone number are mostly the one with extention: +1 780-459-5656 ext. 725
But the customer can put anything in the phone field when he buys some product via eCommerce
Now I just limit the phone string to 20 characters, this doesn't affect the res.partner

If the customer had a phone with more than 20 characaters in the res.partner form, it will stay that way. It's only for the stripe request

closes odoo/odoo#109834

X-original-commit: d24cc320854f180989949328396dbbd8ac69bdc9
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-01-13 17:33:14 +01:00
Abdelouahab (abla) 608aa8ca88 [FIX] payment_stripe: use idempotency key only when offline
To Reproduce
============
- on a db with sales, website and Stripe payment aquirer activated
- on the portal of a user add two payment methods, an expired card
and a valid one
- create a SO and generate its payment link
- try to pay with the invalid card first -> and error (card was declined)
- try to pay with the valid card -> error (same idempotency key)

Problem
=======
the generation of the idempotency key is based only on dbuuid, transaction's
reference and the scope. So in this use case it will generate the same key.

Solution
========
The idempotency key prevents issues where the customer is charged twice for
the same thing. In this case, we don't want to prevent anything since the
customer is on the page. It's suggested to use idempotency keys only for offline
payment when the customer is not in front of the payment page (e.g. when the cron
charges the customer for his subscription)

opw-3091354

closes odoo/odoo#108163

X-original-commit: 089387087010ae917494d5072f00d72c572b7d09
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Signed-off-by: abla001 <abla@odoo.com>
2022-12-16 14:49:58 +01:00
niyasraphy ef7005f524 [IMP] *: remove useless keys from manifests
Remove most values uselessly specified because giving the same value as
the default one (see _DEFAULT_MANIFEST in odoo/modules/module.py)

auto_install is Falsy by default
author is Odoo SA by default
summary & description are empty strings by default
application is False by default
test, demo, depends and data are empty lists by default
This will reduce noise/inconsistencies between manifests specifications,
simplify analysis of manifests content.

closes odoo/odoo#106686

Related: odoo/enterprise#34462
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2022-11-29 13:20:31 +01:00
Jeremy Kersten 5172efc434 [FIX] *: remove flag Application on some apps
We decided to make this list as feature and not application.
It allows any user in mode OneAppFree to use them without become an
Extra App.

List of apps impacted:
    blog
    forum
    all payments acquirer

task-3062641

closes odoo/odoo#106487

X-original-commit: 8b1928b3ef0e098b193ac74084344eba5beac4db
Related: odoo/enterprise#34368
Signed-off-by: Thibault Francois <tfr@odoo.com>
2022-11-25 17:56:15 +01:00
Valentin Chevalier 1e025adbf3 [IMP] payment_stripe: adjust the code for Stripe Connect
task-2982347

X-original-commit: fc890dc6e91a6731bf31a40ee77dad0f8697f5b4
Part-of: odoo/odoo#104387
2022-10-28 09:17:56 +02:00
mafo-odoo e9234fd52c [FIX] payment_stripe: add idempotency key to prevent multiple payments
Video 1 (Issue): https://drive.google.com/file/d/1oXYcDJgaT9gmhkjE08yJlXwIL1qPwS1Y/view?usp=sharing

Issue:
When using the register payment with a token with any of the payment acquirers,
if there is a concurrent access error during the reconciliation process,
the payment intent is sent multiple times to the acquirer, making the card charged multiple times.

Steps to reproduce:

-Have a V14 database (only tested this version) with sale_mmanagement, payment_stripe and invoicing
-Configure Stripe with your public and secret key (2FA is now enforced for Stripe accounts, therefore,
 we don't have a generic test account anymore. You have to create your own.It is quite fast and easy to do)
-Have a portal user PU with an already registered payment token PT
-Go to Invoicing
-Create a new invoice I:
-Customer PU
-Add anything in invoice lines
-Confirm I
-Register a payment for I:
-Journal: Stripe
-Saved Payment token: PT
AT THIS STEP, YOU MUST ENSURE A CONCURRENT ACCESS ERROR WILL RAISE DURING THE RECONCILIATION
-Create Payment

Log analysis:
A first payment intent is sent to Stripe. The card is charged and Stripe answers that all went as expected.
We try to process the payment, but a concurrent access error occurs.
A retry is done.
A payment intent is sent again to Stripe, The card is charged AGAIN and Stripe answers that all went as expected.
We try to process the payment, but a concurrent access error occurs.

For each retry, the intent is sent and the card is charged.

If the first retry succeeds, then Odoo can finish the process. There will be only 1 payment transaction on Odoo's side
(others have been rollbacked) but there will be 3 on Stripe's side and the card will be charged 3 times.

This PR mitigate this behaviour.
It doesn't address the root cause but by adding the idempotency key to the headers with the hash of the transaction
reference and the database UUID, we prevent mutliple payments to happen.

OPW-2662964

closes odoo/odoo#103515

X-original-commit: 5fe1c1bbba4d754eed7e8927b82752969d6f563d
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-10-20 10:19:55 +02:00
Horacio Tellez c49c747bdb [IMP] payment(_*): uniformize all modules name, summary, and sequences
Before this commit, most of these modules had a custom sequence
number intended to sort them in the Apps' kanban view. In reality, the
sort on the module name makes the custom sequence useless. This commit
thus sets all of these modules' sequences to `350`.

In an effort for uniformization, we also made names and summaries more
generic, and removed the descriptions which did not add any value.

Task - 2960976

closes odoo/odoo#103131

X-original-commit: 75397daa2fff1a027af7a3cb008e6cbc828645fc
Related: odoo/enterprise#32752
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-10-12 08:33:40 +02:00
Valentin Chevalier 754570b1d8 [REF] payment(_stripe): cleanup express checkout implementation
Fine-tuning of c624ed5603.

task-3004118

closes odoo/odoo#103125

X-original-commit: 158bc7ef9e20c46a5e9870e70d76e866147662b0
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-10-12 04:35:48 +02:00
Antoine Vandevenne (anv) c4b78c203a [CLN] payment(_*): clean view hooks and split files per model
When the payment views were updated with commit odoo/odoo@f7b8f075, a
hook was improperly renamed to `code`, which doesn't help to figure out
its purpose. This commit renames it to `provider_credentials` which
better fits its role.

While doing so, the view files are also renamed and/or split by model to
increase their readability.

closes odoo/odoo#102976

X-original-commit: 49d126d4fce18761d0261adac00e115b840b9b47
Related: odoo/enterprise#32662
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-10-11 13:16:07 +02:00
mafo-odoo dc1cddb577 [FIX] payment_stripe: allow payment for client without mail
Problem: If you have a customer assigned to an invoice/quotation
without an e-mail address and then share a payment link with
the customer. If the customer clicks on 'Pay', he won't be
redirected to Stripe's checkout page. He'll get instead 'Invalid
e-mail address: False' (see the image attached).

Explanation:
When there is no e-mail address defined, Odoo sends 'False' to
Stripe but Stripe sees it as the e-mail address which is indeed
Invalid. To solve the issue we replace False by None for the email
value of a customer without email address.

opw-3007866

closes odoo/odoo#102867

X-original-commit: 647a5fd79b88d4ea00eca2d6c1f9d9a2259a8414
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Signed-off-by: Fockedey Martin (mafo) <mafo@odoo.com>
2022-10-10 15:09:47 +02:00
Laurent Desausoi 7593c073d2 [IMP] core: use inert SQL based neutralization
Before this commit the neutralize system introduced in v16 was using ORM
methods in order to change appropriate records. Although flexible, this approach
could lead to call some methods with side effects while neutralizing
(eg: overloads of write).

This patch converts the neutralize system to a safer "inert" SQL based approach
by migrating the generic method _neutralize to SQL files exposed in the
data folder.

Task id: 2961687

closes odoo/odoo#102792

X-original-commit: e5dbded9bb363351feff7ca8a56c7f8a6860f492
Related: odoo/enterprise#32580
Signed-off-by: Fabien Meghazi <fme@odoo.com>
2022-10-09 22:04:00 +02:00
Antoine Vandevenne (anv) 0cbbe5a744 [FIX] payment_stripe: adapt a view to work without a group element
This commit replaces the `group` element containing the "Connect Stripe"
button by a `div` element to allow it to contain more elements than the
button without having the elements' `attrs` conflicting with each other.

task-2982357

closes odoo/odoo#102579

X-original-commit: f99b067dbfedca361605f0fc63c7913333950b64
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-10-08 08:48:45 +02:00
Damien Bouvy cbd04638f6 [FIX] payment_stripe: grid form compat
X-original-commit: 281731c1ca517aa3c4e37032a69e82adc72ebc46
Part-of: odoo/odoo#102424
2022-10-06 19:03:53 +02:00
Horacio Tellez a7ddc7af78 [FIX] payment_stripe: validation operations treated incorrectly
When saving a payment method from the `my/payment_method` page
validation is used as the type of operation. In the present
validation operations were incorrectly filtered and treated as a
payment.
After this commit validation operations are processed in the
`_stripe_create_checkout_session` function as it should.

Task - 3001168

closes odoo/odoo#101923

X-original-commit: 7f371db1af160a5e89f9476540aee35f79769068
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-10-03 15:19:21 +02:00
Valentin Vallaeys (vava) 536a74b6b0 [CLN] payment(_*): remove useless refund parameter
*: adyen, authorize, demo, razorpay, stripe.

The param `create_refund_transaction` from `_send_refund_request` became
useless following this commit:
https://github.com/odoo/odoo/commit/e4c63126b45854b10f08ab14dee5eb1d4ed98bb0

It was only used for Authorize.net, which now works without calling this
param.

task-2869910

closes odoo/odoo#101105

X-original-commit: 6855d65df7a83037ee5e2202966fa4e67dae7d5a
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-09-26 13:41:47 +02:00
Valentin Chevalier 049d817a58 [FIX] payment_stripe: show Allow Express Checkout when supported
Before this commit, when Stripe was installed, all providers would
display the option `Allow Express Checkout`.

Now, the `Allow Express Checkout` field is only shown on providers that
support this feature, even if Stripe is installed.

Part-of: odoo/odoo#99846
2022-09-09 18:53:54 +02:00
Horacio Tellez f7b8f07501 [IMP] payment: rename of acquirer to provider
Changing the name of model payment.acquirer to payment.provider
and everything that it touches. It is technically incorrect to
use the term "acquirer" for systems that only provide a service
of payment.
After this commit the model payment.acquirer and all related to
it will be renamed to payment.provider.

Task - 2842088

closes odoo/odoo#90899

Related: odoo/upgrade#3542
Related: odoo/documentation#1981
Related: odoo/enterprise#27131
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2022-09-09 13:38:08 +02:00
Victor Feyens 4d6bd1ce33 [REF] payment_*: adapt to payment changes 2022-09-06 13:32:19 +02:00
Horacio Tellez 24f33c0282 [IMP] payment: rework the kanban view of acquirers
The present kanban view of acquirers is not the most appealing
one. It is full of useless information (e.g. "online payment") and the
combination of provider logos makes it look "old".

After this commit, the kanban view will hopefully have a "cool" and
concise look simular to the "Apps"'s kanban view.

Task - 284171

closes odoo/odoo#98345

Related: odoo/enterprise#30585
Related: odoo/upgrade#3803
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2022-09-05 14:50:11 +02:00
Valentin Chevalier c624ed5603 [IMP] payment(_stripe), website_sale(_delivery): support express checkout
This commit enables eCommerce customers to pay with the express payment
methods Apple Pay and Google Pay from the cart page.

For the moment, only Stripe supports this additional feature but it
was designed to make it easy to implement with a new provider.

task-2754209

closes odoo/odoo#88374

Related: odoo/enterprise#29915
Related: odoo/documentation#2392
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-09-05 14:49:33 +02:00
Laura Schauer c1b41bcd08 [IMP] payment(_*): allow dynamic token name
Before this commit, tokens were prefixed with usually 12 X’s. To improve
readability, modernity and to shorten the length, this commit changes
token prefixes to a standard of •••• 1111.

task-2832669

closes odoo/odoo#94978

Related: odoo/upgrade#3738
Related: odoo/enterprise#29190
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-08-19 14:28:08 +02:00
Antoine Vandevenne (anv) a5ce999d76 [IMP] payment_stripe: allow passing contextual request data to the proxy
For modules that fully implement Stripe Connect, i.e. that sign requests
with their own API keys, there was no way to pass contextual data to the
proxy when making those requests.

This commit addresses the issue by populating the `proxy_data` param
present in all proxy's routes' signatures with an extendable `dict`.

task-2917229

closes odoo/odoo#96279

X-original-commit: 5df308c58e02c9ca3287c124c0df4e359817ce16
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-07-19 10:29:54 +02:00
Thibault Libioulle 9eb8ea52e0 [IMP] website_payment: handle stripe supported countries
This commit warns company from countries not supported by Stripe to
activate Stripe from the settings page.

This commit also enable the Stripe Connect Onboarding from the website
settings page.

task-2789227

closes odoo/odoo#87562

Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-06-28 18:25:00 +02:00
Martin Trigaux 5acb6db891 [I18N] *: export saas-15.4 source terms
closes odoo/odoo#93246

X-original-commit: 5ff6d185f70650c26c28a6aef7dd37c859ab58d2
Related: odoo/enterprise#28218
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-06-10 07:27:26 +02:00
Victor Feyens 5e93a231c2 [FIX] payment_stripe: running tests with python 3.7
mock.call_args only provides the args/kwargs feature in 3.8+

closes odoo/odoo#90716

Related: odoo/enterprise#27253
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-05-31 19:17:20 +02:00
Victor Feyens 987b0d49f9 [IMP] payment: clean test utils
All utilitary test methods will be private, to clearly separate
test methods and utils.

Task - 2848326

Part-of: odoo/odoo#90716
2022-05-31 19:17:20 +02:00
Antoine Vandevenne (anv) cfbd8990a3 [FIX] payment_*: update module sequences to be placed after Flutterwave
task-2759117

closes odoo/odoo#85514

Related: odoo/documentation#1939
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-05-31 16:02:08 +02:00
Valentin Chevalier 930b6860d7 [IMP] payment_stripe: support refund
Allows users of Stripe to refund their customers directly from Odoo.

task-2678763

closes odoo/odoo#92235

Related: odoo/documentation#2086
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-05-25 12:46:08 +02:00
Demesmaeker 86ff8c6e8f [REF] payment(_*): compute feature fields
Computing the fields instead of storing them allows to implement the
feature for each provider more easily, without needing a migration
script.

task-2841744

closes odoo/odoo#91961

Related: odoo/enterprise#27618
Related: odoo/upgrade#3535
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-05-24 19:10:55 +02:00
Thibault LibioulleandAntoine Vandevenne 4cdc00f418 [FIX] payment_stripe: turn credentials helper methods into functions
This commit removes the access to stripe credentials through model
helper methods.

closes odoo/odoo#87972

X-original-commit: 61faa2b32880d60c8cfb7c7761cd313383c26a0b
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Signed-off-by: Thibault Libioulle (tle) <tle@odoo.com>
Co-authored-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-04-05 15:17:31 +02:00
Thibault Libioulle 2e7cc0d82f [IMP] payment{,_stripe},{,website_}sale: clean up stripe connect code
This commit removes deprecated actions and methods kept after the merge
of PR #79621 in stable.

Follow-up
task-2685160

closes odoo/odoo#84789

Related: odoo/upgrade#3256
Related: odoo/enterprise#25369
Signed-off-by: Thibault Libioulle (tle) <tle@odoo.com>
2022-03-29 08:57:43 +02:00