Odoo Help

Welcome!

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.

0

Sage Pay Integration RedirectURL error code : 5006

By
nikesh
on 4/28/16, 5:00 AM 299 views

Hi community,

 I need to intgrate Odoo ecommerce  with sagepay. I followed sagepay document "Sage Pay Server Integration and Protocol Guidelines 3.00". I got respose to my NotificationURL given. But I couldn't return the data with RedirectURL.

Here is the code:

@http.route('/payment/sagepay/complete', type='json', auth="public", methods=['POST', 'GET'])

def sagepay_complete(self, **post):

    cr, uid, context = request.cr, SUPERUSER_ID, request.context

    validate_url = 'https://test.sagepay.com/gateway/service/vspserver-register.vsp'

    base_url = request.httprequest.host_url

    return_url = '%s' % urlparse.urljoin(base_url, '/payment/paysage')

    reply_values = '''Status=OK

    RedirectURL=%s

    StatusDetail=0000 : The Authorisation was Successful.''' % return_url

    return reply_values

@http.route('/payment/paysage', type='http', auth="none", methods=['POST', 'GET'])

def sagepay_complete_redirect(self, **post):

    cr, uid, context = request.cr, SUPERUSER_ID, request.context

    res = self.sagepay_validate_data(**post)

    print "=sagepay_complete==res===",res

    return_url = self._get_return_url(res, **post)

    return werkzeug.utils.redirect(return_url)

Here first url '/payment/sagepay/complete' is the NotificationURL. I got response to this url. I returned the response with RedirectURL '/payment/paysage'. But it always gives the error 5006. Please guide me if I am missing something.

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

1 follower(s)

Stats

Asked: 4/28/16, 5:00 AM
Seen: 299 times
Last updated: 4/28/16, 7:35 AM