Hello, I want to load the response obtained from request into webview.
Following is the code
function transmit(){
var request = Ti.Network.createHTTPClient({
onload: function () {
// alert(this.responseText);
Ti.API.info(this.responseText);
$.webview.html=this.responseText;
},
onerror: function(e){
Ti.API.debug(e.error);
alert(e.error);
},
timeout:4000,
});
request.open("POST","https://test.payu.in/_payment");
request.send({
txnid: txnid,
key:key,
amount: amount,
productinfo:productinfo,
firstname:firstname,
email:email,
phone:phone,
surl:surl,
furl:furl,
hash:hash,
service_provider:"payu_paisa"
});
}
$.index.open();
var date = new Date();
var randomnumber=Math.floor(Math.random()*9999999999);
var stringForm= randomnumber+date;
var strHash = Titanium.Utils.sha256(stringForm);
var key = "JBZaLc";
var salt = "GQs7yium";
var txnid = strHash.substring(0,20);
var amount = "100";
var productinfo = "Niceproduct";
var firstname = "sonal";
var email = "sonal@bcod.co.in";
var phone = "9664562989";
var surl = "https://www.familyjoyz.com";
var furl = "www.google.com";
var hashValue = key+"|"+txnid+"|"+amount+"|"+productinfo+"|"+firstname+"|"+email+"|||||||||||"+salt;
Ti.API.info("hashValue"+hashValue);
var securely = require('bencoding.securely');
var stringCrypto = securely.createStringCrypto();
var hash = stringCrypto.sha512(hashValue);
Ti.API.info("hash "+hash);
if (Titanium.Network.online) {
transmit();
}
else
{
Ti.API.info("offline");
};
I am getting below error
[ERROR] : Error loading /payments/mobile
[ERROR] : Error loading: file:///payments/mobile/#/user/, Error: Error Domain=NSURLErrorDomain Code=-1008 "resource unavailable" UserInfo=0x7f91e26b8d90 {NSErrorFailingURLStringKey=file:///payments/mobile/#/user/, NSLocalizedDescription=resource unavailable, NSErrorFailingURLKey=file:///payments/mobile/#/user/}
↧