Commit Graph
64 Commits
Author SHA1 Message Date
Denis Ledoux cb9d7982c1 [FIX] payment, website_sale: condition to recreate a payment transaction
Before this revision, in the ecommerce,
a new payment transaction was created only
when the transaction reference was different than
the order number, meaning that the transaction id
in the user session no longer refers to the current order,
that the user created a new order which has nothing
to do with the transaction he has in his session
variable `sale_transaction_id`

This made sense when the transaction reference
strictly matched the order number, but,
since f89e8f9df2,
this is possible that a payment transaction reference
number no longer strictly matches its order number,
as the transaction reference can contain `-1`, `-2`
at the end of its reference, meaning there was
already another transaction existing with the sale
order number as reference. But the transaction
is still about this order.

Therefore, from this revision, the condition on
which a new transaction has to be created
should no longer be based on the transaction
reference, but to which `sale_order_id` the transaction belongs.

In addition, we add two more conditions for which a new transaction
should be created:
 - The transaction has been cancelled or in error
 - The acquirer has changed.

For the second case, this is to handle a corner case:
 - The user selects one payment acquirer (Ogone), then click
   on "Pay now", and is therefore redirected to the payment provider website (Ogone)
 - Then, the user opens a new browser tab on the ecommerce, on his cart,
   choose another payment provider (Paypal), then click "Pay now" and is
   redirected to this second payment provider website  (Paypal),
 - Then, the user comes back on the first tab, on which he is on the first
   provider website (ogone), and pays/validate the payment
 - Then, we receive the payment feedback (either from the user/DPN, either from
   the server to server call/IPN)

Before this revision, this use case would have lead to the feedback from the first
provider (`/payment/ogone/accept`) while the transaction is set with the second
payment provider (`Paypal`), therefore breaking the payment validation.

Creating a new transaction when the user changes of payment provider solves this issue.
He will nevertheless be able to pay twice, on each provider, but it was
already the case before.

opw-659294
2015-12-15 18:31:12 +01:00
Denis Ledoux dcd8d65fd1 [MERGE] forward port of branch saas-6 up to 6a306a03be 2015-10-28 14:01:10 +01:00
Denis Ledoux 101bb927a0 [FIX] payment: fees computation depending on country
The computed fees can depend on the country.
There was a typo about it:
there is no `country_id` field on the `payment.transaction` model,
it's `partner_country_id`.

Therefore, the computed fees according to the country
were not always correctly computed.

e.g. for Paypal, where the domestic fees
are lower than the international fees, it always
computed the fees as international.

opw-651778
2015-10-14 13:29:36 +02:00
Olivier Dony af4a60b941 [MERGE] Forward-port 8.0 up to rev. 26d0fe6d9f 2015-09-30 02:53:59 +02:00
Denis Ledoux 25d8955e98 [FIX] payment: make the payment.acquirer name translatable
To allow to translate "Wire transfer" in the ecommerce.

opw-650450
2015-09-29 15:09:23 +02:00
Raphael Collet 5a6e136172 [IMP] addons: adapt binary fields to store images in attachments 2015-09-28 15:19:47 +02:00
Christophe Simonis 57168a9e90 [MERGE] forward port of branch saas-6 up to a669433 2015-09-23 14:34:26 +02:00
Denis Ledoux a3648fd23a [MERGE] forward port of branch 8.0 up to aabbdc7 2015-09-21 16:01:58 +02:00
Damien Bouvy f89e8f9df2 [IMP] payment, website_sale, website_payment: unique reference on payment no longer prevent paying
Payment transactions referenceis have a unique constraint which was problematic when a payment was cancelled from the acquirer's page.
To stick the to DRY principle, I factorized a method that checks for existing references and happens a numerical suffix if necessary.
This was already implemented in website_payment but was moved to payment and used in website_sale.
2015-09-21 13:15:58 +02:00
Denis Ledoux 2c81ab75c8 [FIX] payment: fees recomputation on transaction amount/acquirer change
Fees were not recomputed when the amount or the acquirer of the
payment transaction was changed.

This can happen if the user clicks on
"Pay now", which creates the transaction and computes
the fees for the first time and then redirects
to the payment provider, and then the user
came back from the payment provider, hitting the previous
button in his browser, for instance, and then
changes the content of his cart (the quantity, or even
the products) or change of payment provider
(from Ogone to Paypal, for instance).

opw-649509
2015-09-16 16:41:30 +02:00
Shivam Dudhat 9d36fe5c52 [IMP] payment: error message and style 2015-09-16 11:30:55 +02:00
Damien Bouvy e178b42a91 [FIX] payment: triggering the on_change to get partner details sometime put the partner_country_id to False; the default was there explicitly to avoid this kind of problem 2015-09-08 16:30:12 +02:00
Damien Bouvy 526f27ddac [IMP] payment,payment_*,website_quote,website_sale: new rendering mechanism compatibility for payment providers
merge *ALL* the dicts

