Commit Graph
77 Commits
Author SHA1 Message Date
Nicolas MartinelliandGert Pellin 9999661cd0 [FIX] payment_authorize: add first name and last name
The `createCustomerProfileRequest` requires a first name and a last
name for several payment processors.

Reference:
https://developer.authorize.net/api/reference/#customer-profiles-create-customer-profile

opw-1878218

Co-authored-by: Gert Pellin <gpe@odoo.com>
2018-09-04 08:25:46 +02:00
Nicolas Martinelli 078c3ec492 [FIX] payment_authorize: remove incorrect fields
`firstName` and `lastName` should be filled in for Australia, but the
implementation is not correct since:
- it assumes that the name is first name + last name, which is not the
  case in all countries (e.g. France)
- it doesn't take into account that the name could be a company name

This reverts commit 26974d4e5f.
2018-08-31 13:37:25 +02:00
Gert Pellin 26974d4e5f [FIX] payment_authorize: add required fields for wespac Australia (#26709)
for the payment processor wespac there are required fields we do not send.

required:
•Card Number
•Expiration Date
•Amount
•First Name
•Last Name
•Address
•City
•State/Province**
•Zip Code (Postal Code/Postcode)**
•Country
•Email

** These fields are optional if the billing address is not in the U.S. or Canada. If the address is in the U.S. or Canada, the two-digit State/Province code must be provided, along with the Zip/Postal Code.
2018-08-31 11:29:38 +02:00
Nicolas Martinelli e9b21c37f4 [FIX] payment_authorize: state code
According to Authorize.net documentation, the state code should only be
used for United States. For the other countries, use the state name
instead.

opw-1854278
2018-06-11 08:11:39 +02:00
Nicolas Martinelli b7462ca224 [FIX] payment_authorize: number of decimals
- Create a SO of 56.16
- Send the payment link to the customer

At payment, the transaction is refused by Authorize because of an
invalid amount.

When looking closely, the data sent to Authorize contains the amount
56.160000000001. This is due to the float representation. To avoid this,
we use `float_repr` instead of `str`.

opw-1832468
2018-04-10 16:05:23 +02:00
Nicolas Martinelli 3a654ce256 [FIX] payment_authorize: ZIP code is optional
The ZIP code is an optional field, therefore we should not block the
user.
2018-03-27 12:55:01 +02:00
Christophe Simonis 4715d7e35a [MERGE] forward port branch saas-15 up to 0d55241185 2018-03-19 19:29:58 +01:00
Christophe Simonis 0d55241185 [MERGE] forward port branch saas-14 up to 82effcca83 2018-03-19 18:26:25 +01:00
Toufik Benjaa 62b80d1da2 [FIX] payment_authorize: crash on invalid expiry date
- This commit fixes crashes occuring when the expiry date for a credit card was invalid.
  Instead of crashing we now warn the customer that the expiry date is invalid.
2018-03-16 18:32:21 +01:00
fda-odoo eefe879a37 [MERGE] fix payment flow with acquirers in e-commerce, invoices and quotations
As some flows were broken, this set of fixs improve the different routes for all acquirers
See commit messages for more information

Thanks to @jpr-odoo for his first implementation and to @tde and @fgi
2018-01-25 13:12:25 +01:00
fda-odoo daf6ab1c87 [FIX] Payment, payment_authorize: show an error if customer doesn't have a complete profil on authorize.net payment.
If the user has no Zip code, country or city, authorize refuse the payment, but Odoo doens't show any error.
The commit invite the user to log in in this case or to fill his missing information
2018-01-24 15:28:53 +01:00
Christophe Simonis 950d9b2369 [MERGE] forward port branch saas-16 up to dfe7f00e78 2018-01-22 16:38:01 +01:00
Christophe Simonis a3d3e5e7fe [MERGE] forward port branch saas-15 up to 50d87ae81b 2018-01-22 14:42:09 +01:00
Christophe Simonis 50d87ae81b [MERGE] forward port branch saas-14 up to 3d673b5900 2018-01-22 13:33:58 +01:00
Atchuthan, Sodexis 171ce8fb2a [FIX] payment_authorize: Credit cards expiration date
- Fixes the validation for credit cards expiration date.

In the courtesy of @SodexisTeam
2018-01-18 15:21:18 +01:00
Adrian Torres 864ca5075f [FIX] authorize: add error-checking
Previous to this commit, if a user hadn't properly set up his
Authorize.net credentials, when getting a response from Authorize.net's
servers, we would expect some attributes to be in the response's body,
but this is not the case if the credentials are wrong, thus we would
have an unexpected error like "NoneType object has no attribute text"
which is only a sympton of the real error (bad credentials and no
error-checking).

This is fixed by checking if the response body contains an error
message, if it is the case we raise an UserError with the error code and
the error message (which is only shown if debug mode is activated).

OPW 788261
2018-01-03 08:39:28 +01:00
Christophe Simonis 42264d8dcb [MERGE] forward port branch saas-16 up to 5d7ad2b16c 2017-11-30 18:43:08 +01:00
Christophe Simonis ab084d580f [MERGE] forward port branch saas-15 up to 98539336a5 2017-11-30 15:27:59 +01:00
Christophe Simonis 98539336a5 [MERGE] forward port branch saas-14 up to b780e4a0e4 2017-11-30 14:44:49 +01:00
Damien Bouvy fc69b37cf7 [FIX] payment_authorize: stop raising on 'Error' authorize status
It seems that Authorize.net returns an 'Error' status when transactions
fail (note that it can also return an Ok status for different types of
failures).

This is incoherent with the way the authorize requests are processed,
since an Error resultCode will raise a ValidationError, rollbacking the
complete cursor transaction. This makes little sense, since there should
be a trace of the payment.transaction in the backend (preferably with an
explanation for the failure).

This fix adds an error processing step to the response handling of
authorize.net - while before, it was assumed that an 'error' result
meant an issue in communication/setup, now it is treated as an error
in payment and the payment.transaction status is set accordingly.

I've added a test for this and it was green (pinky promise), but this
particular test suite is deactivated (or perhaps only on nightly, I need
to check the nightly process with @nim-odoo).
2017-11-27 08:27:53 +01:00
Damien Bouvy 93b5ce67ac Revert "[FIX] payment_authorize: add some debug logging"
This reverts commit fb093726d7.

In my hurry, I forgot part of this debug feature, which made it crash
because I tried to stringify a element instead of a tree
2017-11-20 19:22:56 +01:00
Damien Bouvy fb093726d7 [FIX] payment_authorize: add some debug logging
If not [FIX], then [HELP TO FIX] at least
2017-11-20 16:50:49 +01:00
Christophe Simonis 017ee5eab3 [MERGE] forward port branch saas-17 up to 877e709871 2017-08-24 13:17:53 +02:00
Xavier Morel 481a00dc4b [FIX] P3: hash/hmac payload must be bytes 2017-08-20 23:25:54 +02:00
Xavier Morel 7dd062f835 [FIX] P3: text model types
* remove references to basestring & unicode (use relevant pycompat
  helpers)
* remove some str calls (either entirely or replaced by relevant
  helper, either text or native)
* use better API to avoid unnecessary conversions
* remove some XML declarations in views
2017-08-20 23:25:54 +02:00
Xavier Morel 3824b5dcc1 [FIX] P3: fix base64 and StringIO uses
* StringIO removed from stdlib, replace with io
* try to correctly handle BytesIO/StringIO (one is for bytes the other
  is for text)
* fix base64: Python 3 removed bytes-encoding and bytes-bytes
  codecs (via #encode) so replace all calls to str.encode('base64'),
  also b64encode is a bytes->bytes conversion so attempt to properly
  handle that

issue #8530
2017-08-20 23:25:54 +02:00
Denis Ledoux 22f7b79221 [MERGE] forward port of branch saas-17 up to b970bf865a 2017-08-18 10:44:22 +02:00
tbe-odoo 2df9c22d80 [IMP] Payments & subscriptions: Improved Payments
- When registering a payment token, validating it using a payment of a small amount (~1.50€) followed by a refund allows ensuring
    that the payment method is valid (i.e. checksumming the card number simple ensure the number is valid but not that the card exists).
    This commit introduces a generic approach that must be implemented for each acquirer that has tokenization support.
    This commit also introduces a generic payment token registration/usage template that can be adapted according to one's need.
- Introducing a new payment form that handles payment, deletion and adding payment method (only for server2server for the moment).
- On /my/payment_method, changed strings 'Payment Acquirers' to 'Payment Methods' which is more clear.
- Stripe can now be used to pay subscriptions.
2017-08-14 08:30:59 +02:00
dip-odoo 8af86692ad [IMP] payment_authorize: display Authorize.net Profile ID on payment tokens 2017-08-09 16:58:47 +02:00
Richard Mathot c1a3411bfb [FIX] payment_authorize: record cancellation message on transactions
Courtesy of:
- Foram Katharotiya <fka@odoo.com>
- Kinjal Mehta <kme@odoo.com>
2017-08-09 16:55:53 +02:00
Christophe Simonis 4d5ff6401c [MERGE] forward port branch saas-16 up to b76109173a 2017-07-28 18:37:10 +02:00
Christophe Simonis b76109173a [MERGE] forward port branch saas-15 up to c0ec09e9d5 2017-07-28 18:11:07 +02:00
Christophe Simonis c0ec09e9d5 [MERGE] forward port branch saas-14 up to be77cf7f5f 2017-07-28 17:25:45 +02:00
Thibault Delavallée 55d9c37520 [FIX] payment_authorize: avoid crash when contact ogone without street on partner 2017-07-28 15:07:52 +02:00
Christophe Simonis fa3e89064a [MERGE] forward port branch saas-16 up to 104dfe3c07 2017-07-20 11:48:49 +02:00
Christophe Simonis 6fa9ea14fa [MERGE] forward port branch saas-15 up to b31cd558e5 2017-07-19 18:48:42 +02:00
Christophe Simonis b31cd558e5 [MERGE] forward port branch saas-14 up to b857fd4c90 2017-07-19 17:04:28 +02:00
Nicolas Martinelli ab094e5a80 [FIX] payment_authorize: acquier reference
The field `acquirer_reference` is not a mandatory field. If not
retrieved from the provider, it will have a NULL value in the DB, and
therefore will be `False` in Python.

The `capture` and `void` method will crash in this case, because of:
`etree.SubElement(tx, "refTransId").text = transaction_id`

opw-751231
2017-07-14 16:05:35 +02:00
Christophe Simonis dd43071638 [MERGE] forward port branch saas-16 up to 278e478d55 2017-06-27 14:19:31 +02:00
Christophe Simonis 34b432d528 [MERGE] forward port branch saas-15 up to 4d79a1ff58 2017-06-26 19:19:39 +02:00
Christophe Simonis e1c74e374c [MERGE] forward port branch saas-14 up to 3bac72ba74 2017-06-26 14:04:04 +02:00
Joren Van Onder 91abcdf842 [FIX] payment_*: always read callback_eval as superuser
The callback_eval field has a groups parameter of
base.group_system. Without this patch everyone not part of that group
ends up with an access right error when the system attempts to read
that field.

Previously this was not a problem because all code reading
callback_eval was executed with the superuser already. New code has
been introduced however that does not do this (eg. paying with a
payment.token from the backend).

opw-741181
2017-06-26 11:19:46 +02:00
Christophe Matthieu b21f6e36ce [FIX] payment_authorize: wrong error message because of missing import 2017-06-21 12:11:40 +02:00
Cedric Snauwaert 1b0a8cc595 [FIX] payment_authorize: missing import 2017-06-21 10:44:46 +02:00
Yannick Tivisse 4aa2fad313 [IMP] payment: Remove auto_confirm field and simplify views.
PURPOSE
=======

The field auto_confirm is complicated to understand for common users. Furthermore, on of its options is only useful for authorize module.

SPECIFICATION
=============

Remove the auto_confirm field. The destinies of its options are the following:
- none: Simply disappear.
- authorize: Become capture_manually. It has nothing to do with the auto_confirm field has it's related to the autorize module (And could be extended to other payment acquirers too).
- confirm_so: Remove it. Will be automatic, and we will always validate the sales order and generate the accounting entries on acquirer validation.
- generate_and_pay_invoice: Is linked to the journal_id. The field journal_id is always set and we will use it to validate the sales order and generate the accounting entries on acquirer validation.

Bonus: website_sale: Allow to create/validate invoice automatically on `Mark as Paid`
2017-06-02 15:31:47 +02:00
Olivier Dony 5d2869cbc8 [MERGE] Forward-port saas-16 up to ba15df47cb 2017-06-01 01:46:13 +02:00
Olivier Dony ba15df47cb [MERGE] Forward-port saas-15 up to 17b847c0f6 2017-06-01 01:10:29 +02:00
Olivier Dony 5dd2cc8e63 [MERGE] Forward-port saas-14 up to b9e2207267 2017-06-01 00:37:30 +02:00
Olivier Dony b9e2207267 [MERGE] Forward-port 10.0 up to 7e44444878 2017-06-01 00:15:27 +02:00
Yenthe V.G 61f6756a7c [FIX] payment_authorize: add missing translation ability
Closes #17257
2017-05-29 11:17:15 +02:00