google checkout 在继续 url 处获取自定义变量
我正在使用 google checkout,目前在沙盒环境中工作。我使用过 Paypal,我认为 google checkout 的工作原理应该是一样的。但我想知道 google checkout 不会在返回 URL 上发回 HTML 表单字段,而且我还无法找到此问题的任何正确解决方案。这是我的代码。
我在这里使用自定义字段 shopping-cart.merchant-private-data 来获取数据,但我不知道如何在继续 URL 上收集该数据。
我只需要在自定义字段中传递一些 ID,以便在返回 URL 时我可以取回它,然后根据该 ID 更改我的数据库。有一件重要的事情是,返回后,谷歌结帐也会破坏会话,并且会话中没有存储任何值。这给我带来了一个大问题。所以请告诉我如何从 google checkout 取回该自定义 ID。
I am working with google checkout and currently working at sandbox environment. I have used Paypal and i thought google checkout should work like the same. but i wonder that google checkout is not posting back the HTML form field on return URL and im not able to find any proper solution for this problem yet. Here is my code.
here im using a custom field shopping-cart.merchant-private-data to get the data but i dont know how to collect that data on continue URL.
I just need to pass some ID in a custom field so that on return URL I can get it back and then change my database on the basis of this ID. There is one thing which is important that Upon return google checkout is destroying sessions also and there is no value stored in sessions. This made a big problem for me. So please tell me how i can get that custom ID back from google checkout.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这里有几个单独的问题:
首先,Google Checkout 交易完成后不会自动重定向买家。
continue-shopping-url
参数允许您提供一个链接,用户必须点击该链接才能在完成后返回您的网站订单。因为这只是一个链接,没有任何数据发布,比如你要找的交易私密数据。有关 continue-shopping-url 参数的详细信息:
http ://code.google.com/apis/checkout/developer/Google_Checkout_HTML_API_Parameter_Reference.html#tag_continue-shopping-url
第二,您可以使用
标签传递有关您订单的任何自定义数据。要取回它,您必须提供回调 URL 才能接收来自 Google Checkout 的通知。当您收到通知时,从商家私人数据标签中读取自定义信息。请参阅此答案以获取解决方案到类似的问题。
There are a couple of separate issues here:
First, there is no automatic re-direct for the buyer after the Google Checkout transaction finishes.
The
continue-shopping-url
paramenter allows you to provide a link that the user has to click in order to get back to your site after completing the order. Because this is just a link, there is no data post, such as the transaction private data you are looking for.More info about the continue-shopping-url paramenter:
http://code.google.com/apis/checkout/developer/Google_Checkout_HTML_API_Parameter_Reference.html#tag_continue-shopping-url
Second, you can use the
<merchant-private-data>
tag to pass any custom data about your order. To get it back you have to provide a callback URL in order to receive notifications from Google Checkout. When you get back the notification, read the custom info from the merchant-private-data tag .See this answer for a solution to a similar issue.