[FIX] payment_authorize: acquier reference
The field `acquirer_reference` is not a mandatory field. If not retrieved from the provider, it will have a NULL value in the DB, and therefore will be `False` in Python. The `capture` and `void` method will crash in this case, because of: `etree.SubElement(tx, "refTransId").text = transaction_id` opw-751231
This commit is contained in:
@@ -256,14 +256,14 @@ class TxAuthorize(models.Model):
|
||||
def authorize_s2s_capture_transaction(self):
|
||||
self.ensure_one()
|
||||
transaction = AuthorizeAPI(self.acquirer_id)
|
||||
tree = transaction.capture(self.acquirer_reference, self.amount)
|
||||
tree = transaction.capture(self.acquirer_reference or '', self.amount)
|
||||
return self._authorize_s2s_validate_tree(tree)
|
||||
|
||||
@api.multi
|
||||
def authorize_s2s_void_transaction(self):
|
||||
self.ensure_one()
|
||||
transaction = AuthorizeAPI(self.acquirer_id)
|
||||
tree = transaction.void(self.acquirer_reference)
|
||||
tree = transaction.void(self.acquirer_reference or '')
|
||||
return self._authorize_s2s_validate_tree(tree)
|
||||
|
||||
@api.multi
|
||||
|
||||
Reference in New Issue
Block a user