コード例 #1
0
        /**
         *
         */
        public ConvertCurrencyResponse ConvertCurrency(ConvertCurrencyRequest ConvertCurrencyRequest, string apiUsername)
        {
            string resp = call("ConvertCurrency", ConvertCurrencyRequest.toNVPString(""), apiUsername);

            NVPUtil util = new NVPUtil();
            return new ConvertCurrencyResponse(util.parseNVPString(resp), "");
        }
コード例 #2
0
ファイル: InvoiceService.cs プロジェクト: bpossolo/SDKs
        /**
         *
         */
        public CreateInvoiceResponse CreateInvoice(CreateInvoiceRequest CreateInvoiceRequest, string apiUsername)
        {
            string resp = call("CreateInvoice", CreateInvoiceRequest.toNVPString(""), apiUsername);

            NVPUtil util = new NVPUtil();
            return new CreateInvoiceResponse(util.parseNVPString(resp), "");
        }
コード例 #3
0
        /**
         *		 * Countries Supported:
         * AU - Australia
         * CA - Canada
         * FR - France
         * DE - Germany
         * IL - Israel
         * IT - Italy
         * NL - Netherlands
         * UK - United Kingdom
         * US - United States

         */
        public AddBankAccountResponse AddBankAccount(AddBankAccountRequest AddBankAccountRequest, string apiUsername)
        {
            string resp = call("AddBankAccount", AddBankAccountRequest.toNVPString(""), apiUsername);

            NVPUtil util = new NVPUtil();
            return new AddBankAccountResponse(util.parseNVPString(resp), "");
        }
コード例 #4
0
ファイル: PermissionsService.cs プロジェクト: bpossolo/SDKs
        /**
         *
         */
        public CancelPermissionsResponse CancelPermissions(CancelPermissionsRequest CancelPermissionsRequest, string apiUsername)
        {
            string resp = call("CancelPermissions", CancelPermissionsRequest.toNVPString(""), apiUsername);

            NVPUtil util = new NVPUtil();
            return new CancelPermissionsResponse(util.parseNVPString(resp), "");
        }
コード例 #5
0
        /**
         *
         */
        public ConfirmPreapprovalResponse ConfirmPreapproval(ConfirmPreapprovalRequest ConfirmPreapprovalRequest, string apiUsername)
        {
            string resp = call("ConfirmPreapproval", ConfirmPreapprovalRequest.toNVPString(""), apiUsername);

            NVPUtil util = new NVPUtil();
            return new ConfirmPreapprovalResponse(util.parseNVPString(resp), "");
        }
コード例 #6
0
        private void Application_PreSendRequestContent(Object source,
          EventArgs e)
        {
            HttpApplication application = (HttpApplication)source;
            HttpContext context = application.Context;

            if (context.Items.Contains("responseObject")) {
                Object responseObj = context.Items["responseObject"];
                string originalResponse = (string) context.Items["responsePayload"];
                Dictionary<string, string> constructedMap = ReflectionUtil.decodeResponseObject(responseObj, string.Empty);
                NVPUtil nvpUtil = new NVPUtil();
                Dictionary<string, string> originalMap = nvpUtil.ParseNVPString(originalResponse);

                if (!originalMap.Equals(constructedMap)) {
                    foreach (string key in originalMap.Keys) {
                        if (!originalMap[key].Equals(constructedMap[key])) {
                            context.Response.Write(
                                "Original: " + key + " => " + originalMap[key]
                                    + " : " + "Constructed: " + key + " => "
                                    + constructedMap[key] + "<br/>");
                        }
                    }
                }
            }
        }
コード例 #7
0
        /**
         *
         */
        public ExecutePaymentResponse ExecutePayment(ExecutePaymentRequest ExecutePaymentRequest, string apiUsername)
        {
            string resp = call("ExecutePayment", ExecutePaymentRequest.toNVPString(""), apiUsername);

            NVPUtil util = new NVPUtil();
            return new ExecutePaymentResponse(util.parseNVPString(resp), "");
        }
コード例 #8
0
ファイル: PermissionsService.cs プロジェクト: bpossolo/SDKs
        /**
         *
         */
        public GetAdvancedPersonalDataResponse GetAdvancedPersonalData(GetAdvancedPersonalDataRequest GetAdvancedPersonalDataRequest, string apiUsername)
        {
            string resp = call("GetAdvancedPersonalData", GetAdvancedPersonalDataRequest.toNVPString(""), apiUsername);

            NVPUtil util = new NVPUtil();
            return new GetAdvancedPersonalDataResponse(util.parseNVPString(resp), "");
        }
