Hi guys,
I’m trying to implement PayU API in my app, and I have not been able to ping:
This is the URL of the API: http://developers.payulatam.com/en/api/payments.html
So this my code:
I modified the file ionic.project:
"proxies": [
{
"path": "/service.cgi",
"proxyUrl": "https://stg.api.payulatam.com/payments-api/4.0/service.cgi"
}
],
Then established a constant:
appPedido.constant('ApiEndpoint', {
url: 'http://localhost:8100/service.cgi'
});
In my function I make this call:
var parameter = JSON.stringify(
{
"test": true,
"language": "en",
"command": "PING",
"merchant": {
"apiLogin": "11959c415b33d0c",
"apiKey": "6u39nqhq8ftd0hlvnjfs66eh8c"
}
}
);
$http({
url: ApiEndpoint.url,
method: 'GET',
params: parameter,
headers: { 'Content-Type': 'application/json;charset=utf-8' }
}).then(function (results) {
console.log(results);
}, function(err) {
console.log('error en la matrix', err);
});
};
I have this error:
"Error: self signed certificate in certificate chain
at Error (native)
at TLSSocket.<anonymous> (_tls_wrap.js:929:36)
at TLSSocket.emit (events.js:104:17)
at TLSSocket._finishInit (_tls_wrap.js:460:8)↵"
headers
:
(name)
status
:
500
statusText
:
“Internal Server Error”
I have the CORS Chrome enabled. Any idea what is going on?