'Extract the return URL from the data coming from sips.'

def _get_return_url(self, **post):

    return_url = post.pop('return_url', '')
    if (not return_url):
        Tx = request.env['payment.transaction']
        data = Tx._sips_data_to_object(post.get('Data'))
        custom = json.loads((data.pop('returnContext', False) or '{}'))
        return_url = custom.get('return_url', '/')
    return return_url
