Answer the question
In order to leave comments, you need to log in
How to connect the payment gateway correctly?
There is a simple test CRUD project on node.js and express.js , I decided to try adding a payment gateway, it works like on the learn.javascript.ru website , redirects to the payment gateway page. But, I'm having a problem.
The API documentation states that you need to send a POST request with data or JSON data. The problem is that if you add a form in this form, you can correct the form data values through devtools.
Form example
<form action="https://www.portmone.com.ua/gateway/" method="post">
<input type="hidden" name="payee_id" value="1185" />
<input type="hidden" name="shop_order_number" value="76575j65465464161hhhh" />
<input type="hidden" name="bill_amount" value="1"/>
<input type="hidden" name="description" value="Опис замовлення"/>
<input type="hidden" name="success_url" value="http://example.com/success.html" />
<input type="hidden" name="failure_url" value="http://example.com/failure.html" />
<input type="hidden" name="lang" value="ru" />
<input type="hidden" name="encoding" value= "UTF-8" />
<input type="hidden" name="exp_time" value= "400" />
</form>
request({
url: 'https://www.portmone.com.ua/gateway/',
method: 'POST',
followAllRedirects: true,
jar: true,
form: formData
}, function (error, response, body) {
if (error) {
console.log(error);
} else {
res.send(body);
}
});
Answer the question
In order to leave comments, you need to log in
Based on this, I assume that you need to send a request to the gateway from the server side.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question