add website id in return url
This commit is contained in:
parent
ea862d2143
commit
14b11a7de3
|
|
@ -96,6 +96,9 @@ class HyperPayController(http.Controller):
|
||||||
'data_brands': data_brands,
|
'data_brands': data_brands,
|
||||||
'acq': acq.id
|
'acq': acq.id
|
||||||
}
|
}
|
||||||
|
if 'force_website_id' in request.session:
|
||||||
|
final_response.update({'website_id': request.session['force_website_id']})
|
||||||
|
|
||||||
return final_response
|
return final_response
|
||||||
|
|
||||||
@http.route('/payment/hyperpay/result', type='http', auth='public', csrf=False, website=True, save_session=True)
|
@http.route('/payment/hyperpay/result', type='http', auth='public', csrf=False, website=True, save_session=True)
|
||||||
|
|
@ -121,5 +124,6 @@ class HyperPayController(http.Controller):
|
||||||
res = request.env['payment.transaction'].sudo().form_feedback(resp, "hyperpay")
|
res = request.env['payment.transaction'].sudo().form_feedback(resp, "hyperpay")
|
||||||
ids = tx_id.sale_order_ids.sudo().ids
|
ids = tx_id.sale_order_ids.sudo().ids
|
||||||
request.session['sale_last_order_id'] = ids[0] if len(ids) else None
|
request.session['sale_last_order_id'] = ids[0] if len(ids) else None
|
||||||
|
request.session['force_website_id'] = int(post['website_id'])
|
||||||
_logger.info('/payment/hyperpay/result--force_website_id = %d' % request.session.get('force_website_id'))
|
_logger.info('/payment/hyperpay/result--force_website_id = %d' % request.session.get('force_website_id'))
|
||||||
return request.redirect('/payment/process')
|
return request.redirect('/payment/process')
|
||||||
|
|
|
||||||
|
|
@ -103,13 +103,13 @@ odoo.define("payment_hyperpay.payment_hyperpay", function (require) {
|
||||||
txId: self.tx_id,
|
txId: self.tx_id,
|
||||||
}).then(function (result) {
|
}).then(function (result) {
|
||||||
if (result) {
|
if (result) {
|
||||||
self._renderHyperpayModal(result.checkoutId, result.domain, result.base_url, result.data_brands, result.acq);
|
self._renderHyperpayModal(result.checkoutId, result.domain, result.base_url, result.data_brands, result.acq, result.website_id);
|
||||||
} else {
|
} else {
|
||||||
console.log("Error Occured");
|
console.log("Error Occured");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
_renderHyperpayModal: function (checkoutId, domain, base_url, data_brands, acq) {
|
_renderHyperpayModal: function (checkoutId, domain, base_url, data_brands, acq, website_id) {
|
||||||
var self = this;
|
var self = this;
|
||||||
try {
|
try {
|
||||||
var $modal_html = $($(".payment_hyper_modal").get()[0]);
|
var $modal_html = $($(".payment_hyper_modal").get()[0]);
|
||||||
|
|
@ -121,7 +121,7 @@ odoo.define("payment_hyperpay.payment_hyperpay", function (require) {
|
||||||
'<form action="' +
|
'<form action="' +
|
||||||
base_url +
|
base_url +
|
||||||
"/payment/hyperpay/result?acq=" +
|
"/payment/hyperpay/result?acq=" +
|
||||||
acq +
|
acq + "website=" + website_id +
|
||||||
'" class="paymentWidgets" data-brands="' +
|
'" class="paymentWidgets" data-brands="' +
|
||||||
data_brands +
|
data_brands +
|
||||||
'"></form>';
|
'"></form>';
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue