machine to machine HTTP POST issue |
[eluser]Unknown[/eluser]
Hi, I'm trying to implement a online payment system in my CodeIgniter built site and have the following problem. The online payment system requires that there is a machine to machine (m2m) HTTP POST communication from their server to mine. They provide a php script for my server, which accepts that communication and the POST data and does something. I saved this m2m script in the views directory, and loaded it in a controller in the normal CodeIgniter fashion. In my browser I can call the script like that: http://mysite/index.php/m2m_ct?mode=approve and it accepts both POST and GET data. I also pass the above URL to the payment system servers so that they can perform the m2m communication when a payment is done or cancelled. The m2m communication however does not work for reasons that I don't understand. I have tried the same procedure with the same scripts from the payment system provider, on the same web server, but outside the CodeIgniter framework, and it works - the script accepts their HTTP POST request and does its job. What am doing wrong?
[eluser]toopay[/eluser]
You should put that php class on controller folder(and extends CI_controller) instead put it on view folder.
[eluser]Unknown[/eluser]
Just tried it with the same result - works in the browser but not when the remote server calls the URL. And the problem should not in the POST data handling - I put some code in the beginning of the script that writes in a log file no matter what is passed to the script via POST or GET. |
Welcome Guest, Not a member yet? Register Sign In |