diff options
| author | Atchuthan Ubendran <atchuthan@sodexis.com> | 2020-02-21 07:43:26 +0000 |
|---|---|---|
| committer | Nicolas Martinelli <nim@odoo.com> | 2020-02-25 10:34:36 +0000 |
| commit | 40c2a124a187b956ac0e154ab07ab85069b1a0e7 (patch) | |
| tree | 901bcb42efa6b29bd14fd44e31aa3f9264330243 /addons/payment_authorize | |
| parent | 1bcab2f42eebf98127416e54f31cd6e351938b7f (diff) | |
[FIX] payment_authorize: change order of keys
- Select 'capture manually' in Authorize.net Payment acquirer
- Do an online transaction
- Click on the Capture button at Payment transaction windows.
An error message is returned:
The element 'transactionRequest' in namespace
'AnetApi/xml/v1/schema/AnetApiSchema.xsd' has invalid child element
'amount' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'. List
of possible elements expected: 'splitTenderId, order, lineItems...'.
This because the keys `amount` and `refTransId` are inverted in
`createTransactionRequest`:
https://developer.authorize.net/api/reference/index.html#payment-transactions-capture-a-previously-authorized-amount
A simple fix is to swtich them. Indeed, the Odoo 13.0 requirements is
Python 3.6+, in which the keys order at iteration is the insertion
order. Although this was officially part of the specification in 3.7,
the change is already available in 3.6.
Closes #45891
opw-2201667
closes odoo/odoo#46206
X-original-commit: ae3885295795f8c150bd40af266004016fd300c5
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Diffstat (limited to 'addons/payment_authorize')
| -rw-r--r-- | addons/payment_authorize/models/authorize_request.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/payment_authorize/models/authorize_request.py b/addons/payment_authorize/models/authorize_request.py index dce188477ba..ffb915101a0 100644 --- a/addons/payment_authorize/models/authorize_request.py +++ b/addons/payment_authorize/models/authorize_request.py @@ -301,8 +301,8 @@ class AuthorizeAPI(): }, 'transactionRequest': { 'transactionType': 'priorAuthCaptureTransaction', + 'amount': str(amount), 'refTransId': transaction_id, - 'amount': str(amount) } } } |
