Skip to content

[IMP] payment, *: payment methods overhaul#120446

Closed
AntoineVDV wants to merge 4 commits intoodoo:masterfrom
odoo-dev:master-pm-overhaul-anv
Closed

[IMP] payment, *: payment methods overhaul#120446
AntoineVDV wants to merge 4 commits intoodoo:masterfrom
odoo-dev:master-pm-overhaul-anv

Conversation

@AntoineVDV
Copy link
Copy Markdown
Contributor

@AntoineVDV AntoineVDV commented May 3, 2023

[CLN] payment(_*): correct code styling inconsistencies

This commit mainly removes the extra indent level left over after commit 8ec2e8c. It also cleans up purely cosmetic code styling inconsistencies.


[FIX] payment(_*): make a proper usage of async and promises

Several functions were:

  • called with await while there are synchronous;
  • declared as synchronous while they should have been asynchronous;
  • declared as synchronous but their overrides were async;
  • explicitly encapsulating their return values in a Promise when it was unnecessary.

This commit also cleans up a few mistakes in comments and docstrings.


[REM] payment: remove unused payment method icons and SCSS rules


[IMP] payment, *: replace providers with payment methods in payment forms

Before this commit, the payment providers (e.g., Stripe, Adyen...) available for payment were displayed on the payment forms. The customer had to select one to process their payment. After that, the customer had to select their preferred payment method (e.g., Credit Card, Bancontact...) from a list of payment methods supported by the selected provider over which the website administrator had close to no control. This was making the payment forms confusing because the payment methods were displayed sometimes more than once, if at all, in a non-controlled order, and behind the selection of a payment provider that customers should not have to deal with.

As the payment method was selected in an iframe or directly on the provider's website, the information on the selection payment method was not available in Odoo. This posed many problems, among which were the impossibility of assessing whether a specific feature (e.g., tokenization, refunds, manual capture...) was available, not being able to easily identify payment tokens through the payment method logo, listing available payment methods on the website, sorting and fine-grained configuration of the available payment method, subpar payment method-specific display on the payment form (e.g., PayPal that requires displaying a "Pay with PayPal" button), etc.

In this commit, the payment providers are thus replaced by the payment methods on the payment forms. All contextually available (depending on the country, currency, requested feature...) payment methods are displayed one after the other on a single-level list and in the order configured by the website administrator. Each payment method is "powered by" (i.e., linked) to a single payment provider: the first one, by model order, to support it. This allows, for example, offering the PayPal payment method through Mollie, which charges low processing fees, while also offering Klarna through Stripe, which supports more payment methods but charges higher processing fees.

While doing so, the two different payment forms, "Checkout" and "Manage", are also merged together in a new, configurable case-by-case, payment form that is entirely redesigned to offer a better user experience.

After payment, the information on the selected payment method is saved on the transaction and eventual payment record and updated with the information received from the provider.


task-2882677

See also:

@robodoo
Copy link
Copy Markdown
Contributor

robodoo commented May 3, 2023

Pull request status dashboard

@C3POdoo C3POdoo added the RD research & development, internal work label May 3, 2023
@AntoineVDV AntoineVDV force-pushed the master-pm-overhaul-anv branch 5 times, most recently from 1a90e7b to 8c2f771 Compare May 8, 2023 12:50
@AntoineVDV AntoineVDV force-pushed the master-pm-overhaul-anv branch 4 times, most recently from 588c092 to f846376 Compare May 16, 2023 14:14
@AntoineVDV AntoineVDV force-pushed the master-pm-overhaul-anv branch 3 times, most recently from 066095f to 65db3ab Compare May 23, 2023 15:53
@AntoineVDV AntoineVDV force-pushed the master-pm-overhaul-anv branch 3 times, most recently from 6976256 to 5343d4e Compare May 30, 2023 15:35
@AntoineVDV AntoineVDV force-pushed the master-pm-overhaul-anv branch 5 times, most recently from cc52a03 to ba85f7c Compare June 22, 2023 10:14
@AntoineVDV AntoineVDV force-pushed the master-pm-overhaul-anv branch 4 times, most recently from a01db20 to cfbc2c2 Compare June 30, 2023 14:32
@AntoineVDV AntoineVDV force-pushed the master-pm-overhaul-anv branch 4 times, most recently from 7fbddd6 to 4f6ddda Compare August 10, 2023 16:20
@AntoineVDV AntoineVDV force-pushed the master-pm-overhaul-anv branch 3 times, most recently from 4ceae7c to 8017cc3 Compare September 18, 2023 12:22
@AntoineVDV AntoineVDV force-pushed the master-pm-overhaul-anv branch 6 times, most recently from 6efd159 to bc59d6a Compare September 20, 2023 14:43
@AntoineVDV AntoineVDV changed the title [IMP] payment(_*): payment methods overhaul [IMP] payment, *: payment methods overhaul Sep 20, 2023
@AntoineVDV AntoineVDV force-pushed the master-pm-overhaul-anv branch from bc59d6a to 36b8c83 Compare September 20, 2023 14:55
@AntoineVDV AntoineVDV marked this pull request as ready for review September 20, 2023 14:59
@C3POdoo C3POdoo requested review from a team September 20, 2023 15:23
@AntoineVDV
Copy link
Copy Markdown
Contributor Author

