2017-03-05 94 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); 
    }); 
}); 
相關問題