I’m trying to use the PaymentRequest
from this which is a banking gateway and i realy do need some help
it wont work with normal ionic http post which should be duo to the soap thing. so i searched a lot and could not find any official ionic way of doing this… i just found something that seemed to work for the case… but could not get that working either. here it is
buyThisProduct(id){
let xmlhttp = new XMLHttpRequest();
xmlhttp.open('POST', 'https://www.zarinpal.com/pg/services/WebGate/wsdl', true);
//the following variable contains my xml soap request (that you can get thanks to SoapUI for example)
let sr =
`
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://zarinpal.com/">
<soapenv:Header/>
<soapenv:Body>
<s:MerchantID>
'aaaaaa'
</s:MerchantID>
<s:Amount>
1500
</s:Amount>
<s:Description>
'Description Description'
</s:Description>
<s:Email>
'aa@ss.com'
</s:Email>
<s:Mobile>
1500
</s:Mobile>
<s:CallbackURL>
'http://someurl.ir/'
</s:CallbackURL>
</soapenv:Body>
</soapenv:Envelope>`;
xmlhttp.onreadystatechange = () => {
console.log(xmlhttp.responseXML);
if (xmlhttp.readyState == 4) {
if (xmlhttp.status == 200) {
let xml = xmlhttp.responseXML;
let response_number = parseInt(xml.getElementsByTagName("return")[0].childNodes[0].nodeValue); //Here I'm getting the value contained by the <return> node
console.log(response_number); //I'm printing my result square number
}
}
}
// Send the POST request
xmlhttp.setRequestHeader('Content-Type', 'text/xml');
xmlhttp.responseType = "document";
xmlhttp.send(sr);
}
the above code produces this error