Skip to Content
Menu
This question has been flagged
3 Replies
5044 Views

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)



Avatar
Discard
Author Best Answer

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. 


@http.route([    
    '/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'))
Avatar
Discard
Best Answer

Have you seen anything like this happening with the paypal plugin for Odoo 11 CE? I am having the same thing - where the payment is processed but Odoo doesn't seem to know. When the shopper is redirected back to the odoo instance, it returns a 500 internal server error instead. Any help would be appreciated. Thank you!

Avatar
Discard

I was able to figure this out. I had installed Odoo v11CE onto Ubuntu 18.04 without a compatible dependency. Reinstalled on Ubuntu 16.04 and everything worked great.

Best Answer


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


Avatar
Discard
Related Posts Replies Views Activity
3
Feb 24
1302
1
May 21
2472
1
Nov 20
8665
1
Sep 20
2051
2
May 20
3966