コード例 #9
0
ファイル: PermissionsService.cs プロジェクト: bpossolo/SDKs
        /**
         *
         */
        public GetAccessTokenResponse GetAccessToken(GetAccessTokenRequest GetAccessTokenRequest, string apiUsername)
        {
            string resp = call("GetAccessToken", GetAccessTokenRequest.toNVPString(""), apiUsername);

            NVPUtil util = new NVPUtil();
            return new GetAccessTokenResponse(util.parseNVPString(resp), "");
        }
コード例 #10
0
ファイル: PermissionsService.cs プロジェクト: abawany/SDKs
        /**
         *
         */
        public GetPermissionsResponse GetPermissions(GetPermissionsRequest GetPermissionsRequest, string apiUsername)
        {
            BasePayPalService service = new BasePayPalService(serviceName);
            string resp = service.call("GetPermissions", GetPermissionsRequest.toNVPString(""), apiUsername);

            NVPUtil util = new NVPUtil();
            return new GetPermissionsResponse(util.parseNVPString(resp), "");
        }
コード例 #11
0
 /**
   *AUTO_GENERATED
  	  */
 public CancelPermissionsResponse CancelPermissions(CancelPermissionsRequest cancelPermissionsRequest, ICredential credential)
 {
     IAPICallPreHandler apiCallPreHandler = null;
     apiCallPreHandler = new PlatformAPICallPreHandler(cancelPermissionsRequest.ToNVPString(string.Empty), ServiceName, "CancelPermissions", credential);
        	 	((PlatformAPICallPreHandler) apiCallPreHandler).SDKName = SDKName;
     ((PlatformAPICallPreHandler) apiCallPreHandler).SDKVersion = SDKVersion;
     string response = Call(apiCallPreHandler);
     NVPUtil util = new NVPUtil();
     return CancelPermissionsResponse.CreateInstance(util.ParseNVPString(response), string.Empty, -1);
 }
        /// <summary>
        /// Countries Supported:
        /// AU - Australia
        /// CA - Canada
        /// FR -
        /// France
        /// DE - Germany
        /// IL - Israel
        /// IT - Italy
        /// NL - Netherlands
        /// UK - United
        /// Kingdom
        /// US - United States
        /// 
        /// 
        /// 
        /// 
        /// 
        /// </summary>
        ///<param name="addBankAccountRequest"></param>
        ///<param name="apiUserName">API Username that you want to authenticate this call against. This username and the corresponding 3-token/certificate credentials must be available in Web.Config/App.Config</param>
        public AddBankAccountResponse AddBankAccount(AddBankAccountRequest addBankAccountRequest, string apiUserName)
        {
            IAPICallPreHandler apiCallPreHandler = new PlatformAPICallPreHandler(this.config, addBankAccountRequest.ToNVPString(string.Empty), ServiceName, "AddBankAccount", apiUserName, getAccessToken(), getAccessTokenSecret());
               	 	((PlatformAPICallPreHandler) apiCallPreHandler).SDKName = SDKName;
            ((PlatformAPICallPreHandler) apiCallPreHandler).SDKVersion = SDKVersion;
            ((PlatformAPICallPreHandler) apiCallPreHandler).PortName = "AdaptiveAccounts";

            NVPUtil util = new NVPUtil();
            return AddBankAccountResponse.CreateInstance(util.ParseNVPString(Call(apiCallPreHandler)), string.Empty, -1);
        }
コード例 #13
0
 /**
   *AUTO_GENERATED
  	  */
 public GetAccessTokenResponse GetAccessToken(GetAccessTokenRequest getAccessTokenRequest, string apiUserName)
 {
     IAPICallPreHandler apiCallPreHandler = null;
     apiCallPreHandler = new PlatformAPICallPreHandler(getAccessTokenRequest.ToNVPString(string.Empty), ServiceName, "GetAccessToken", apiUserName, getAccessToken(), getAccessTokenSecret());
        	 	((PlatformAPICallPreHandler) apiCallPreHandler).SDKName = SDKName;
     ((PlatformAPICallPreHandler) apiCallPreHandler).SDKVersion = SDKVersion;
     string response = Call(apiCallPreHandler);
     NVPUtil util = new NVPUtil();
     return GetAccessTokenResponse.CreateInstance(util.ParseNVPString(response), string.Empty, -1);
 }
