Server redirect in meteor cordova android app


I’m developing a meteor cordova app for android, that uses 3D pay hosting. So the way 3D pay hosting works is that I submit a form with post request to their URL with some mandatory info and some custom info and then user gets redirected to their website/app where they enter their payment info. After they’ve entered the info, the payment hosting service does the validation of the payment info and makes the transaction. After the transaction has completed they redirect the user to aan url I posted to them in the first place(I post 2 urls, one for a successful transaction and one for a failed transaction). After the transaction they also post response to me with some payment data. I read the data using Meteors webapp package.

Here is the code:

WebApp.connectHandlers.use(bodyParser.urlencoded({ extended: false }))

WebApp.rawConnectHandlers.use(function(req, res, next) {
    res.setHeader("Access-Control-Allow-Origin", "*");
    return next();

WebApp.connectHandlers.use('/intesaSuccess', (req, res, next) => {
    const paymentInfoBody = req.body;
        //some payment data
    const userId = paymentInfoBody.userId;
    console.log('userId:', userId);'insertTransIdIntoFormData', paymentInfoBody.TransId, userId, err => {
        err ? console.log(err) : console.log('ubacio transid u formdata');
    })'balanceCount', parseInt(paymentInfoBody.amount), userId, err => {
        err ? console.log(err) : console.log('prosao balance count u connect');
    //redirect user to the transactionSuccess page
    res.writeHead(307, {Location: '/transactionSuccess'}); 

It all works fine when I try in the regular browser, but when I try this in the cordova android app it logs the user out. I figured it’s because of the meteor cordova apps running locally on phone in the webview with localhost. I’ve tried redirecting user to http://localhost:12448, but I get net::ERR_CONNECTION_REFUSED. Can somebody tell me how to make this work in android cordova app?