2017-03-05 93 views
0

我在我的应用程序中使用BrainTree API进行信用卡交易。此功能要求我提供客户端令牌:我在哪里可以得到我的BrainTree客户端令牌?

public void onBraintreeSubmit(View v) { 

    DropInRequest dropInRequest = new DropInRequest() 
      .clientToken(CLIENT_TOKEN); 
    startActivityForResult(dropInRequest.getIntent(this), 0); 
} 

我正在使用Parse-Server。我的客户端令牌究竟是什么?

回答

0

完全披露:我在布伦特里工作。如果您有任何其他问题,请随时联系support

从Braintree的文档:

客户端令牌是签名数据blob包括由Braintree client SDK所需的配置和 授权信息。这些 不应该重复使用;对于发送给Braintree的每个 请求,都应该生成一个新的客户令牌。为了安全起见,如果在短时间内重复使用令牌,我们将撤销客户端 。 1

server负责generating the client token。这是一个Node.js示例from the Braintree docs

app.get("/client_token", function (req, res) { 
    gateway.clientToken.generate({}, function (err, response) { 
    res.send(response.clientToken); 
    }); 
}); 
相关问题