Commit Graph
573 Commits
Author SHA1 Message Date
Denis Ledoux 89df4b5faa [FIX] payment_ogone: better error reason when payment is declined
Before this revision, when a payment was declined,
for instance because the authorization is declined by the bank,
or the credit card amount limit is exceeded,
the error was marked as
"Received data with invalid payment status: 2"
which is not very meaningful for the users.

This revision aims to set the reason why the payment
was declined with the meaningful error from ogone.

closes odoo/odoo#80742

X-original-commit: 758f94a173379ba7bd22813b2050e3a6f98210a9
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
2021-12-02 12:55:38 +00:00
Horacio Tellez 5badb3fca8 [IMP] payment(_*): normalize logs across all acquirers
The logs for payments contain the transaction reference whenever possible.
Before logs for transactions contained the reference or the id of the
transaction in an inconsitent way. No transactions are identified by
reference whenever possible.

The logs for payments for the same function on different acquirers should
have the same format. Same flow step for different acquirers had
information passed in different formats. Now at each step of a transaction
flow log messages have the same format regardless of the acquirer.

Overall the payment logs should have an uniform format. Hopefully
understanding log messages related to transactions should be easier, as
now log format is independent of the acquirer and transaction are easily
identified by reference.

Task - 2545450

closes odoo/odoo#79547

Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2021-11-29 15:40:54 +00:00
Demesmaeker e0233a1010 [IMP] payment(_adyen): allow to refund confirmed transactions
Before this commit, it was not possible to refund a payment from Odoo.
Users had to go through the payment acquirer's backend and update the
payment accordingly in Odoo.

With this commit, refunds are made available in Odoo directly from the
payment form, for acquirers that support them. Acquirer can either only
support full refunds or also support partial refunds.

As of now, the only acquirer allowing refunds is Adyen, with partial
refund support.

task-2527891

closes odoo/odoo#70881

Related: odoo/upgrade#2689
Related: odoo/enterprise#19829
Signed-off-by: Antoine Vandevenne (anv) <AntoineVDV@users.noreply.github.com>
2021-08-23 10:54:17 +00:00
Nicolas (vin) f7b45aa032 [FIX] payment: suitable payment token and acquirer fix
Fix two issues:

The search of suitable payment token was searching on the journal_id
field of the payment acquirer that is no longer stored.
Change it to now search on the acquirer_id directly, since we have
this information.

The _inverse_journal_id method on payment acquirers would create
new payment line with the manual payment method when no provider
are given to an acquirer, or no payment method is existing for
a given provider. This would cause issues with the creation of
multiple line with the same name on a same journal, which would
trigger the constrains blocking that.

closes odoo/odoo#74990

X-original-commit: a3a2fcb0b299fafbf359ec9015da5c85cdb57b3a
Related: odoo/enterprise#20193
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2021-08-12 07:56:16 +00:00
Antoine Vandevenne (anv) e9ee1d2cb4 [REM] payment_ogone: remove unused Flexcheckout views
Commit 3d90d02 removed the integration with the Flexcheckout API but the
dedicated views were left behind, as it was not possible to remove them
in stable version.

This commit removes the unused views in master.

task-2494916

closes odoo/odoo#74505

Related: odoo/upgrade#2699
Signed-off-by: Antoine Vandevenne (anv) <AntoineVDV@users.noreply.github.com>
2021-07-30 14:11:54 +00:00
Xavier-Do 288595f558 [FIX] *: add explicit license to all manifest
The license is missing in most enterprise manifest so
the decision was taken to make it explicit in all cases.
When not defined, a warning will be triggered starting from
14.0 when falling back on the default LGPL-3.

closes odoo/odoo#74245

Related: odoo/design-themes#48
Related: odoo/enterprise#19862
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2021-07-26 13:09:57 +00:00
Antoine Vandevenne (anv) a5bdad89f2 [REM] payment_ogone: remove the FlexCheckout API
Before this commit, the FlexCheckout API was used to process validation
operations only. It proved itself to be:
- unusable without making small payments with immediate refunds
- badly suited to PSD2 due to its Merchant Initiated Transactions (MIT)
- not worth the maintenance cost tied to its complexity given the simple
  flow that it implements
