本文介绍了如何让在谷歌钱包的用户信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们希望能够给应用程序的用户与done.The问题真实交易相关联的是,我们对应用程序后端侧用户的电子邮件地址,我们追踪用户的购买量,但是当我们进入谷歌钱包的交易我们有没有办法知道哪些事务/ S属于该用户。我们需要一个解决方案,因为即使我们有用户的电子邮件,我们无法通过电子邮件地址进行搜索交易。

We want to be able to associate app users with real transactions done.The problem is that we have the user’s email address on application back end side, and we track user purchase amounts, but when we go into the Google Wallet transactions we have no way of knowing which transaction/s belong to that user. We need a solution for this, because even if we have the user's email, we cannot search transactions by email address.

是否有可能更新我们发送的API中的收据编号,包括谷歌钱包收据号码,而不是时间戳?

Is it possible to update the receipt numbers we are sending in the API to include the Google Wallet Receipt number instead of the time stamp ?

请向我们提供您的建议。

Please, provide us your suggestions.

推荐答案

我的答案在这里指的是所提供的previous答案:

My answer here refers to the previous answer provided:

  1. 完全同意为什么不能这样建议的(或更好的),在钱包教程中发现了什么?

  1. Totally agree on "why cannot this kind of suggestion (or a better one) be found in the wallet tutorial?".

您建议的解决方案似乎并不很安全(至少可以这样说)。你想客户端发送的用户名/电子邮件/客户端ID在成功回调...这意味着,任何人都可以向您发送其ID,即使他们没有进行购买。他们可以添加一个随机的顺序-ID和希望得到一个匹配(然后重复上述过程多次,以增加成功的机会)。

Your suggested solution does not seem to be very secured (to say the least). You want the client to send you their username/email/client-id in the Success callback... This means that anyone will be able to send you their ID, even if they did not make a purchase. They can add a random order-ID and hope to get a match (and then repeat the process many times in order to increase the chances).

我的猜测是,用户名/电子邮件/客户端ID在于从谷歌发送到回发网址(服务器的doPost例程)请求对象的地方。但我有,你需要添加一些东西,在智威汤逊在你的采购功能产生之前,它被传递到google.payments.inapp.buy日常的感觉。

My guess is that the username/email/client-id lies somewhere in the request object sent from Google to the postback URL (your server's doPost routine). But I have the feeling that you need to add something in the JWT generated in your Purchase function before it is passed to the google.payments.inapp.buy routine.

寻找一个答案自己...

Looking for an answer myself...

下面是一个可能的解决方案,虽然我还没有测试它自己:

Here is a possible solution, although I have not yet tested it myself:

这是下载的ZIP文件://$c$c.google.com/p/wallet-online-quickstart-java/downloads/list

Download the 'zip' file from: https://code.google.com/p/wallet-online-quickstart-java/downloads/list

完完整整的COM文件夹,并把它添加到您的项目源文件夹(对不起,我一直没能找到一个JAR此包)。然后,添加以下code到你的servlet:

Take the entire 'com' folder and add it to your project source folder (sorry, I have not been able to find a JAR for this package). Then, add the following code to your servlet:

...

import com.google.wallet.online.jwt.JwtResponseContainer;

import com.google.wallet.online.jwt.util.JwtGenerator;

import com.google.wallet.online.jwt.JwtResponse;

...

public void doPost(HttpServletRequest request, HttpServletResponse response) ...

{

    try

    {

        String maskedWalletJwt = request.getParameter("maskedWalletJwt");

        JwtResponseContainer jwtResponseContainer = JwtGenerator.jwtToJava(JwtResponseContainer.class, maskedWalletJwt, SellerSecret);

        JwtResponse jwtResponse = jwtResponseContainer.getResponse();

        String email = jwtResponse.getEmail();

        ...

    }

}

有一件事情我不那么肯定,是的request.getParameter(maskedWalletJwt)。

One thing I'm not so sure about, is request.getParameter("maskedWalletJwt").

您可能需要调用google.payments.inapp.buy程序时,添加此参数。

You might have to add this parameter when calling the google.payments.inapp.buy routine.

这篇关于如何让在谷歌钱包的用户信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-27 13:59