Example #1
0
        public void TestUserinfoDynamic()
        {
            Dictionary<string, string> configurationMap = new Dictionary<string, string>();
            configurationMap.Add("clientId", "");
            configurationMap.Add("clientSecret", "");
            configurationMap.Add("mode", "live");
            APIContext apiContext = new APIContext();
            apiContext.Config = configurationMap;

            UserinfoParameters userinfoParams = new UserinfoParameters();
            userinfoParams.SetAccessToken(info.access_token);
            Userinfo userinfo = Userinfo.GetUserinfo(apiContext, userinfoParams);
            Assert.AreEqual(userinfo != null, true);
        }
Example #2
0
        /// <summary>
        /// Returns user details
        /// <param name="apiContext">APIContext to be used for the call.</param>
        /// <param name="userinfoParameters">Query parameters used for API call</param>
        /// </summary>
        public static Userinfo GetUserinfo(APIContext apiContext, UserinfoParameters userinfoParameters)
        {
            string pattern = "v1/identity/openidconnect/userinfo?schema={0}&access_token={1}";

            object[] parameters   = new object[] { userinfoParameters };
            string   resourcePath = SDKUtil.FormatURIPath(pattern, parameters);
            string   payLoad      = "";

            if (apiContext == null)
            {
                apiContext = new APIContext();
            }
            apiContext.MaskRequestId = true;
            return(PayPalResource.ConfigureAndExecute <Userinfo>(apiContext, HttpMethod.GET, resourcePath, payLoad));
        }
Example #3
0
 /// <summary>
 /// Returns user details
 /// <param name="apiContext">APIContext to be used for the call.</param>
 /// <param name="userinfoParameters">Query parameters used for API call</param>
 /// </summary>
 public static Userinfo GetUserinfo(APIContext apiContext, UserinfoParameters userinfoParameters)
 {
     string pattern = "v1/identity/openidconnect/userinfo?schema={0}&access_token={1}";
     object[] parameters = new object[] { userinfoParameters };
     string resourcePath = SDKUtil.FormatURIPath(pattern, parameters);
     string payLoad = "";
     if (apiContext == null)
     {
         apiContext = new APIContext();
     }
     apiContext.MaskRequestId = true;
     return PayPalResource.ConfigureAndExecute<Userinfo>(apiContext, HttpMethod.GET, resourcePath, payLoad);
 }
Example #4
0
 /// <summary>
 /// Returns user details
 /// <param name="userinfoParameters">Query parameters used for API call</param>
 /// </summary>
 public static Userinfo GetUserinfo(UserinfoParameters userinfoParameters)
 {
     return(GetUserinfo(null, userinfoParameters));
 }
Example #5
0
 /// <summary>
 /// Returns user details
 /// <param name="userinfoParameters">Query parameters used for API call</param>
 /// </summary>
 public static Userinfo GetUserinfo(UserinfoParameters userinfoParameters)
 {
     return GetUserinfo(null, userinfoParameters);
 }