summaryrefslogtreecommitdiff
path: root/addons/payment_authorize
diff options
context:
space:
mode:
Diffstat (limited to 'addons/payment_authorize')
-rw-r--r--addons/payment_authorize/models/payment.py4
-rw-r--r--addons/payment_authorize/tests/test_authorize.py6
2 files changed, 5 insertions, 5 deletions
diff --git a/addons/payment_authorize/models/payment.py b/addons/payment_authorize/models/payment.py
index a80627dbf35..24d57cb0db7 100644
--- a/addons/payment_authorize/models/payment.py
+++ b/addons/payment_authorize/models/payment.py
@@ -66,7 +66,7 @@ class PaymentAcquirerAuthorize(models.Model):
'x_trans_key': self.authorize_transaction_key,
'x_amount': str(values['amount']),
'x_show_form': 'PAYMENT_FORM',
- 'x_type': 'AUTH_CAPTURE' if self.auto_confirm != 'authorize' else 'AUTH_ONLY',
+ 'x_type': 'AUTH_CAPTURE' if not self.capture_manually else 'AUTH_ONLY',
'x_method': 'CC',
'x_fp_sequence': '%s%s' % (self.id, int(time.time())),
'x_version': '3.1',
@@ -246,7 +246,7 @@ class TxAuthorize(models.Model):
def authorize_s2s_do_transaction(self, **data):
self.ensure_one()
transaction = AuthorizeAPI(self.acquirer_id)
- if self.acquirer_id.auto_confirm != "authorize":
+ if not self.acquirer_id.capture_manually:
res = transaction.auth_and_capture(self.payment_token_id, self.amount, self.reference)
else:
res = transaction.authorize(self.payment_token_id, self.amount, self.reference)
diff --git a/addons/payment_authorize/tests/test_authorize.py b/addons/payment_authorize/tests/test_authorize.py
index d19690284a8..b02d3d81209 100644
--- a/addons/payment_authorize/tests/test_authorize.py
+++ b/addons/payment_authorize/tests/test_authorize.py
@@ -25,7 +25,7 @@ class AuthorizeCommon(PaymentAcquirerCommon):
# get the authorize account
self.authorize = self.env.ref('payment.payment_acquirer_authorize')
# Be sure to be in 'capture' mode
- self.authorize.auto_confirm = 'confirm_so'
+ # self.authorize.auto_confirm = 'confirm_so'
@odoo.tests.common.at_install(True)
@@ -219,7 +219,7 @@ class AuthorizeForm(AuthorizeCommon):
# switch to 'authorize only'
# create authorize only s2s transaction & capture it
- self.authorize.auto_confirm = 'authorize'
+ self.authorize.capture_manually = True
transaction = self.env['payment.transaction'].create({
'amount': 500,
'acquirer_id': authorize.id,
@@ -236,7 +236,7 @@ class AuthorizeForm(AuthorizeCommon):
self.assertEqual(transaction.state, 'done')
# create authorize only s2s transaction & void it
- self.authorize.auto_confirm = 'authorize'
+ self.authorize.capture_manually = True
transaction = self.env['payment.transaction'].create({
'amount': 500,
'acquirer_id': authorize.id,