示例#1
0
        /**
         *		 * To be updated.
         * Countries Supported:
         * AU - Australia
         * AT - Austria
         * BE - Belgium
         * BR - Brazil
         * CA - Canada
         * CZ - Czech Republic
         * FR - France
         * DE - Germany
         * GR - Greece
         * HK - Hong Kong
         * IE - Ireland
         * IT - Italy
         * JP - Japan
         * LU - Luxembourg
         * MX - Mexico
         * NL - Netherlands
         * NZ - New Zealand (Aotearoa)
         * PL - Poland
         * PT - Portugal
         * RU - Russian Federation
         * SG - Singapore
         * ZA - South Africa
         * ES - Spain
         * CH - Switzerland
         * UK - United Kingdom
         * US - United States

         */
        public SetFundingSourceConfirmedResponse SetFundingSourceConfirmed(SetFundingSourceConfirmedRequest SetFundingSourceConfirmedRequest, string apiUsername)
        {
            string resp = call("SetFundingSourceConfirmed", SetFundingSourceConfirmedRequest.toNVPString(""), apiUsername);

            NVPUtil util = new NVPUtil();
            return new SetFundingSourceConfirmedResponse(util.parseNVPString(resp), "");
        }
示例#2
0
 public SetFundingSourceConfirmedResponse SetFundingSourceConfirmed(SetFundingSourceConfirmedRequest SetFundingSourceConfirmedRequest)
 {
     return SetFundingSourceConfirmed(SetFundingSourceConfirmedRequest, null);
 }
        /// <summary>
        /// Handle SetFundingSourceConfirmed API call
        /// </summary>
        /// <param name="context"></param>
        private void SetFundingSourceConfirmed(HttpContext context)
        {
            // # SetFundingSourceConfirmed API
            // The SetFundingSourceConfirmed API operation lets your application set up bank accounts as funding sources for PayPal accounts.
            NameValueCollection parameters = context.Request.Params;

            // (Required) The funding source key returned in the AddBankAccount or AddPaymentCard response.
            SetFundingSourceConfirmedRequest req =
                new SetFundingSourceConfirmedRequest(new RequestEnvelope(), parameters["fundingSourceKey"]);
            //(Optional) The merchant account Id of the PayPal account to
            // which the funding source was added in the AddPaymentCard or
            // AddBankAccount request. You must specify either the accountId
            // or mailAddress when making this request, but never both in
            // the same request.
            if (parameters["accountId"] != string.Empty)
                req.accountId = parameters["accountId"];

            // (Optional) The email address of the PayPal account to which
            // the funding source was added in the AddPaymentCard or
            // AddBankAccount request. You must specify either the accountId
            // or mailAddress when making this request, but never both in
            // the same request.
            if (parameters["emailAddress"] != string.Empty)
                req.emailAddress = parameters["emailAddress"];

            // Create the AdaptiveAccounts service object to make the API call
            AdaptiveAccountsService service = null;
            SetFundingSourceConfirmedResponse 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.SetFundingSourceConfirmed(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))
            {
                // nothing to add
            }
            displayResponse(context, "SetFundingSourceConfirmed", keyResponseParams, service.getLastRequest(), service.getLastResponse(),
                resp.error, redirectUrl);
        }
        /// <summary>
        /// Handle SetFundingSourceConfirmed API call
        /// </summary>
        /// <param name="context"></param>
        private void SetFundingSourceConfirmed(HttpContext context)
        {
            NameValueCollection parameters = context.Request.Params;
            SetFundingSourceConfirmedRequest req =
                new SetFundingSourceConfirmedRequest(new RequestEnvelope(), parameters["fundingSourceKey"]);
            // set optional parameters
            if (parameters["accountId"] != "")
                req.accountId = parameters["accountId"];
            if (parameters["emailAddress"] != "")
                req.emailAddress = parameters["emailAddress"];

            // All set. Fire the request
            AdaptiveAccountsService service = new AdaptiveAccountsService();
            SetFundingSourceConfirmedResponse resp = null;
            try
            {
                resp = service.SetFundingSourceConfirmed(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))
            {
                // nothing to add
            }
            displayResponse(context, "SetFundingSourceConfirmed", keyResponseParams, service.getLastRequest(), service.getLastResponse(),
                resp.error, redirectUrl);
        }
        /// <summary>
        /// To be updated.
        /// Countries Supported:
        /// AU - Australia
        /// AT - Austria
        /// BE - Belgium
        /// BR - Brazil
        /// CA - Canada
        /// CZ - Czech Republic
        /// FR
        /// - France
        /// DE - Germany
        /// GR - Greece
        /// HK - Hong Kong
        /// IE - Ireland
        /// IT - Italy
        /// JP - Japan
        /// LU - Luxembourg
        /// MX - Mexico
        /// NL - Netherlands
        /// NZ - New Zealand
        /// (Aotearoa)
        /// PL - Poland
        /// PT - Portugal
        /// RU - Russian Federation
        /// SG -
        /// Singapore
        /// ZA - South Africa
        /// ES - Spain
        /// CH - Switzerland
        /// UK - United
        /// Kingdom
        /// US - United States
        /// 
        /// 
        /// 
        /// 
        /// 
        /// </summary>
        ///<param name="setFundingSourceConfirmedRequest"></param>
        ///<param name="credential">An explicit ICredential object that you want to authenticate this call against</param> 
        public SetFundingSourceConfirmedResponse SetFundingSourceConfirmed(SetFundingSourceConfirmedRequest setFundingSourceConfirmedRequest, ICredential credential)
        {
            IAPICallPreHandler apiCallPreHandler = new PlatformAPICallPreHandler(this.config, setFundingSourceConfirmedRequest.ToNVPString(string.Empty), ServiceName, "SetFundingSourceConfirmed", credential);
               	 	((PlatformAPICallPreHandler) apiCallPreHandler).SDKName = SDKName;
            ((PlatformAPICallPreHandler) apiCallPreHandler).SDKVersion = SDKVersion;
            ((PlatformAPICallPreHandler) apiCallPreHandler).PortName = "AdaptiveAccounts";

            NVPUtil util = new NVPUtil();
            return SetFundingSourceConfirmedResponse.CreateInstance(util.ParseNVPString(Call(apiCallPreHandler)), string.Empty, -1);
        }
 /// <summary> 
 /// To be updated.
 /// Countries Supported:
 /// AU - Australia
 /// AT - Austria
 /// BE - Belgium
 /// BR - Brazil
 /// CA - Canada
 /// CZ - Czech Republic
 /// FR
 /// - France
 /// DE - Germany
 /// GR - Greece
 /// HK - Hong Kong
 /// IE - Ireland
 /// IT - Italy
 /// JP - Japan
 /// LU - Luxembourg
 /// MX - Mexico
 /// NL - Netherlands
 /// NZ - New Zealand
 /// (Aotearoa)
 /// PL - Poland
 /// PT - Portugal
 /// RU - Russian Federation
 /// SG -
 /// Singapore
 /// ZA - South Africa
 /// ES - Spain
 /// CH - Switzerland
 /// UK - United
 /// Kingdom
 /// US - United States
 /// 
 /// 
 /// 
 /// 
 /// 
 /// </summary>
 ///<param name="setFundingSourceConfirmedRequest"></param>
 public SetFundingSourceConfirmedResponse SetFundingSourceConfirmed(SetFundingSourceConfirmedRequest setFundingSourceConfirmedRequest)
 {
     return SetFundingSourceConfirmed(setFundingSourceConfirmedRequest,(string) null);
 }