- inconvenient to integrate to standard payment flows
- poorly customizable in regard to the hosted tokenization page

This commit thus removes it entirely and drops Ogone's support for
validation operations with it.

task-2494916
2021-07-26 13:40:59 +00:00
Xavier Morel d60f73985b [FIX] payment_ogone: markupsafe HTML_ANSWER 2021-07-20 05:37:41 +00:00
Martin Trigaux 6758868731 [I18N] *: export saas-14.4 source terms
Without demo data

closes odoo/odoo#73560

X-original-commit: 802e46541117573e028b711ea33dad9df9075a39
Related: odoo/enterprise#19602
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-07-12 10:57:37 +00:00
Jeremy Kersten 478068c829 [IMP] *: always use Odoo Response
This branch adds request.redirect on all requests.
In case of a front end request, we do an url_for to the location.

We removed redirect_with_hash that was only for retro compatibility

local_redirect has been renamed to redirect_query, and param keep_hash has been
removed and moved.

Default code for redirect is 303 now instead of 302.

Now redirect and redirect_query make local redirect by default, you need to
pass local=False to make external redirect.

All werkeug.utils.redirect has been replaced by request.redirect.

Http.redirect now use an http.Response type, and it become easy to add an
override like 'set_cookies' e.g.

Dispatch of a website.page return an http.response too, so we first need to
check if it is a cached version before to check if it is an Odoo Response.

Migrate your code:

http.redirect -> request.redirect(location, code, local)
http.local_redirect -> request.redirect_query(location, query, code, local)
http.redirect_with_hash -> request.redirect

Courtesy of odony for help and review ;)

closes odoo/odoo#72599

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-07-08 07:00:06 +00:00
Antoine Vandevenne (anv) 1b2c7cbb43 [FIX] payment, payment_ogone: bring back the Hosted Payment Page API
With commit 139dd9d, the Hosted Payment Page API of Ogone was entirely
replaced by the FlexCheckout API. This new API allows customers to
tokenize a payment method for a later use without the need of making a
purchase. However, it proved itself to be less convenient for regular
purchases as it offers less payment options than the HPP, and payments
are no longer cardholder-initiated transactions but merchant-initiated
transactions which have a higher chance of triggering an authentication
check. Furthermore, the payment flow itself is more complicated than
before.

This commit brings back the Hosted Payment Page API to work in parallel
with the FlexCheckout API and the other APIs that were left untouched.
It will be exclusively used for making online payments with a new card.
The validation flow is managed by the FlexCheckout API while the
DirectLink API manages the payment by token and offline payment flows.

task-2494916

closes odoo/odoo#72991

X-original-commit: 4fa7b772c71979f61eb098ff8d005deba834527c
Signed-off-by: Toufik Benjaa (tbe) <tbe@odoo.com>
Signed-off-by: Antoine Vandevenne (anv) <AntoineVDV@users.noreply.github.com>
2021-06-30 12:18:50 +00:00
Antoine Vandevenne (anv)andToufik Ben Jaa 16b6217378 [FIX] payment_ogone: add backward compatibility for DirectLink URLs
As it is possible to hard-code the DirectLink URLs used by Odoo in the
backend of Ogone, some users might encounter payment issues after
migrating to 14.3+ if they did not replace those URLs by the new ones.

This commit adds back the URLs that were used by DirectLink prior to
14.3 and allows requests to target both the new and the old URLs.

task-2494916

closes odoo/odoo#72566

