diff options
| author | Nicolas Martinelli <nim@odoo.com> | 2018-04-10 11:41:47 +0200 |
|---|---|---|
| committer | Nicolas Martinelli <nim-odoo@users.noreply.github.com> | 2018-04-10 16:05:23 +0200 |
| commit | b7462ca224a0e4a423e1c230f0d2e46a1b9c34fa (patch) | |
| tree | 910da97e6f5bfb2c518f565146352b6e82e9fcec /addons/payment_authorize/tests | |
| parent | 076cf05c2ecbd5d2157dc910c475a0d4def9b3a1 (diff) | |
[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
Diffstat (limited to 'addons/payment_authorize/tests')
| -rw-r--r-- | addons/payment_authorize/tests/test_authorize.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/payment_authorize/tests/test_authorize.py b/addons/payment_authorize/tests/test_authorize.py index b2f1f8e3393..40d0d960b50 100644 --- a/addons/payment_authorize/tests/test_authorize.py +++ b/addons/payment_authorize/tests/test_authorize.py @@ -51,7 +51,7 @@ class AuthorizeForm(AuthorizeCommon): form_values = { 'x_login': self.authorize.authorize_login, 'x_trans_key': self.authorize.authorize_transaction_key, - 'x_amount': '320.0', + 'x_amount': '56.16', 'x_show_form': 'PAYMENT_FORM', 'x_type': 'AUTH_CAPTURE', 'x_method': 'CC', @@ -87,7 +87,7 @@ class AuthorizeForm(AuthorizeCommon): form_values['x_fp_hash'] = self._authorize_generate_hashing(form_values) # render the button - res = self.authorize.render('SO004', 320.0, self.currency_usd.id, values=self.buyer_values) + res = self.authorize.render('SO004', 56.16, self.currency_usd.id, values=self.buyer_values) # check form result tree = objectify.fromstring(res) |
