URI Segments and payment gw |
[eluser]learnq[/eluser]
Hi, In payment gatway ,most of the time there is a option for return url like www.mysite.com/thanks.php and the payment gatway send reply like www.mysite.com/thanks.php?vala=dsgdfhgfdh&valb=dsgdfhgdf But it doesnot work with CI URI Segments(controler/method). Is there a way to solve it without disabling "URI Segments" like enabling query string for a specific script(ie,thanks.php)?
[eluser]xwero[/eluser]
You are asking two things here. If you are using a payment gateway that redirects you to a file you are out of the CI environment and you can do whatever you want. If the payment gateway redirects you to a CI url, for example myshop.com/order/thanks try to find where it adds the query string and rewrite it as a pathinfo url, if you want you can keep the keys and have a url like myshop.com/order/thanks/vala/dsgdfhgfdh/valb/dsgdfhgdf. But it would be even better if you can access the values from the gateway in the tanks controller method because users don't need to know your content comes from somwhere else. a quick fix solution is to set enable_query_string to true and the uri_protocol setting to PATHINFO but it's best to avoid this because then all your urls are accessible with clean (order/thanks) and query string (c=order&m=thanks) url segments.
[eluser]simonmaddox[/eluser]
Even if you disable query strings in CodeIgniter, you can still access them by using: Code: $this->input->server('QUERY_STRING'); For example: Code: $query_string = $this->input->server('QUERY_STRING',TRUE); You can then access the $_GET variables by using $get
[eluser]xwero[/eluser]
simonmaddox the problem is CI thinks thanks?vala=dsgdfhgfdh&valb=dsgdfhgdf is one segment because of the AUTO uri_protocol setting. So if the query string isn't needed you don't have to set the enable_query_strings to true. But i think you struck a gem by using the $_SERVER key QUERY_STRING because the enable_query_strings settings also opens the door to two urls linking to the same conent and CI's input initialization only cleans the $_GET global by default. I need to do a few test to confirm this, but thanks for pointing me in the direction.
[eluser]learnq[/eluser]
not clear why it is not working as you said Code: class Auth extends Controller { http://mysite.com/auth/payment it shows 'here' but http://mysite.com/auth/payment?Parameter...MPQu9P04S6 says 404 Page Not Found
[eluser]simonmaddox[/eluser]
Is that a server 404, or a CI 404? If it's a server 404, check your .htaccess file. Here's mine: Code: RewriteEngine On
[eluser]learnq[/eluser]
that is CI error. 404 Page Not Found The page you requested was not found.
[eluser]simonmaddox[/eluser]
[quote author="learnq" date="1230658754"]that is CI error. 404 Page Not Found The page you requested was not found.[/quote] Not sure what the issue might be. Maybe it's something in your config.php file? Here's mine (minus comments): Code: $config['base_url'] = "REMOVED";
[eluser]learnq[/eluser]
auth/payment/?Parameters=W1Vio3pMPQu9P04S6 gives A PHP Error was encountered Severity: Warning Message: preg_match() [function.preg-match]: Compilation failed: range out of order in character class at offset 20 Filename: libraries/URI.php Line Number: 189 The URI you submitted has disallowed characters. |
Welcome Guest, Not a member yet? Register Sign In |