X-original-commit: 16ee2651ba7f537e3644da2fd80595896e3421fc
Signed-off-by: Antoine Vandevenne (anv) <AntoineVDV@users.noreply.github.com>
Co-authored-by: Toufik Ben Jaa <tbe@odoo.com>
2021-06-22 16:48:29 +00:00
Antoine Vandevenne (anv) 1f0a6167d6 [FIX] payment_{ogone,payulatam}: use the document name in the reference
Before this commit, the implementation of Ogone and PayU Latam's
requirements regarding the transaction reference was preventing the
computation of the reference prefix from being based on the related
document (invoice, SO).

This commit attempts to compute the reference based on the document if
no reference prefix is provided, before applying the said requirements.

task-2494916

closes odoo/odoo#72291

X-original-commit: f18a1d67b769ea69a07fb3c0343e092038df5c93
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2021-06-17 13:32:07 +00:00
Toufik Ben Jaa 7d438f6bc7 [FIX] payment_ogone: SHA sign incorrect with non ISO charset
- Re-introduce the changes added by commit 783a8e22a9
 - It seems like Ogone has a bug on their side. Even when configuring
   the encoding to UTF-8 on their back office, when signing a request
   containing non ISO characters the signature we send do not match
   the one computed by Ogone.

   By calling the URLs suffixed with `_utf8` the issue is fixed.

closes odoo/odoo#71672

X-original-commit: f435ad2d69c7910139cd3ea6a47576399fb4d882
Signed-off-by: Antoine Vandevenne (anv) <AntoineVDV@users.noreply.github.com>
Signed-off-by: Toufik Benjaa (tbe) <tbe@odoo.com>
2021-06-03 11:06:14 +00:00
Nicolas (vin) 04522f01e6 [IMP] account: allows multiple payment acquirers on a journal.
Users may want to be able to have transactions coming from multiple
payment acquirers to be registered in the same journal.

This will allows that.

Task id #2414749

closes odoo/odoo#67331

Related: odoo/upgrade#2500
Related: odoo/enterprise#17258
Signed-off-by: William André (wan) <wan@odoo.com>
2021-06-03 10:00:26 +00:00
Romain Derie 92175d3341 [IMP] *: replace web.base.url ICP by helper method
Previous commit introduce an helper to get the most suited URL for a record
instead of always using the ICP, which is not correct in a website context.

This commit replaces calls to ICP by the helper method.

Community: https://github.com/odoo/odoo/pull/68201
Enterprise: https://github.com/odoo/enterprise/pull/17538
Upgrade: https://github.com/odoo/upgrade/pull/2372

task-2476101
2021-06-02 10:04:29 +00:00
Laurent Smet 41438824f7 [FIX] payment*: Make tests inheriting of AccountTestInvoicingCommon
This makes tests independant of any demo data and ensure the company configuration is always consistent.
2021-05-18 05:18:52 +00:00
Antoine Vandevenne (anv) e2db444a1f [FIX] payment_ogone: accept tokenizing cards with missing number
In Ogone's backend, it is possible to remove `CARD.CARDNUMBER` from
Flexcheckout's feedback data (Configuration -> Technical information ->
Transaction feedback -> Alias gateway and Tokenization -> Dynamic
parameters). Since this is the configuration that was suggested to Odoo
customers migrating from a previous version, we must be able to process
feedback data when the card number is missing.

This commit creates an anonymous card number ('XXXX...') if one is not
provided by Ogone.

task-2494916

closes odoo/odoo#70896

X-original-commit: 272c4259624d88e2d061c6418109d4e0c2dbfb2d
Signed-off-by: Antoine Vandevenne (anv) <AntoineVDV@users.noreply.github.com>
2021-05-17 15:25:40 +00:00
Martin Trigaux 41d8b8cf68 [I18N] *: export saas-14.3 source terms
closes odoo/odoo#70673

X-original-commit: bcb9ff784e44462384b0a43a0a23eed7a1111bc5
Related: odoo/enterprise#18269
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-05-11 12:28:28 +00:00
Antoine Vandevenne (anv) 395b0d2e89 [FIX] payment_ogone: swap SHA-IN key with SHA-OUT in signature check
The key that should be used to check the signature of incoming (Ogone to
Odoo) communication should be `ogone_shakey_out`. For an outgoing
communication, the signature should be generated with `ogone_shakey_in`.