コード例 #14
0
        /// <summary>
        /// 
        /// </summary>
        ///<param name="cancelInvoiceRequest"></param>
        ///<param name="apiUserName">API Username that you want to authenticate this call against. This username and the corresponding 3-token/certificate credentials must be available in Web.Config/App.Config</param>
        public CancelInvoiceResponse CancelInvoice(CancelInvoiceRequest cancelInvoiceRequest, string apiUserName)
        {
            IAPICallPreHandler apiCallPreHandler = new PlatformAPICallPreHandler(this.config, cancelInvoiceRequest.ToNVPString(string.Empty), ServiceName, "CancelInvoice", apiUserName, getAccessToken(), getAccessTokenSecret());
               	 	((PlatformAPICallPreHandler) apiCallPreHandler).SDKName = SDKName;
            ((PlatformAPICallPreHandler) apiCallPreHandler).SDKVersion = SDKVersion;
            ((PlatformAPICallPreHandler) apiCallPreHandler).PortName = "Invoice";

            NVPUtil util = new NVPUtil();
            return CancelInvoiceResponse.CreateInstance(util.ParseNVPString(Call(apiCallPreHandler)), string.Empty, -1);
        }
コード例 #15
0
	 	/// <summary>
		/// 
	 	/// </summary>
		///<param name="cancelPreapprovalRequest"></param>
		///<param name="credential">An explicit ICredential object that you want to authenticate this call against</param> 
	 	public CancelPreapprovalResponse CancelPreapproval(CancelPreapprovalRequest cancelPreapprovalRequest, ICredential credential)
	 	{	 			 		
			IAPICallPreHandler apiCallPreHandler = new PlatformAPICallPreHandler(this.config, cancelPreapprovalRequest.ToNVPString(string.Empty), ServiceName, "CancelPreapproval", credential);
	   	 	((PlatformAPICallPreHandler) apiCallPreHandler).SDKName = SDKName;
			((PlatformAPICallPreHandler) apiCallPreHandler).SDKVersion = SDKVersion;
			((PlatformAPICallPreHandler) apiCallPreHandler).PortName = "AdaptivePayments";

			NVPUtil util = new NVPUtil();
			return CancelPreapprovalResponse.CreateInstance(util.ParseNVPString(Call(apiCallPreHandler)), string.Empty, -1);
			
	 	}
コード例 #16
0
        /**
         *
         */
        public SetPaymentOptionsResponse SetPaymentOptions(SetPaymentOptionsRequest SetPaymentOptionsRequest, string apiUsername)
        {
            string resp = call("SetPaymentOptions", SetPaymentOptionsRequest.toNVPString(""), apiUsername);

            NVPUtil util = new NVPUtil();
            return new SetPaymentOptionsResponse(util.parseNVPString(resp), "");
        }
コード例 #17
0
        /**
         *
         */
        public RefundResponse Refund(RefundRequest RefundRequest, string apiUsername)
        {
            string resp = call("Refund", RefundRequest.toNVPString(""), apiUsername);

            NVPUtil util = new NVPUtil();
            return new RefundResponse(util.parseNVPString(resp), "");
        }
コード例 #18
0
        /**
         *
         */
        public PreapprovalDetailsResponse PreapprovalDetails(PreapprovalDetailsRequest PreapprovalDetailsRequest, string apiUsername)
        {
            string resp = call("PreapprovalDetails", PreapprovalDetailsRequest.toNVPString(""), apiUsername);

            NVPUtil util = new NVPUtil();
            return new PreapprovalDetailsResponse(util.parseNVPString(resp), "");
        }
コード例 #19
0
        /**
         *
         */
        public PaymentDetailsResponse PaymentDetails(PaymentDetailsRequest PaymentDetailsRequest, string apiUsername)
        {
            string resp = call("PaymentDetails", PaymentDetailsRequest.toNVPString(""), apiUsername);

            NVPUtil util = new NVPUtil();
            return new PaymentDetailsResponse(util.parseNVPString(resp), "");
        }
コード例 #20
0
        /**
         *
         */
        public GetUserLimitsResponse GetUserLimits(GetUserLimitsRequest GetUserLimitsRequest, string apiUsername)
        {
            string resp = call("GetUserLimits", GetUserLimitsRequest.toNVPString(""), apiUsername);

            NVPUtil util = new NVPUtil();
            return new GetUserLimitsResponse(util.parseNVPString(resp), "");
        }
コード例 #21
0
        /**
         *
         */
        public GetAvailableShippingAddressesResponse GetAvailableShippingAddresses(GetAvailableShippingAddressesRequest GetAvailableShippingAddressesRequest, string apiUsername)
        {
            string resp = call("GetAvailableShippingAddresses", GetAvailableShippingAddressesRequest.toNVPString(""), apiUsername);

            NVPUtil util = new NVPUtil();
            return new GetAvailableShippingAddressesResponse(util.parseNVPString(resp), "");
        }
