How to close final payment screen in Cordova inappweb browser to show the main payment page?

I am using inappweb browser to call a payment page based on bill desk . But the last page with Fail/Success message window could not close . How it can done…
My function for payment is


  let numBuildingID = this.param1[0].numBuildingID;
  let intBuildingCategory = 2;
  let sha1 = require('sha1');
  let wardyear = this.param9;
  let zone = this.param8;
  let lbid = this.param7;
  let hash = sha1(numBuildingID+'E@P%A!Y$'+lbid+zone+intBuildingCategory);
  let uuid = this.device.uuid;
  let ts =;
  var pageContent ='<html><head></head><body><form id="paymentForm" action="" method="post">'+
                  '<input type="hidden" name="BID" value="'+numBuildingID+'">'+
                  '<input type="hidden" name="LBID" value="'+lbid+'">'+
                  '<input type="hidden" name="ZoneID" value="'+zone+'">'+
                  '<input type="hidden" name="WardYear" value="'+wardyear+'">'+
                  '<input type="hidden" name="Category" value="'+intBuildingCategory+'">'+
                  '<input type="hidden" name="HashKey" value="'+hash+'">'+
                  '<input type="hidden" name="Mode" value="SAMAGRA">'+
                  '<input type="hidden" name="PayeeKeyID" value="'+uuid+'">'+
                  '<form><script type="text/javascript">document.getElementById("paymentForm").submit();</script></body></html>';
  var pageContentUrl = 'data:text/html;base64,'+btoa(pageContent);
  this.platform.ready().then(() => {

       this.payFlag = true;
       var browserRef =,"_blank","hidden=no,location=no,clearsessioncache=yes,clearcache=yes");
       browserRef.addEventListener( "loadstop", function() {
            { code: "localStorage.getItem( 'epayReceiptNo' )" },
            function( values ) {





Please advise