CodeIgniter 中的 Paypal 快速结帐

发布于 2024-10-03 12:05:58 字数 137 浏览 1 评论 0原文

我希望我的客户使用 Paypal 的快速结账流程付款。我的网站是用 CodeIgniter 开发的。当客户取消并返回网站 bcoz Paypal 在取消网址末尾添加 ?token=$$$$$$$ 时,我收到 404 错误。

朋友们可以帮帮我吗?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

℉服软 2024-10-10 12:05:58

您需要做两件事才能使带有 GET 参数的 URL 正常工作并访问提供的令牌。

首先在 system/application/config.php 中,将:

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

... 更改为 ...

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

这将允许 URL 以通常的方式路由。一旦到位,将其添加到控制器方法的顶部:

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

这将恢复 $_GET 数组,之后您可以使用它来访问令牌值(如果需要):

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

...一切就完成了!

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!

So尛奶瓶 2024-10-10 12:05:58

将其从 CI 中取出。您始终可以通过 $_SESSION 进行通信。

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文