I am trying to integrate a payment gateway in my app, and I'm using Django. However, the payment gateway needs to get a POST request done to their site.
In the payment gateways' docs they show the following...
<form method="post" action="https://sandbox.payhere.lk/pay/checkout">
<input type="hidden" name="merchant_id" value="1232">
<input type="text" name="currency" value="LKR">
<input type="text" name="amount" value="1000">
<input type="submit" value="Buy Now">
</form>
Even though this works perfectly fine, I feel this is a security vulnerability since people can alter the amount
. In which I need to send a POST request via Django views to https://sandbox.payhere.lk/pay/checkout
containing the info {"merchant_id":"1232", "currency":"LKR", "amount":"1000"}
.
Is there any way in which I could do it?
Thanks!
question from:
https://stackoverflow.com/questions/65843579/how-to-send-a-post-request-to-an-external-link-via-python 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…