Hi,
I am creating a new payment acquirer module for Beanstream Payment Solutions. For reference, I refered to the payment_ogone to have the same strucutre. Everything is working fine exept that the shopping cart do not clear itself and the system still thinks I am editing the same Sale orde because I am getting this error: It is forbidden to modify a sale order which is not in draft status. After the payment, my quote is set to done.
What am I doing wrong ?
def _beanstream_form_validate(self, cr, uid, tx, data, context=None):
status = data.get('trnApproved')
res = {
'acquirer_reference': data.get('trnId'),
'beanstream_txn_type': data.get('trnType'),
}
if status == '1':
_logger.info('Validated Beanstream payment for tx %s: set as done' % (tx.reference))
res.update(state='done', date_validate=data.get('trnDate', fields.datetime.now()))
return tx.write(res)
else:
error = 'Received unrecognized status for Beanstream payment %s: %s, set as error' % (tx.reference, status)
_logger.info(error)
res.update(state='error', state_message=error)
return tx.write(res)