1

我正在使用 Braintree 与 Ruby 和 JS 来尝试做 Braintree Drop-In UI 的基本实现。

以下是一些相关的代码片段:

事务控制器创建令牌 @client_token = Braintree::ClientToken

页面初始化令牌 <script> braintree.setup(“&lt;%= @client_token %>”, 'dropin', { container: 'checkout' }); </script>

由于某种原因,我最终得到了令牌的解密版本。输出如下所示:

{"version":1,"authorizationFingerprint":"9802dc7676997d457eb5c656470227a27828f15b12ec4acd3c2cec67782a3001|created_at=2015-03-23T04:29:28.438506721+0000\u0026merchant_id=8gtvngmjy6tmsxz4\u0026public_key=6rp8nrfbvmyfqjf8","configUrl":"
https://api.sandbox.braintreegateway.com:443/merchants/8gtvngmjy6tmsxz4/client_api/v1/configuration
","challenges":["cvv"],"clientApiUrl":"
https://api.sandbox.braintreegateway.com:443/merchants/8gtvngmjy6tmsxz4/client_api
","assetsUrl":"https://assets.braintreegateway.com","authUrl":"
https://auth.venmo.sandbox.braintreegateway.com","analytics":{"url":"
https://client-analytics.sandbox.braintreegateway.com
"},"threeDSecureEnabled":true,"threeDSecure":{"lookupUrl":"
https://api.sandbox.braintreegateway.com:443/merchants/8gtvngmjy6tmsxz4/three_d_secure/lookup
"},"paypalEnabled":true,"paypal":{"displayName":"None","clientId":null,"privacyUrl":"
http://example.com/pp","userAgreementUrl":"http://example.com/tos
","baseUrl":"https://assets.braintreegateway.com","assetsUrl":"
https://checkout.paypal.com
","directBaseUrl":null,"allowHttp":true,"environmentNoNetwork":true,"environment":"offline","unvettedMerchant":false,"braintreeClientId":"masterclient","merchantAccountId":"gbsgnv46xscgk868","currencyIsoCode":"USD"},"coinbaseEnabled":false}"

这当然不是客户端令牌应该是什么样子。

为什么我最终得到了解密版本?

4

1 回答 1

1

看起来那是客户端令牌的旧版本。升级 gem 版本将为您提供编码的客户端令牌,而不是 json。

于 2015-03-30T13:58:53.110 回答