コード例 #22
0
ファイル: InvoiceService.cs プロジェクト: kashyapkk/SDKs
 /**
   *AUTO_GENERATED
  	  */
 public UpdateInvoiceResponse UpdateInvoice(UpdateInvoiceRequest UpdateInvoiceRequest, string apiUsername)
 {
     string resp = call("UpdateInvoice", UpdateInvoiceRequest.toNVPString(""), apiUsername);
     NVPUtil util = new NVPUtil();
     return new UpdateInvoiceResponse(util.parseNVPString(resp), "");
 }
コード例 #23
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), "");
        }
コード例 #24
0
        /// <summary>
        /// 
        /// </summary>
        ///<param name="updateInvoiceRequest"></param>
        ///<param name="credential">An explicit ICredential object that you want to authenticate this call against</param> 
        public UpdateInvoiceResponse UpdateInvoice(UpdateInvoiceRequest updateInvoiceRequest, ICredential credential)
        {
            IAPICallPreHandler apiCallPreHandler = new PlatformAPICallPreHandler(this.config, updateInvoiceRequest.ToNVPString(string.Empty), ServiceName, "UpdateInvoice", credential);
               	 	((PlatformAPICallPreHandler) apiCallPreHandler).SDKName = SDKName;
            ((PlatformAPICallPreHandler) apiCallPreHandler).SDKVersion = SDKVersion;
            ((PlatformAPICallPreHandler) apiCallPreHandler).PortName = "Invoice";

            NVPUtil util = new NVPUtil();
            return UpdateInvoiceResponse.CreateInstance(util.ParseNVPString(Call(apiCallPreHandler)), string.Empty, -1);
        }
コード例 #25
0
        /**
         *		 * 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 AddPaymentCardResponse AddPaymentCard(AddPaymentCardRequest AddPaymentCardRequest, string apiUsername)
        {
            string resp = call("AddPaymentCard", AddPaymentCardRequest.toNVPString(""), apiUsername);

            NVPUtil util = new NVPUtil();
            return new AddPaymentCardResponse(util.parseNVPString(resp), "");
        }
コード例 #26
0
ファイル: InvoiceService.cs プロジェクト: kashyapkk/SDKs
 /**
   *AUTO_GENERATED
  	  */
 public MarkInvoiceAsUnpaidResponse MarkInvoiceAsUnpaid(MarkInvoiceAsUnpaidRequest MarkInvoiceAsUnpaidRequest, string apiUsername)
 {
     string resp = call("MarkInvoiceAsUnpaid", MarkInvoiceAsUnpaidRequest.toNVPString(""), apiUsername);
     NVPUtil util = new NVPUtil();
     return new MarkInvoiceAsUnpaidResponse(util.parseNVPString(resp), "");
 }
