Я пытаюсь перевести некоторый php-код в nodejs / javascript
![enter image description here](https://i.stack.imgur.com/WDWtY.png)
Я нуб с nodejs и Axios. Не знаю, правильно ли я это делаю. Но я думал, что это может работать со следующим кодом
exports.getCheckOutId = async (amount ) => {
const data = {
'authentication.userId' : userId,
'authentication.password' : password,
'authentication.entityId' : entityId,
'amount' : amount,
'paymentType' : paymentType,
'currency' : currency
};
return await axios({
method: 'post',
url: host + path,
data: data,
rejectUnauthorized: false
});
};
Когда я пытаюсь проверить, что происходит
const response = getCheckOutId(5).then(result => console.log("after then: ", result) );
console.log(response);
Я просто получаю
Promise { <pending> }
Я не могу видеть ответ
Я пытался с без отклонения Unauthorized: ложь на всякий случай ssl была проблема.
Я также попробовал этот подход, но не вижу ни журналов консоли, ни ошибок.
axios.post(url, data, axiosConfig).
then((response) => {
console.log('accessed successfully');
return response;
}).catch((err) => {
console.log("AXIOS ERROR: ", err);
return null;
})