This commit swaps the IN key with the OUT key in signature calculations
to use the appropriate key for a given communication.

The opportunity is also taken to go back to using SHA1 for signature
computation rather than SHA256 that was introduced with 61a02a73 in
order to ease the migration of existing users. Keeping SHA256 would have
required users to make the switch on Ogone's backend.

task-2494916

closes odoo/odoo#70280

X-original-commit: 91782fa29ce597d3985221b76a0d16993facb53e
Signed-off-by: Antoine Vandevenne (anv) <AntoineVDV@users.noreply.github.com>
2021-05-03 16:33:30 +00:00
Antoine Vandevenne (anv) c902e02317 [FIX] payment(_*), account_payment: fix post-refactoring issues
account_payment:
  - Processing fees computation was done based on the wrong country.
payment:
  - The acquirer's cancel message was missing from the
    /payment/confirmation page.
  - `redirect_form_view_id` field was declared with attribute 'name'
    instead of 'string'.
  - Uninstalling a payment acquirer would fail with a traceback.
  - The first acquirer was not automatically selected if it was the only
    selectable payment option of a 'manage' payment form.
  - Specifying a preferred acquirer to the /payment/pay page would show
    not acquirer at all if the preferred option was incompatible with
    the constraints, rather than falling back on showing all acquirers.
payment_adyen:
  - When the value of the API URL fields is malformed (e.g., missing the
    "https://"), clicking on the confirm button raised a traceback.
payment_ogone:
  - There was a typo in the return route.
payment_paypal:
  - PayPal acquirers were not filtered out if the currency was not not
    supported.
  - Returning to the webshop without paying would raise a traceback.

task-2494916

closes odoo/odoo#69996

X-original-commit: 4f7e463fb8b13506caa8aff0beeef5eb0720bf00
Related: odoo/enterprise#17997
Signed-off-by: Antoine Vandevenne (anv) <AntoineVDV@users.noreply.github.com>
2021-04-28 11:39:26 +00:00
Arnaud JosetandAntoine Vandevenne 61a02a7330 [REF] payment_ogone: migrate Ogone to the new payment API
In this commit, we take the opportunity to replace the previous unsecure
API with the new FlexCheckout API that implements payment methods
validation in a hosted page. Payment processing is still done with the
DirectLink API.

This commit also renames the module `payment_ingenico` to
`payment_ogone` as well as the referring strings ("Ogone" instead
of "Ingenico", ...).
A dedicated [MOV] commit is not used because neither the [MOV] commit
nor the adapted [REF] would be valid on its own.

See the merge commit for more details.

task-2333029
task-2313907
task-2334015

Co-authored-by: Antoine Vandevenne <anv@odoo.com>
2021-03-30 09:25:51 +02:00
Victor FeyensandWilliam Andre f1ae1675a0 [MOV] payment_ogone --> payment_ingenico
Co-Authored-By: William Andre <wan@odoo.com>
2019-08-12 08:44:25 +00:00
Sébastien Theys f0ffbea173 [IMP] *: remove unnecessary image sizes
The big images are probably never going to be used for the following models:

- pos category
- fleet brand
- livechat channel
- mail channel
- payment acquirer

And if big images are needed some day the model should use image.mixin instead.

