Odoo Help


This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Cart still have products after payment

Vincent Gagnon-Coll
on 4/18/16, 4:38 PM 442 views


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)
    error = 'Received unrecognized status for Beanstream payment %s: %s, set as error' % (tx.reference, status)
    res.update(state='error', state_message=error)
    return tx.write(res)

Vincent Gagnon-Coll
On 5/25/16, 1:45 PM

Yes, but my problem was in fact related to the route it goes after the gateway processed my payment.

I used a different route and it worked. 

    '/payment/beanstream/accept', '/payment/beanstream/test/accept',
], type='http', auth='none')

def beanstream_form_feedback(self, **post):
    """ Beanstream contacts using GET, at least for accept """
    _logger.info('Beanstream: entering form_feedback with post data %s', pprint.pformat(post)) # debug
    cr, uid, context = request.cr, SUPERUSER_ID, request.context
    request.registry['payment.transaction'].form_feedback(cr, uid, post, 'beanstream', context=context)
    order = request.registry['sale.order'].search(cr, uid, [('name', '=', post['trnOrderNumber'])])
    order = request.registry['sale.order'].browse(cr, uid, order)
    order.with_context(dict(context, send_email=True)).action_confirm()
    return werkzeug.utils.redirect(post.pop('return_url', '/shop/payment/validate'))
Jon Knowles
On 5/25/16, 1:38 PM

I would be extremely interested in using this bean stream payment module, and would gladly pay for it.

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)


Asked: 4/18/16, 4:38 PM
Seen: 442 times
Last updated: 5/26/16, 8:24 AM