@robodoo rebase-ff

@robodoo override=ci/security
Reason: All reported security concerns were already known and had been ruled out. They are due to only either variables renamed on the same line or functions moved from one file to another.
Link to ci/security build: https://runbot.odoo.com/runbot/batch/1173794/build/51201600

@robodoo
Copy link
Copy Markdown
Contributor

robodoo commented Sep 20, 2023

Merge method set to rebase and fast-forward.

AntoineVDV and others added 4 commits September 22, 2023 09:42
This commit mainly removes the extra indent level left over after commit
odoo/odoo@8ec2e8cf. It also cleans up purely cosmetic code styling
inconsistencies.

task-2882677
Several functions were:
- called with `await` while there are synchronous;
- declared as synchronous while they should have been asynchronous;
- declared as synchronous but their overrides were async;
- explicitly encapsulating their return values in a `Promise` when it
  was unnecessary.

This commit also cleans up a few mistakes in comments and docstrings.

task-2882677
…orms

Before this commit, the payment providers (e.g., Stripe, Adyen...)
available for payment were displayed on the payment forms. The customer
had to select one to process their payment. After that, the customer had
to select their preferred payment method (e.g., Credit Card,
Bancontact...) from a list of payment methods supported by the selected
provider over which the website administrator had close to no control.
This was making the payment forms confusing because the payment methods
were displayed sometimes more than once, if at all, in a non-controlled
order, and behind the selection of a payment provider that customers
should not have to deal with.

As the payment method was selected in an iframe or directly on the
provider's website, the information on the selection payment method was
not available in Odoo. This posed many problems, among which were the
impossibility of assessing whether a specific feature (e.g.,
tokenization, refunds, manual capture...) was available, not being able
to easily identify payment tokens through the payment method logo,
listing available payment methods on the website, sorting and
fine-grained configuration of the available payment method, subpar
payment method-specific display on the payment form (e.g., PayPal that
requires displaying a "Pay with PayPal" button), etc.

In this commit, the payment providers are thus replaced by the payment
methods on the payment forms. All contextually available (depending on
the country, currency, requested feature...) payment methods are
displayed one after the other on a single-level list and in the order
configured by the website administrator. Each payment method is
"powered by" (i.e., linked) to a single payment provider: the first one,
by model order, to support it. This allows, for example, offering the
PayPal payment method through Mollie, which charges low processing fees,
while also offering Klarna through Stripe, which supports more payment
methods but charges higher processing fees.

While doing so, the two different payment forms, "Checkout" and
"Manage", are also merged together in a new, configurable case-by-case,
payment form that is entirely redesigned to offer a better user
experience.

After payment, the information on the selected payment method is saved
on the transaction and eventual payment record and updated with the
information received from the provider.

task-2882677

Co-authored-by: Anita (anko) <anko@odoo.com>
Co-authored-by: Brieuc-brd <brd@odoo.com>
Co-authored-by: Valeriya (vchu) <vchu@odoo.com>
@AntoineVDV
Copy link
Copy Markdown
Contributor Author

@robodoo r+

@robodoo
Copy link
Copy Markdown
Contributor

robodoo commented Sep 22, 2023

@AntoineVDV linked pull request(s) odoo/upgrade#5103 not ready. Linked PRs are not staged until all of them are ready.

@AntoineVDV
Copy link
Copy Markdown
Contributor Author

@robodoo p=1 (blocking other priority tasks)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

17.0 RD research & development, internal work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants