开发者

Paypal Express Checkout in CodeIgniter

I want my clients to pay using Paypal's express checkout flow. My website is developed开发者_高级运维 in CodeIgniter. I am receiving 404 error when the customer cancel and return to the website bcoz Paypal adds ?token=$$$$$$$ at the end of the cancel url.

Can you help me friends?


There are two things you'll need to be able to make the URL with the GET parameter work and access the token supplied.

First in system/application/config.php, change:

$config['uri_protocol'] = "AUTO";

... to ...

$config['uri_protocol'] = "PATH_INFO";

That will allow the URL to route in the usual way. Once that's in place, add this like to the top of your controller method:

parse_str($_SERVER['QUERY_STRING'],$_GET);

That will reinstate the $_GET array, after which you can use this to access the token value if required:

$token = $this->input->get('token');

... and you're all done!


take it out of CI. You always have the $_SESSION to communicate.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