I've been trying to integrate a payment gateway into my site in django. I'm having trouble getting the response data from the payment gateway.
The payment gateway has sample docs for php which looks like this :
$ErrorTx = isset($_POST['Error']) ? $_POST['Error'] : ''; //Error Number
$ErrorResult = isset($_POST['ErrorText']) ? $_POST['ErrorText'] : ''; //Error message
$payID = isset($_POST['paymentid']) ? $_POST['paymentid'] : ''; //Payment Id
In the view for the url that the payment gateway is redirecting to after entering card details etc, I'm checking if it's a GET if request.method == "GET"
and then passing the request to a function. When I debug the request, I can see an empty query dict. and if I try something like res = request.GET['paymentid'] I get an error that says there's no key called paymentid.
Am I missing something obvious? I'm still pretty new to django, so I'm sure I'm doing something wrong.
def pgreturn_hdfcerror(request): #process hdfc error request getLogger().debug("pg return hdfc error") if request.method == "GET": return handleHdfcResponse(request, 1)
– Satiableresponse = urllib2.urlopen(settings.HDFC_ENDPOINT, request_data)
where request_data has the data I am sending to the PG. I read the response withresponse.read()
which works fine. In the second, I'm redirecting the user to the PG url and the PG in turn redirects the user to a url on my website. This is where I'm stuck and not able to read the data. Is there a different way I should be doing this? – Satiable