[FIX] payment_ogone: set payment done with 3ds in pending mode
- When receiving a 3DS payment notification from Ingenico the payment transaction should be set to "pending" and not in "done". Then a second notification is send by Ingenico to set the payment.transaction to "done". This is the reason for accepting "pending" as a valid state on the feedback validation.
This commit is contained in:
@@ -283,7 +283,7 @@ class PaymentTxOgone(models.Model):
|
||||
return invalid_parameters
|
||||
|
||||
def _ogone_form_validate(self, data):
|
||||
if self.state != 'draft':
|
||||
if self.state not in ['draft', 'pending']:
|
||||
_logger.info('Ogone: trying to validate an already validated tx (ref %s)', self.reference)
|
||||
return True
|
||||
|
||||
@@ -431,7 +431,7 @@ class PaymentTxOgone(models.Model):
|
||||
return self._ogone_s2s_validate_tree(tree)
|
||||
|
||||
def _ogone_s2s_validate_tree(self, tree, tries=2):
|
||||
if self.state != 'draft':
|
||||
if self.state not in ['draft', 'pending']:
|
||||
_logger.info('Ogone: trying to validate an already validated tx (ref %s)', self.reference)
|
||||
return True
|
||||
|
||||
@@ -469,7 +469,7 @@ class PaymentTxOgone(models.Model):
|
||||
if status == 46: # HTML 3DS
|
||||
vals['html_3ds'] = ustr(base64.b64decode(tree.HTML_ANSWER.text))
|
||||
self.write(vals)
|
||||
self._set_transaction_done()
|
||||
self._set_transaction_pending()
|
||||
elif status in self._ogone_wait_tx_status and tries > 0:
|
||||
time.sleep(0.5)
|
||||
self.write({'acquirer_reference': tree.get('PAYID')})
|
||||
|
||||
Reference in New Issue
Block a user