Problem implementing 3DS protocol (secure payment) on an Ionic4 app

Hi,
I have to implement a 3DS payment on an Ionic4 app.

With this protocol, the user should be redirected with a POST on the bank site (BANK_WS), where he has to insert an OTP code.
If the user inserts the right code, then the bank calls the RETURN_WS web service (on my server) with some parameters.
I’m trying to implement this algorithm with Ionic4 but I have the following problem.

This is the form that should be filled and sent to the Bank:

<form name="redirect" action="<%BANK_WS%>" method="POST">
   <input type=hidden name="PaReq" value="<%PAR1%>" >
    <input type=hidden name="TermUrl" value="<%RETURN_WS%>" >
    <input type=hidden name="MD" value="<%=PAR2%>" >
</form>

I’m doing the redirection to the bank site, using InApprowser:

      const pageContent = '<html><head></head><body><form name="redirect" id="redirect" action="' + BANK_WS + '" method="post">' +
        '<input type="hidden" name="PaReq" value="' + PAR1 + '">' +
        '<input type="hidden" name="TermUrl" value="' + RETURN_WS + '">' +
        '<input type="hidden" name="MD" value="' + PAR2 + '">' +
        '</form> <script type="text/javascript">document.getElementById("redirect").submit();</script></body></html>';
      console.log('pageContent: ', pageContent);
      const pageContentUrl = 'data:text/html;base64,' + btoa(pageContent);

      const browserRef = this.iab.create(
        pageContentUrl ,
        '_blank',
        'hidden=no,location=no,clearsessioncache=yes,clearcache=yes'
      );

With this code the app is redirected in the right way to the authentication page of the bank.

If I insert the right code the bank redirects the app to the web service RETURN_WS, but I don’t know how to make it change the state of the app.

The problem is that the execution of RETURN_WS on my server should say to the app that the payment was successfull so that it (the app) can show the result to the user.

I think it’s a bit complicated to explain this, however, I think that this will be a common problem in the next days.

Thank you very much

cld