示例#7
0
 /**
   * To be updated.
   *    Countries Supported:
   *     AU - Australia
   *     AT - Austria
   *     BE - Belgium
   *     BR - Brazil
   *     CA - Canada
   *     CZ - Czech Republic
   *     FR - France
   *     DE - Germany
   *     GR - Greece
   *     HK - Hong Kong
   *     IE - Ireland
   *     IT - Italy
   *     JP - Japan
   *     LU - Luxembourg
   *     MX - Mexico
   *     NL - Netherlands
   *     NZ - New Zealand (Aotearoa)
   *     PL - Poland
   *     PT - Portugal
   *     RU - Russian Federation
   *     SG - Singapore
   *     ZA - South Africa
   *     ES - Spain
   *     CH - Switzerland
   *     UK - United Kingdom
   *     US - United States
   *
   *
   *
   *
   *
  	  */
 public SetFundingSourceConfirmedResponse SetFundingSourceConfirmed(SetFundingSourceConfirmedRequest setFundingSourceConfirmedRequest, string apiUserName)
 {
     string response = Call("SetFundingSourceConfirmed", setFundingSourceConfirmedRequest.ToNVPString(""), apiUserName);
     NVPUtil util = new NVPUtil();
     return SetFundingSourceConfirmedResponse.CreateInstance(util.ParseNVPString(response), "", -1);
 }