예제 #1
0
        /**
         *		 * All countries are supported.

         */
        public GetVerifiedStatusResponse GetVerifiedStatus(GetVerifiedStatusRequest GetVerifiedStatusRequest, string apiUsername)
        {
            string resp = call("GetVerifiedStatus", GetVerifiedStatusRequest.toNVPString(""), apiUsername);

            NVPUtil util = new NVPUtil();
            return new GetVerifiedStatusResponse(util.parseNVPString(resp), "");
        }
예제 #2
0
 public GetVerifiedStatusResponse GetVerifiedStatus(GetVerifiedStatusRequest GetVerifiedStatusRequest)
 {
     return GetVerifiedStatus(GetVerifiedStatusRequest, null);
 }
        /// <summary>
        /// Handle GetVerifiedStatus API call
        /// </summary>
        /// <param name="context"></param>
        private void GetVerifiedStatus(HttpContext context)
        {
            // # GetVerifiedStatus API
            // The GetVerifiedStatus API operation lets you determine whether the specified PayPal account's status is verified or unverified.
            NameValueCollection parameters = context.Request.Params;
            GetVerifiedStatusRequest req = new GetVerifiedStatusRequest(new RequestEnvelope(), parameters["matchCriteria"]);
            //(Required) The first name of the PayPal account holder.
            // Required if matchCriteria is NAME.
            if (parameters["firstName"] != string.Empty)
            {
                req.firstName = parameters["firstName"];
            }

            // (Required) The last name of the PayPal account holder.
            // Required if matchCriteria is NAME.
            if (parameters["lastName"] != string.Empty)
            {
                req.lastName = parameters["lastName"];
            }

            if (parameters["emailAddress"] != string.Empty)
            {
                // (Optional - must be present if the emailAddress field above
                // is not) The identifier of the PayPal account holder. If
                // present, must be one (and only one) of these account
                // identifier types: 1. emailAddress 2. mobilePhoneNumber 3.
                // accountId
                AccountIdentifierType accntIdentifierType = new AccountIdentifierType();

                // (Required)Email address associated with the PayPal account:
                // one of the unique identifiers of the account.
                accntIdentifierType.emailAddress = parameters["emailAddress"];
                req.accountIdentifier = accntIdentifierType;
            }

            // Create the AdaptiveAccounts service object to make the API call
            AdaptiveAccountsService service = null;
            GetVerifiedStatusResponse resp = null;
            try
            {
                // Configuration map containing signature credentials and other required configuration.
                // For a full list of configuration parameters refer in wiki page
                // (https://github.com/paypal/sdk-core-dotnet/wiki/SDK-Configuration-Parameters)
                Dictionary<string, string> configurationMap = Configuration.GetAcctAndConfig();

                // Creating service wrapper object to make an API call and loading
                // configuration map for your credentials and endpoint
                service = new AdaptiveAccountsService(configurationMap);

                // # API call
                // Invoke the CreateAccount method in service wrapper object
                resp = service.GetVerifiedStatus(req);
            }
            catch (System.Exception e)
            {
                context.Response.Write(e.Message);
                return;
            }

            // Display response values.
            Dictionary<string, string> keyResponseParams = new Dictionary<string, string>();
            string redirectUrl = null;
            if (!(resp.responseEnvelope.ack == AckCode.FAILURE) &&
                !(resp.responseEnvelope.ack == AckCode.FAILUREWITHWARNING))
            {
                keyResponseParams.Add("Account status", resp.accountStatus);
                if (resp.userInfo != null)
                {
                    keyResponseParams.Add("Account Id", resp.userInfo.accountId);
                    keyResponseParams.Add("Account type", resp.userInfo.accountType);

                    //Selenium Test Case
                    keyResponseParams.Add("Acknowledgement", resp.responseEnvelope.ack.ToString());
                }
            }
            displayResponse(context, "GetVerifiedStatus", keyResponseParams, service.getLastRequest(), service.getLastResponse(),
                resp.error, redirectUrl);
        }