The form rendering used to receive a dict for partner information and a dict for tx information and to transmit another dict to the qweb template; now everything is done in a single dict
2015-09-04 16:08:22 +02:00
Damien Bouvy cf394d953c [IMP] website_portal_sale: payment from portal
- replace the portal_sale blue ribbon by a website_portal_sale link from the portal home
- remove all fields and methods related to banner in portal_sale
- remove "validation" field in payment_acquirer since it was only used here
2015-09-04 16:08:22 +02:00
Damien Bouvy f8a98d977e [IMP] payment: usability improvements
- general:
    - add payment.method and payment.transaction menu in invoicing
- payment.acquirer:
    - add image field
    - add stat button to see payment.transaction objects
- payment.transaction:
    - language field is now a selection instead of a char
    - rename s2s_cb_eval field in callback_eval
    - form view cleaning
    - on_change_partner_id now fills in the partner details
    - add an ir.sequence for transaction name
    - add a many2one to payment.method
    - country defaults to the country of the company
- payment.method:
    - add a one2many to payment.transaction
    - add a stat button to see payment.transaction objects

[IMP] website_quote: rename s2s_cb_eval payment.transaction field to callback_eval

[IMP] payment_* (all providers): add image data and rename s2s_cb_eval field to callback_eval
2015-09-04 16:08:21 +02:00
Gaurav Panchal 6b55539dc7 [IMP] res_partner: form view cleaning
Better display of contacts, simplified contact creation, use default image
for shipping and delivery, and various fixes and improvements in the
form view.

Main impacted addons :

 - account: add a bank_account_count field and stat button that replaces the
 2many field
 - base_vat: remove the button to check vat, as there is already a constraint
 and removed and unused import
 - payment: add a payment_method_count field and stat button that replaces
 the 2many field
2015-08-18 10:51:27 +02:00
Christophe Simonis 95ac2cfd10 [MERGE] forward port of branch saas-6 up to be58335 2015-08-06 16:09:19 +02:00
Christophe Simonis 3d26eb02ab [MERGE] forward port of branch 8.0 up to d3e9bde 2015-08-06 11:54:32 +02:00
Antony Lesuisse 4a3a3e5f3a [FIX] payment: Move website_published field to website_payment
We have to keep website_published defined in payemnt so that demo data publish
only payment_transfer for the website_sale tour.
2015-08-06 00:14:24 +02:00
Antony Lesuisse a7dee722cc [IMP] payment: acquirer from view
- Split credentials from technical configuation moved to technical feature.
- Fix website_published button
2015-08-04 21:34:13 +02:00
Ronak Baxi f8efc8a6c3 [FIX] payment: typo in track_visibility 2015-08-04 17:03:51 +02:00
Christophe Simonis 2cf91d16a5 [MERGE] forward port of branch saas-6 up to 63e92cb 2015-07-22 16:17:54 +02:00
Yannick Tivisse bcabe788ee [IMP] : Several change concerning the publish button
- website_sale_delivery : set the field website_published into a stat button and set the form into a sheet
- payment : Payment acquirers unpublished by default, and website_published set into a stat button
- website_partner : res_partner unpublished by default, to avoid partners as “Plusbelle LaPoubelle” to be published on the prod (True Story)
- website_sale_delivery : Delivery method unpublished by default. Adapt the demo data to be published (to avoid breaking a test), and set the field website_published into a stat button.
2015-07-09 16:13:04 +02:00
Christophe Simonis fe92deaa1d [MERGE] forward port of branch 8.0 up to 2de301d 2015-07-07 18:13:57 +02:00
Denis Ledoux 3375ff2827 [FIX] payment: By assumption, first name is before last name
In the partner model, there is only one field `name`.
The first name and the last name are not within two
separated fields.

By assumption, the firstname is written before the last name
(first <> last)

This assumption should be kept when sending the
first name / last name of the partner to the payment acquirers
e.g. Paypal.

opw-643120
2015-07-02 17:21:02 +02:00
Christophe Simonis a304194936 [MERGE] forward port of branch saas-6 up to 81b5c60 2015-06-25 00:26:31 +02:00
Yannick Tivisse a04d0dc93c [IMP] account : Usability improvements
-->Company form view :
- Campany Tagline moved in the header, invisible if empty
- Partner field set in group_no_one
- Account Holder removed from tree view
- Intercompany rules tab/Responsible fields into group_no_one
-->Account res_config form view :
- Charts of account : code and #digits fields removed, as they depends of the country
                               and are configured in the datas
- Use Anglo Saxon checbox : Automatic, removed from the view
- tax_calculation_rounding_method field set automatically in the CoA : Removed
- Manage customer payments and follow-ups are enabled by default, so removed the option

NB : Some fields has been removed from the setting view because of legal issues and
also because they are automatically filled with the CoA.
If they have to be modified in some countries' CoA, they have to be added to the view
in these specific CoA, not is the standard view.
2015-06-23 11:58:18 +02:00
Damien Bouvy dbd3efef1f [IMP] payment: add support for server2server payments
This commit adds a new model, Payment Method, which stores
a reference to the payment acquirer's database and a reference to
a partner. Each payment module must have its own implementation.

The implementation is completely abstract but may not suit every
provider's way of implementing recurring payments.
2015-06-15 14:57:14 +02:00
Christophe Simonis fe2b5f35a4 [MERGE] forward port of branch saas-6 up to bf1e999 2015-05-28 14:27:38 +02:00
Christophe Simonis 2260496879 [MERGE] forward port of branch 8.0 up to a939a27 2015-05-05 18:48:34 +02:00
qdp-odoo c04065abd8 [IMP] accounting v9. Yeeeeaah 2015-05-05 17:28:04 +02:00
Christophe Simonis dd84e612d0 [FIX] payment: remove extra field.
Commit 8a6e859 wrongly introduced this new field when adding the new
`payment_authorize` module.
As 8.0 is a [stable version](http://git.io/vfACM), no data model change
is allowed.

We convert this field to a `fields.dummy` in case someone installed (or
update) this module with this fields to ensure the view still applied
and is not broken.
2015-04-28 15:46:34 +02:00
Ajay javiya 8a6e859c2b [ADD] New payment acquirer Authorize.net. 2015-04-21 17:15:05 +02:00
Jay Patel 1ebd67355a [IMP] payment, website_sale: post-payment messages on acquirers 2015-04-09 17:24:16 +02:00
Jay Patel 2ec6fe68a1 [IMP] delivery, payment: name are now translatable 2015-03-19 12:38:39 +01:00
Christophe Simonis 1b3fb3c4a8 [MERGE] forward port of branch 8.0 up to 222b2d3 2015-02-17 18:54:52 +01:00
Denis Ledoux 899acef186 [FIX] payment: unique reference constraint
The payment transactions references must be unique, but for
states within draft, pending, done states, not
if the transaction has been canceled or in error.

Otherwise, this is not possible to create a new payment
transaction for an ecommerce order for which
the payment has been canceled by the acquirer

For instance, when the customer lands on Ogone,
then hit the cancel button

opw-627914
2015-02-13 15:35:35 +01:00
Nandan Jani 14ebbf6c61 [IMP] payment: added sequence and order on payment acquirer model. 2015-02-04 10:16:08 +01:00
Christophe Simonis 18e22be138 [MERGE] forward port of branch 8.0 up to 0aab81c 2015-01-19 17:15:56 +01:00
Ajay javiya 90869f1de4 [ADD] New payment acquirer Authorize.net. 2015-01-16 11:22:35 +01:00
Martin Trigaux f37a40c4c0 [FIX] payment: help message not translatable
Payment info such as "You will be redirected to..." should be translatable.
opw 619786
2015-01-16 11:06:10 +01:00
Christophe Simonis 1d3f8eba87 [MERGE] forward port of branch 8.0 up to 591e329 2014-12-02 16:18:08 +01:00
hiekmann 2a22a6151f [FIX] payment: docstring typo
closes #3557
2014-11-26 09:38:24 +01:00
Christophe Simonis 5068cffbb0 [MERGE] forward port of branch 8.0 up to 491372e 2014-11-05 20:30:40 +01:00
Raphael Collet f2e4a10e1a [IMP] use model._fields instead of model._all_columns to cover all fields
The old-api model._all_columns contains information about model._columns and
inherited columns.  This dictionary is missing new-api computed non-stored
fields, and the new field objects provide a more readable api...

This commit contains the following changes:

 - adapt several methods of BaseModel to use fields instead of columns and
   _all_columns

 - copy all semantic-free attributes of related fields from their source

 - add attribute 'group_operator' on integer and float fields

 - base, base_action_rule, crm, edi, hr, mail, mass_mailing, pad,
   payment_acquirer, share, website, website_crm, website_mail: simply use
   _fields instead of _all_columns

 - base, decimal_precision, website: adapt qweb rendering methods to use fields
   instead of columns
2014-11-04 13:47:57 +01:00
Thibault Delavallée fc0d9ada6d [IMP] payment: add the auto_confirm field on form view + transfer does not confirm by default 2014-10-23 12:49:29 +02:00
Thibault Delavallée e9fdc32fba [IMP] payment, website_sale: better control of sale order confirmation in ecommerce.
Auto confirmation is now controlled by a field on the acquirer
that proposes to confirm
- at payment (Pay Now button on ecommerce)
- at payment confirmation (transaction feedback)
- never

Also fixed the state of tx for transfer transactions that was modified
for debugging in a previous task but not reverted.
2014-10-09 12:50:13 +02:00
Denis Ledoux 1bb219907f [MERGE] forward port of branch saas-5 up to 655a5b9 2014-08-04 16:56:10 +02:00
Denis Ledoux 655a5b948d [MERGE] forward port of branch saas-4 up to 8c0c743 2014-08-04 16:14:31 +02:00
Denis Ledoux 8c0c74300f [MERGE] forward port of branch saas-3 up to ebf317a 2014-08-04 16:14:05 +02:00