summaryrefslogtreecommitdiff
path: root/addons/payment_authorize/tests
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2019-03-08 14:10:38 +0100
committerChristophe Simonis <chs@odoo.com>2019-03-08 14:10:38 +0100
commitfabbcf1579dd4b5653cc611e53cd8ff6c7e297b4 (patch)
tree8b3cfa88ed4a4e85b4af8df79dc5c7197a04764b /addons/payment_authorize/tests
parent8da3750cee37532d2060bc0c4271a15bc1511dc2 (diff)
parent21c84f1532206a9b46344cacc84bd2a39ba7bbd3 (diff)
[MERGE] forward port branch saas-15 up to 21c84f15322
Diffstat (limited to 'addons/payment_authorize/tests')
-rw-r--r--addons/payment_authorize/tests/test_authorize.py15
1 files changed, 3 insertions, 12 deletions
diff --git a/addons/payment_authorize/tests/test_authorize.py b/addons/payment_authorize/tests/test_authorize.py
index 40d0d960b50..19747f0d60e 100644
--- a/addons/payment_authorize/tests/test_authorize.py
+++ b/addons/payment_authorize/tests/test_authorize.py
@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
-import hashlib
-import hmac
import time
import unittest
from lxml import objectify
@@ -32,15 +30,6 @@ class AuthorizeCommon(PaymentAcquirerCommon):
@odoo.tests.common.post_install(True)
class AuthorizeForm(AuthorizeCommon):
- def _authorize_generate_hashing(self, values):
- data = '^'.join([
- values['x_login'],
- values['x_fp_sequence'],
- values['x_fp_timestamp'],
- values['x_amount'],
- ]) + '^'
- return hmac.new(values['x_trans_key'].encode('utf-8'), data.encode('utf-8'), hashlib.md5).hexdigest()
-
def test_10_Authorize_form_render(self):
self.assertEqual(self.authorize.environment, 'test', 'test without test environment')
@@ -85,7 +74,7 @@ class AuthorizeForm(AuthorizeCommon):
'x_ship_to_state': None,
}
- form_values['x_fp_hash'] = self._authorize_generate_hashing(form_values)
+ form_values['x_fp_hash'] = self.env['payment.acquirer']._authorize_generate_hashing(form_values)
# render the button
res = self.authorize.render('SO004', 56.16, self.currency_usd.id, values=self.buyer_values)
# check form result
@@ -112,7 +101,9 @@ class AuthorizeForm(AuthorizeCommon):
# typical data posted by authorize after client has successfully paid
authorize_post_data = {
'return_url': u'/shop/payment/validate',
+ # x_MD5_Hash will be empty starting the 28th March 2019
'x_MD5_Hash': u'7934485E1C105940BE854208D10FAB4F',
+ 'x_SHA2_Hash': u'7D3AC844BE8CA3F649AB885A90D22CFE35B850338EC91D1A5ADD819A85FF948A3D777334A18CDE36821DC8F2B42A6E1950C1FF96B52B60F23201483A656195FB',
'x_account_number': u'XXXX0027',
'x_address': u'Huge Street 2/543',
'x_amount': u'320.00',