将唯一 ID 发送到 google checkout
我想使用 google checkout 来收取我网站的订阅费用。为了有效地处理订单,我需要收集购买者的电子邮件地址或该订单的另一个唯一 ID,以便稍后我可以激活他们的帐户。
有没有一种方法可以以编程方式将我可以在运行时生成的 id 与 google checkout 中放置的订单关联起来?
如果可能的话,我想通过为“立即购买”按钮生成不同的 html 来做到这一点。如果有必要,我可以使用 API。
更新:我看到各种提及 merchant-item-id
的内容,当我使用 Google 工具创建按钮时,我可以静态设置该字段。如果有一种动态的方式来设置商家商品 ID,那就完美了。有类似的解决方案吗?
I'd like to use google checkout to charge for subscriptions to my website. In order to efficiently process orders, I need to collect the purchaser's email address or another unique id for that order, so that later I can activate their account.
Is there a way to programmatically associate an id that I can generate at runtime with an order placed in google checkout?
If possible, I'd like to do this just by generating different html for the "buy now" button. If necessary, I can use the API.
Update: I see various mentions of merchant-item-id
, and when I create a button with Google's tools I can set that field statically. If there were a dynamic way to set merchant-item-id, that would be perfect. Any solutions like that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
查看通知API:
http://code.google.com/apis/checkout/developer/Google_Checkout_HTML_API_Notification_API.html
更改“立即购买”按钮的代码实际上不会通知您订单是否已完成 - 无法确定用户是否刚刚加载“立即购买”页面、完成了付款,或者是否已付款被拒绝了。通过通知 API,您可以仅在收到付款后立即激活订阅。当然,您必须编写脚本才能接收通知...
我看到的唯一其他选择是更改 continue_url 以某种方式更改感谢页面以包含 id,但这很容易伪造。
Look in to the notification API:
http://code.google.com/apis/checkout/developer/Google_Checkout_HTML_API_Notification_API.html
Changing the code of the buy now button wouldn't actually notify you if the order was completed - there'd be no way to determine if a user just loaded the buy now page, completed the payment, or if the payment was declined. With the notification api you can instantly activate the subscription only when payment is received. Of course, you have to write the script to receive the notification...
The only other option I see if changing the continue_url to somehow change the thank you page to include the id, but this is easy to fake.
答案现在看来微不足道。只需将:
放入您的 BuyNow 按钮代码(或您用来提交的任何表单)中,其中 11235 是您喜欢的任何值。
The answer seems trivial now. Just throw:
into your BuyNow button code (or whatever form you're using to submit) with 11235 being any value you like.