简体   繁体   English

是否可以使用PayPal Rest API获取帐户上的公司名称(“获取用户信息”中缺少)?

[英]Can business name on account be obtained using the PayPal Rest API (missing in “get user information”)?

I am using the PayPal REST API "Login with PayPal" functionality to enable users to rapidly create an account on our site by PayPal OpenAuth login. 我正在使用PayPal REST API“使用PayPal登录”功能,使用户可以通过PayPal OpenAuth登录在我们的网站上快速创建帐户。 I want to ensure accounts are created with accurate information so PayPal API is used as a method of rapid validation. 我想确保使用准确的信息创建帐户,以便将PayPal API用作快速验证的方法。

https://developer.paypal.com/webapps/developer/docs/integration/direct/log-in-with-paypal/detailed/ https://developer.paypal.com/webapps/developer/docs/integration/direct/log-in-with-paypal/detailed/

Using obtain authorization, and "get user information" this works perfectly and seemlessly with personal or premier accounts however for business accounts the business name is not returned. 使用“获取授权”和“获取用户信息”可以完美,无缝地与个人或高级帐户配合使用,但是对于企业帐户,不会返回企业名称。

GET https://api.paypal.com/v1/identity/openidconnect/userinfo/?schema=openid 

Sample response 样品回复

{
    "address":
    {
        "postal_code":"12345"
        "locality":"A CITY"
        "region":"XX"
        "country":"US"
        "street_address":"123 MAIN STREET"
    }
    "verified_account":"true"
    "name":"Joe Smith"
    "email":"Joe.Smith@paypal.com"
    "account_type":"PREMIER"
}

However for account_type=Business the user information doesn't return the business name. 但是,对于account_type = Business,用户信息不会返回公司名称。 Strangely this is available in "classic" API "verification status" however it is a cludgy workaround to use REST API to request authorization, get a token, login, populate all info except the business name then use that to call the classic API just to obtain the business name. 奇怪的是,这在“经典” API“验证状态”中可用,但是使用REST API请求授权,获取令牌,登录,填充除公司名称之外的所有信息,然后使用它来调用经典API只是一种笨拙的解决方法获取公司名称。

Am I missing something or is this an oversight by PayPal. 我是否缺少某些东西,或者这是贝宝(PayPal)的疏忽。 Is there a reason the REST API provides personal but not business names? REST API提供个人名称而不提供公司名称是有原因的吗? Is there a reason the REST API doesn't provide business names but the "classic API" does? REST API不提供商业名称,而“经典API”提供商业名称是有原因的吗?

Currently the REST API's do not return the business name of a Business account. 当前,REST API不会返回企业帐户的企业名称。 There is a bunch of features being implemented in REST before the end of this year. 在今年年底之前,REST中将实现许多功能。 I'm not sure if including the business name is one of them but I'll submit a Feature Request asking for the response to start including that information. 我不确定是否包含商家名称是其中之一,但是我将提交功能请求,要求响应开始包含该信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM