Below is the code that does external request with stripe api using stripe npm module. This works perfectly fine in debug mode and i can see the output in my terminal. But when deployed using npm run deploy and testing the api service method, its not reaching anywhere
To test, i removed all stripe module, just made a plain http request to google.com after adding google.com to the domains list which got instantly approved. Still its the same error. This also works perfectly in debug and fails in prodcution.
Please see the code:
return new Promise((resolve, reject) => {
console.log("inside promise");
var options = {
url : 'https://www.google.com',
method: 'GET',
body : '',
auth: {
'user': 'sk_test_rwXpFKat6zsIloS4eGDTGfLW',
'pass': ''
}
};
function callback(error, response, body) {
if (!error && response.statusCode == 200) {
console.log(body.substring(0,30));
resolve("succedded in payment");
}else{
console.log(response.body);
reject("failed the the order");
}
}
request(options, callback);
});
Thanks for replying. I understand that, but the request is not even hitting the server. Please see my second comment, its a simple request to google using request module. Even that’s not working. I created that following your comment on a similar issue. can you please check if something is wrong in that ? Its perfectly working in debug mode also
The second example (request to google.com) is the code there and google.com is added and approved as external host. Going really made over these for days
Hi, Abdul.
We have made a little reconfiguration.
Pleas, try again. Firstly, I recommend with simple request to make sure the requests to external hosts pass correctly.