예제 #4
0
        /// <summary>
        /// Handle GetVerifiedStatus API call
        /// </summary>
        /// <param name="context"></param>
        private void GetVerifiedStatus(HttpContext context)
        {
            NameValueCollection parameters = context.Request.Params;
            GetVerifiedStatusRequest req = new GetVerifiedStatusRequest(
                new RequestEnvelope(), parameters["emailAddress"], parameters["matchCriteria"]);
            // set optional parameters
            if (parameters["firstName"] != "")
                req.firstName = parameters["firstName"];
            if (parameters["lastName"] != "")
                req.lastName = parameters["lastName"];

            // All set. Fire the request
            AdaptiveAccountsService service = new AdaptiveAccountsService();
            GetVerifiedStatusResponse resp = null;
            try
            {
                resp = service.GetVerifiedStatus(req);
            }
            catch (System.Exception e)
            {
                context.Response.Write(e.Message);
                return;
            }

            // Display response values.
            Dictionary<string, string> keyResponseParams = new Dictionary<string, string>();
            string redirectUrl = null;
            if (!(resp.responseEnvelope.ack == AckCode.FAILURE) &&
                !(resp.responseEnvelope.ack == AckCode.FAILUREWITHWARNING))
            {
                keyResponseParams.Add("Account status", resp.accountStatus);
                if (resp.userInfo != null)
                {
                    keyResponseParams.Add("Account Id", resp.userInfo.accountId);
                    keyResponseParams.Add("Account type", resp.userInfo.accountType);
                }
            }
            displayResponse(context, "GetVerifiedStatus", keyResponseParams, service.getLastRequest(), service.getLastResponse(),
                resp.error, redirectUrl);
        }
        /// <summary>
        /// All countries are supported.
        /// 
        /// 
        /// 
        /// 
        /// 
        /// </summary>
        ///<param name="getVerifiedStatusRequest"></param>
        ///<param name="credential">An explicit ICredential object that you want to authenticate this call against</param> 
        public GetVerifiedStatusResponse GetVerifiedStatus(GetVerifiedStatusRequest getVerifiedStatusRequest, ICredential credential)
        {
            IAPICallPreHandler apiCallPreHandler = new PlatformAPICallPreHandler(this.config, getVerifiedStatusRequest.ToNVPString(string.Empty), ServiceName, "GetVerifiedStatus", credential);
               	 	((PlatformAPICallPreHandler) apiCallPreHandler).SDKName = SDKName;
            ((PlatformAPICallPreHandler) apiCallPreHandler).SDKVersion = SDKVersion;
            ((PlatformAPICallPreHandler) apiCallPreHandler).PortName = "AdaptiveAccounts";

            NVPUtil util = new NVPUtil();
            return GetVerifiedStatusResponse.CreateInstance(util.ParseNVPString(Call(apiCallPreHandler)), string.Empty, -1);
        }
 /// <summary> 
 /// All countries are supported.
 /// 
 /// 
 /// 
 /// 
 /// 
 /// </summary>
 ///<param name="getVerifiedStatusRequest"></param>
 public GetVerifiedStatusResponse GetVerifiedStatus(GetVerifiedStatusRequest getVerifiedStatusRequest)
 {
     return GetVerifiedStatus(getVerifiedStatusRequest,(string) null);
 }
예제 #7
0
 /**
   * All countries are supported.
   *
   *
   *
   *
   *
  	  */
 public GetVerifiedStatusResponse GetVerifiedStatus(GetVerifiedStatusRequest getVerifiedStatusRequest, string apiUserName)
 {
     string response = Call("GetVerifiedStatus", getVerifiedStatusRequest.ToNVPString(""), apiUserName);
     NVPUtil util = new NVPUtil();
     return GetVerifiedStatusResponse.CreateInstance(util.ParseNVPString(response), "", -1);
 }