duanbohan2015 2014-07-23 09:12
浏览 38

paypal快速结账后缺少会话数据

Our opencart based store is using the paypal express checkout and about 25% of the paypal express orders are expericing issues.

The problem seems to be when they return to the website after paypal, their session data is missing so all the details of their cart has gone.

To try and see what could be causing it, when they return to the site (normally through payment/pp_express/expressReturn) and the session data does not have the paypal/cart details I've logged details of most of the superglobals. Their session is always:

Array
(
    [category] => desktop
    [language] => en
    [currency] => GBP
    [cart] => Array
        (
        )

)

Sometimes when they return their cookies are empty, other times the language, currency & tracking are there.

After investigating further it looked like the session was being lost because of the way it was being redirected:

header('Location: https://www.paypal.com/cgi‑bin/webscr?cmd=_express-checkout&token=' . $result['TOKEN'].'&useraction=commit');

So before every header redirect I added

session_write_close();

The problem actually seemed to be eased a bit but it is still happening.

The server uses memcache and my final thought is that perhaps it is low on memory and their session is lost - but I would imagine we would see frequent logout issues throughout our sites if that were the case.

  • 写回答

1条回答 默认 最新

  • du5407 2014-07-23 09:34
    关注

    In my excperience it is bad practice to use Sessions for displaying order data after returning from payment gateways.

    Most payment gateways (inlcuding PayPal) let you pass on an OrderID or other custom variables that will be passed back on Success / Failure. You can generally follow this procedure:

    1. Save order to database, retrieve orderID
    2. Redirect to payment gateway. Pass orderID to the payment gateway.
    3. On success / failure read order from database using the orderID sent back by the payment gateway
    评论

报告相同问题?

悬赏问题

  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥16 mybatis的代理对象无法通过@Autowired装填
  • ¥15 可见光定位matlab仿真
  • ¥15 arduino 四自由度机械臂
  • ¥15 wordpress 产品图片 GIF 没法显示
  • ¥15 求三国群英传pl国战时间的修改方法
  • ¥15 matlab代码代写,需写出详细代码,代价私
  • ¥15 ROS系统搭建请教(跨境电商用途)
  • ¥15 AIC3204的示例代码有吗,想用AIC3204测量血氧,找不到相关的代码。