Google Checkout,如何清除我的购物车?
我很难理解这个问题,谷歌庞大的文档也没有帮助(我什至找不到响应类型及其属性的列表)。
我的店面是用 PHP 构建的,我的购物车存储在会话中。当我点击 Google Checkout 按钮时,它会发布到另一个窗口(使用 HTML API),然后我就可以登录 Google,一切看起来或多或少都是正确的。
但是,我不知道一旦有人完成订单,我应该如何清除我的购物车。我实际上还没有经过测试订单,因为我无法让沙箱指示正常工作(它总是“忘记”任何设置)。我的回调页面是否收到了我应该处理的任何类型的消息?我希望有一天能够进行自定义订单处理,但重置购物车绝对至关重要!
I'm having trouble wrapping my head around this and Google's sprawling documentation isn't helping (I can't even find a list of response types and their properties).
I have my storefront built in PHP and my shopping cart is stored in the session. When I hit the Google Checkout button, it posts to a different window (using the HTML API) and I get the Google sign-in where everything looks more or less right.
However, I don't know how I'm supposed to clear my shopping cart once somebody finishes an order. I haven't actually been through a test order because I can't get the sandbox directions to work (it keeps "forgetting" any settings). Does my callback page recieve any sort of message I should be handling? I'd like to do custom order processing someday but resetting the shopping cart is absolutely critical!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用通知 API 获取订单处理各个阶段的更新:
http: //code.google.com/apis/checkout/developer/Google_Checkout_HTML_API_Notification_API.html
此外,还可以使用商家专用数据字段传递有关您的任何自定义数据 命令。
当您收到通知时,从商家私人数据字段中读取自定义信息,并根据该信息重置会话。
请参阅此答案获取解决方案到类似的问题。
You can use the Notification API to get updates on various stages of order processing:
http://code.google.com/apis/checkout/developer/Google_Checkout_HTML_API_Notification_API.html
Additionally use the merchant-private-data field to pass any custom data about your order.
When you get back the notification, read the custom info from the merchant-private-data field and based on that reset the session.
See this answer for a solution to a similar issue.
我认为只需清除您的购物车会话就会清除购物车。只需取消您的购物车会话即可。
I think just clearing your cart session would clear shopping cart. Just unset your cart session.