PR: #34925
2019-08-02 16:47:58 +00:00
Christophe Simonis d5e1fd16b4 [MERGE] forward port branch saas-12.4 up to cda4f3c308 2019-07-29 14:10:30 +02:00
Christophe Simonis bfd34e14b1 [MERGE] forward port branch saas-12.3 up to 40e8b67179 2019-07-26 15:12:29 +02:00
Martin Trigaux a98427834e [MERGE] Forward port of saas-12.2 to saas-12.3 up to 860ab5a1c2
closes odoo/odoo#35119

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-24 10:32:23 +00:00
Martin Trigaux e266c7c98a [MERGE] Forward port of 12.0 to saas-12.2 up to 5e4c1b3701 2019-07-23 13:41:00 +02:00
Odoo Translation Bot 72339a5301 [I18N] Update translation terms from Transifex 2019-07-21 01:18:28 +02:00
Odoo Translation Bot eaeb75a3fb [I18N] Update translation terms from Transifex 2019-06-23 06:15:20 +02:00
Odoo Translation Bot 48a9f5a633 [I18N] Update translation terms from Transifex 2019-06-16 06:15:35 +02:00
Odoo Translation Bot 53b6ab9f05 [I18N] Update translation terms from Transifex 2019-06-23 01:17:13 +02:00
Martin Trigaux 52936ec260 [I18N] *: export saas-12.3 source terms
closes odoo/odoo#34068

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-06-12 12:39:50 +00:00
Raphael Collet caf900e89e [FIX] *: use auth='public' in controllers that use request.env
The following trick used to work, because `sudo()` was actually making
an environment for the superuser to operate upon:

request.env[...].sudo().method(...)

It no longer works in general, since `sudo()` now makes an environment
in superuser mode but with `uid=None`!  It may still work by accident
for operations that never use `env.uid`, but is broken in general.

Using `auth='public'` fixes the problem by using the public user when no
user is available.

closes odoo/odoo#34297

Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
2019-07-04 11:32:22 +00:00
Odoo Translation Bot 28382b76d8 [I18N] Update translation terms from Transifex 2019-06-02 01:18:32 +02:00
Odoo Translation Bot 15187da85a [I18N] Update translation terms from Transifex 2019-06-02 06:06:25 +02:00
Odoo Translation Bot 78b3b650b0 [I18N] Update translation terms from Transifex 2019-05-05 06:07:56 +02:00
Christophe Simonis 5dbf7bf357 [MERGE] forward port branch saas-12.1 up to f00c490be8 2019-03-26 10:33:26 +01:00
Olivier Dony 28a1371035 [FIX] payment_ogone: send client info in S2S tx data
The client IP and email are useful pieces of information for auditing
transactions, and are used by the Fraud Detection Module(s) of Ingenico.

closes odoo/odoo#32058

Signed-off-by: Toufik Benjaa (tbe) <tbe@odoo.com>
2019-03-22 18:35:28 +00:00
Odoo Translation Bot 1b932b339a [I18N] Update translation terms from Transifex 2019-03-24 06:23:04 +01:00
Martin Trigaux 04370bff18 [I18N] export saas-12.2 source terms
closes odoo/odoo#31985

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-03-20 14:59:50 +00:00
Christophe Simonis 6b4758cd9a [MERGE] forward port branch saas-12.2 up to 7c1a9a8204 2019-03-27 14:29:01 +01:00
Odoo Translation Bot ec4ee14c89 [I18N] Update translation terms from Transifex 2018-12-09 01:16:26 +01:00
Odoo Translation Bot 1208ac6ce3 [I18N] Update translation terms from Transifex 2018-12-02 01:25:05 +01:00
Odoo Translation Bot c924356d9e [I18N] Update translation terms from Transifex 2019-05-05 01:35:12 +02:00
Odoo Translation Bot 3ac23bef79 [I18N] Update translation terms from Transifex 2019-04-28 01:34:21 +02:00
Odoo Translation Bot 29423872b1 [I18N] Update translation terms from Transifex 2019-03-17 01:22:27 +01:00
Odoo Translation Bot 9d4aad2d67 [I18N] Update translation terms from Transifex 2019-03-10 01:36:03 +01:00
Odoo Translation Bot 77692a84be [I18N] Update translation terms from Transifex 2019-03-03 01:36:23 +01:00
Odoo Translation Bot 917ad03026 [I18N] Update translation terms from Transifex 2019-02-24 01:37:50 +01:00