【发布时间】:2014-01-11 01:00:14
【问题描述】:
正在检查 Stripe Connect。
我已经到了可以访问令牌的阶段(此处解释为 https://stripe.com/docs/connect/oauth#token-request),但我无法访问对象的其他部分。
检索我使用的对象:
response = @client.auth_code.get_token(code, params)
并获得我使用的令牌:
@token = response.token #strangely it isn't response.access_token
我的问题是我无法访问 Stripe 响应的其他部分,其中包含可发布密钥。
我已经调试了响应,我得到了这个(删减并更改了敏感数据):
...@token="sk_test_abc123", @refresh_token="rt_abc123", @expires_in=nil, @expires_at=nil, @options={:mode=>:header, :header_format=>"Bearer %s" , :param_name=>"bearer_token"}, @params={"livemode"=>false, "token_type"=>"bearer", "stripe_publishable_key"=>"pk_test_abc123", "stripe_user_id"=>"abc123", "scope "=>"read_write"}
谁能告诉我如何在此回复中访问 stripe_publishable_key?
我试过了:
response.params[:stripe_publishable_key]
和
response.params.stripe_publishable_key
【问题讨论】:
标签: ruby-on-rails oauth ruby-on-rails-4 oauth-2.0 stripe-payments