コード例 #27
0
ファイル: NVPUtilTest.cs プロジェクト: kashyapkk/SDKs
        public static void SplitResponseStringTest()
        {
            NVPUtil util = new NVPUtil();
            Dictionary<string, string> ret = util.parseNVPString("responseEnvelope.timestamp=2011-05-11T22%3A05%3A33.962-07%3A00&responseEnvelope.ack=Failure&responseEnvelope.correlationId=b1985a21862fe&responseEnvelope.build=1877082&error(0).errorId=580022&error(0).domain=PLATFORM&error(0).subdomain=Application&error(0).severity=Error&error(0).category=Application&error(0).message=Invalid+request+parameter%3A+shippingTaxName+cannot+be+null&error(0).parameter(0)=shippingTaxName&error(0).parameter(1)=null&error(1).errorId=580022&error(1).domain=PLATFORM&error(1).subdomain=Application&error(1).severity=Error&error(1).category=Application&error(1).message=Invalid+request+parameter%3A+taxName+cannot+be+null&error(1).parameter(0)=taxName&error(1).parameter(1)=null");
            Assert.AreEqual(ret.Count, 20);
            Assert.IsTrue(ret.ContainsKey("responseEnvelope.timestamp"));
            Assert.AreEqual(ret["responseEnvelope.timestamp"], "2011-05-11T22:05:33.962-07:00");

            Assert.IsTrue(ret.ContainsKey("responseEnvelope.ack"));
            Assert.AreEqual(ret["responseEnvelope.ack"], "Failure");

            Assert.IsTrue(ret.ContainsKey("responseEnvelope.correlationId"));
            Assert.AreEqual(ret["responseEnvelope.correlationId"], "b1985a21862fe");

            Assert.IsTrue(ret.ContainsKey("responseEnvelope.build"));
            Assert.AreEqual(ret["responseEnvelope.build"], "1877082");

            Assert.IsTrue(ret.ContainsKey("error(0).errorId"));
            Assert.AreEqual(ret["error(0).errorId"], "580022");

            Assert.IsTrue(ret.ContainsKey("error(0).domain"));
            Assert.AreEqual(ret["error(0).domain"], "PLATFORM");

            Assert.IsTrue(ret.ContainsKey("error(0).subdomain"));
            Assert.AreEqual(ret["error(0).subdomain"], "Application");

            Assert.IsTrue(ret.ContainsKey("error(0).severity"));
            Assert.AreEqual(ret["error(0).severity"], "Error");

            Assert.IsTrue(ret.ContainsKey("error(0).category"));
            Assert.AreEqual(ret["error(0).category"], "Application");

            Assert.IsTrue(ret.ContainsKey("error(0).message"));
            Assert.AreEqual(ret["error(0).message"], "Invalid request parameter: shippingTaxName cannot be null");

            Assert.IsTrue(ret.ContainsKey("error(0).parameter(0)"));
            Assert.AreEqual(ret["error(0).parameter(0)"], "shippingTaxName");

            Assert.IsTrue(ret.ContainsKey("error(0).parameter(1)"));
            Assert.AreEqual(ret["error(0).parameter(1)"], "null");

            Assert.IsTrue(ret.ContainsKey("error(1).errorId"));
            Assert.AreEqual(ret["error(1).errorId"], "580022");

            Assert.IsTrue(ret.ContainsKey("error(1).domain"));
            Assert.AreEqual(ret["error(1).domain"], "PLATFORM");

            Assert.IsTrue(ret.ContainsKey("error(1).subdomain"));
            Assert.AreEqual(ret["error(1).subdomain"], "Application");

            Assert.IsTrue(ret.ContainsKey("error(1).severity"));
            Assert.AreEqual(ret["error(1).severity"], "Error");

            Assert.IsTrue(ret.ContainsKey("error(1).category"));
            Assert.AreEqual(ret["error(1).category"], "Application");

            Assert.IsTrue(ret.ContainsKey("error(1).message"));
            Assert.AreEqual(ret["error(1).message"], "Invalid request parameter: taxName cannot be null");

            Assert.IsTrue(ret.ContainsKey("error(1).parameter(0)"));
            Assert.AreEqual(ret["error(1).parameter(0)"], "taxName");

            Assert.IsTrue(ret.ContainsKey("error(1).parameter(1)"));
            Assert.AreEqual(ret["error(1).parameter(1)"], "null");
        }
コード例 #28
0
        /**
         *
         */
        public GetAllowedFundingSourcesResponse GetAllowedFundingSources(GetAllowedFundingSourcesRequest GetAllowedFundingSourcesRequest, string apiUsername)
        {
            string resp = call("GetAllowedFundingSources", GetAllowedFundingSourcesRequest.toNVPString(""), apiUsername);

            NVPUtil util = new NVPUtil();
            return new GetAllowedFundingSourcesResponse(util.parseNVPString(resp), "");
        }
コード例 #29
0
 /**
   *AUTO_GENERATED
  	  */
 public GetBasicPersonalDataResponse GetBasicPersonalData(GetBasicPersonalDataRequest getBasicPersonalDataRequest, ICredential credential)
 {
     IAPICallPreHandler apiCallPreHandler = null;
     apiCallPreHandler = new PlatformAPICallPreHandler(getBasicPersonalDataRequest.ToNVPString(string.Empty), ServiceName, "GetBasicPersonalData", credential);
        	 	((PlatformAPICallPreHandler) apiCallPreHandler).SDKName = SDKName;
     ((PlatformAPICallPreHandler) apiCallPreHandler).SDKVersion = SDKVersion;
     string response = Call(apiCallPreHandler);
     NVPUtil util = new NVPUtil();
     return GetBasicPersonalDataResponse.CreateInstance(util.ParseNVPString(response), string.Empty, -1);
 }
コード例 #30
0
ファイル: InvoiceService.cs プロジェクト: kashyapkk/SDKs
 /**
   *AUTO_GENERATED
  	  */
 public SendInvoiceResponse SendInvoice(SendInvoiceRequest SendInvoiceRequest, string apiUsername)
 {
     string resp = call("SendInvoice", SendInvoiceRequest.toNVPString(""), apiUsername);
     NVPUtil util = new NVPUtil();
     return new SendInvoiceResponse(util.parseNVPString(resp), "");
 }