当前位置: 首页>>代码示例>>C#>>正文


C# NVP.PlatformAPICallPreHandler类代码示例

本文整理汇总了C#中PayPal.NVP.PlatformAPICallPreHandler的典型用法代码示例。如果您正苦于以下问题:C# PlatformAPICallPreHandler类的具体用法?C# PlatformAPICallPreHandler怎么用?C# PlatformAPICallPreHandler使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


PlatformAPICallPreHandler类属于PayPal.NVP命名空间,在下文中一共展示了PlatformAPICallPreHandler类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetEndpointForDefaultModeWithoutEndpoint

        public void GetEndpointForDefaultModeWithoutEndpoint()
        {
            Dictionary<string, string> config = new Dictionary<string, string>(accountConfig);

            PlatformAPICallPreHandler platformHandler = new PlatformAPICallPreHandler(config, "payload", "servicename", "method", Constants.APIUserName, "accessToken", "tokenSecret");
            platformHandler.GetEndpoint();
        }
开发者ID:NikolayGlynchak,项目名称:sdk-core-dotnet,代码行数:7,代码来源:PlatformAPICallPreHandlerTest.cs

示例2: GetEndpointForSandboxMode

        public void GetEndpointForSandboxMode()
        {
            Dictionary<string, string> config = new Dictionary<string, string>(accountConfig);
            config.Add(BaseConstants.ApplicationModeConfig, BaseConstants.LiveMode);

            PlatformAPICallPreHandler platformHandler = new PlatformAPICallPreHandler(config, "payload", "servicename", "method", Constants.APIUserName, "accessToken", "tokenSecret");
            Assert.AreEqual(BaseConstants.PlatformLiveEndpoint + "servicename/method", platformHandler.GetEndpoint());
        }
开发者ID:NikolayGlynchak,项目名称:sdk-core-dotnet,代码行数:8,代码来源:PlatformAPICallPreHandlerTest.cs

示例3: GetEndpointForSandboxMode

        public void GetEndpointForSandboxMode()
        {
            Dictionary<string, string> config = new Dictionary<string, string>(accountConfig);
            config.Add(BaseConstants.APPLICATION_MODE_CONFIG, BaseConstants.LIVE_MODE);

            PlatformAPICallPreHandler platformHandler = new PlatformAPICallPreHandler(config, "payload", "servicename", "method", UnitTestConstants.APIUserName, "accessToken", "tokenSecret");
            Assert.AreEqual(BaseConstants.PLATFORM_LIVE_ENDPOINT + "servicename/method", platformHandler.GetEndPoint());
        }
开发者ID:Hankahn,项目名称:sdk-core-dotnet,代码行数:8,代码来源:PlatformAPICallPreHandlerTest.cs

示例4: GetHeaderMapWithSignatureWithTokenTest

 public void GetHeaderMapWithSignatureWithTokenTest()
 {
     platformAPIHandler = new PlatformAPICallPreHandler("payload", "servicename", "method", UnitTestConstants.APIUserName, "accessToken", "tokenSecret");
     Dictionary<string, string> header = platformAPIHandler.GetHeaderMap();
     string authHeader = header["X-PAYPAL-AUTHORIZATION"];
     string[] headers = authHeader.Split(',');
     Assert.AreEqual("token=accessToken", headers[0]);
 }
开发者ID:israelgoldstein,项目名称:sdk-core-dotnet,代码行数:8,代码来源:PlatformAPICallPreHandlerTest.cs

示例5: CancelPermissions

        /// <summary>
        /// 
        /// </summary>
        ///<param name="cancelPermissionsRequest"></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 CancelPermissionsResponse CancelPermissions(CancelPermissionsRequest cancelPermissionsRequest, string apiUserName)
        {
            IAPICallPreHandler apiCallPreHandler = new PlatformAPICallPreHandler(this.config, cancelPermissionsRequest.ToNVPString(string.Empty), ServiceName, "CancelPermissions", apiUserName, getAccessToken(), getAccessTokenSecret());
               	 	((PlatformAPICallPreHandler) apiCallPreHandler).SDKName = SDKName;
            ((PlatformAPICallPreHandler) apiCallPreHandler).SDKVersion = SDKVersion;
            ((PlatformAPICallPreHandler) apiCallPreHandler).PortName = "Permissions";

            NVPUtil util = new NVPUtil();
            return CancelPermissionsResponse.CreateInstance(util.ParseNVPString(Call(apiCallPreHandler)), string.Empty, -1);
        }
开发者ID:JCVega,项目名称:permissions-sdk-dotnet,代码行数:15,代码来源:PermissionsService.cs

示例6: GetPayloadEndpointWithoutTokenTest

 public void GetPayloadEndpointWithoutTokenTest()
 {
     platformAPIHandler = new PlatformAPICallPreHandler("payload", "servicename", "method", UnitTestConstants.APIUserName, "accessToken", "tokenSecret");
     Assert.AreEqual("https://svcs.sandbox.paypal.com/servicename/method", platformAPIHandler.GetEndPoint());
     Assert.AreEqual("payload", platformAPIHandler.GetPayLoad());
     SignatureCredential signatureCredential = (SignatureCredential)platformAPIHandler.GetCredential();
     TokenAuthorization thirdAuth = (TokenAuthorization)signatureCredential.ThirdPartyAuthorization;
     Assert.AreEqual("accessToken", thirdAuth.AccessToken);
     Assert.AreEqual("tokenSecret", thirdAuth.TokenSecret);
 }
开发者ID:israelgoldstein,项目名称:sdk-core-dotnet,代码行数:10,代码来源:PlatformAPICallPreHandlerTest.cs

示例7: CancelInvoice

        /// <summary>
        /// 
        /// </summary>
        ///<param name="cancelInvoiceRequest"></param>
        ///<param name="credential">An explicit ICredential object that you want to authenticate this call against</param> 
        public CancelInvoiceResponse CancelInvoice(CancelInvoiceRequest cancelInvoiceRequest, ICredential credential)
        {
            IAPICallPreHandler apiCallPreHandler = new PlatformAPICallPreHandler(this.config, cancelInvoiceRequest.ToNVPString(string.Empty), ServiceName, "CancelInvoice", credential);
               	 	((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);
        }
开发者ID:paypal,项目名称:invoice-sdk-dotnet,代码行数:15,代码来源:InvoiceService.cs

示例8: CancelPermissions

 /**
   *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);
 }
开发者ID:israelgoldstein,项目名称:invoice-sdk-dotnet,代码行数:13,代码来源:PermissionsService.cs

示例9: GetAccessToken

 /**
   *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);
 }
开发者ID:israelgoldstein,项目名称:invoice-sdk-dotnet,代码行数:13,代码来源:PermissionsService.cs

示例10: AddBankAccount

        /// <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);
        }
开发者ID:kleopatra999,项目名称:adaptiveaccounts-sdk-dotnet,代码行数:31,代码来源:AdaptiveAccountsService.cs

示例11: GetHeaderMapCertificateWithoutTokenTest

 public void GetHeaderMapCertificateWithoutTokenTest()
 {
     credentialMngr = CredentialManager.Instance;
     credential = credentialMngr.GetCredentials(UnitTestConstants.CertificateAPIUserName);
     platformAPIHandler = new PlatformAPICallPreHandler("payload", "servicename", "method", credential);
     Dictionary<string, string> header = platformAPIHandler.GetHeaderMap();
     Assert.AreEqual(UnitTestConstants.CertificateAPIUserName, header[BaseConstants.PAYPAL_SECURITY_USERID_HEADER]);
     Assert.AreEqual(UnitTestConstants.CertificateAPIPassword, header[BaseConstants.PAYPAL_SECURITY_PASSWORD_HEADER]);
     Assert.AreEqual(UnitTestConstants.ApplicationID, header[BaseConstants.PAYPAL_APPLICATION_ID]);
     Assert.AreEqual(BaseConstants.NVP, header[BaseConstants.PAYPAL_REQUEST_DATA_FORMAT_HEADER]);
     Assert.AreEqual(BaseConstants.NVP, header[BaseConstants.PAYPAL_RESPONSE_DATA_FORMAT_HEADER]);
 }
开发者ID:israelgoldstein,项目名称:sdk-core-dotnet,代码行数:12,代码来源:PlatformAPICallPreHandlerTest.cs

示例12: GetEndpointForDefaultModeWithExplicitEndpoint

        public void GetEndpointForDefaultModeWithExplicitEndpoint()
        {
            Dictionary<string, string> config = new Dictionary<string, string>(accountConfig);
            config.Add(BaseConstants.EndpointConfig, Constants.APIEndpointNVP);

            PlatformAPICallPreHandler platformHandler = new PlatformAPICallPreHandler(config, "payload", "servicename", "method", Constants.APIUserName, "accessToken", "tokenSecret");
            Assert.AreEqual(Constants.APIEndpointNVP + "servicename/method", platformHandler.GetEndpoint());

            config.Add("PayPalAPI", Constants.APIEndpointSOAP);
            platformHandler = new PlatformAPICallPreHandler(config, "payload", "servicename", "method", Constants.APIUserName, "accessToken", "tokenSecret");
            platformHandler.PortName = "PayPalAPI";
            Assert.AreEqual(Constants.APIEndpointSOAP + "/servicename/method", platformHandler.GetEndpoint());
        }
开发者ID:NikolayGlynchak,项目名称:sdk-core-dotnet,代码行数:13,代码来源:PlatformAPICallPreHandlerTest.cs

示例13: AddPaymentCard

        /// <summary>
        /// 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="addPaymentCardRequest"></param>
        ///<param name="credential">An explicit ICredential object that you want to authenticate this call against</param> 
        public AddPaymentCardResponse AddPaymentCard(AddPaymentCardRequest addPaymentCardRequest, ICredential credential)
        {
            IAPICallPreHandler apiCallPreHandler = new PlatformAPICallPreHandler(this.config, addPaymentCardRequest.ToNVPString(string.Empty), ServiceName, "AddPaymentCard", credential);
               	 	((PlatformAPICallPreHandler) apiCallPreHandler).SDKName = SDKName;
            ((PlatformAPICallPreHandler) apiCallPreHandler).SDKVersion = SDKVersion;
            ((PlatformAPICallPreHandler) apiCallPreHandler).PortName = "AdaptiveAccounts";

            NVPUtil util = new NVPUtil();
            return AddPaymentCardResponse.CreateInstance(util.ParseNVPString(Call(apiCallPreHandler)), string.Empty, -1);
        }
开发者ID:kleopatra999,项目名称:adaptiveaccounts-sdk-dotnet,代码行数:52,代码来源:AdaptiveAccountsService.cs

示例14: GetHeaderMapWithCertificateWithTokenTest

 public void GetHeaderMapWithCertificateWithTokenTest()
 {
     platformAPIHandler = new PlatformAPICallPreHandler(ConfigManager.Instance.GetProperties(), "payload", "servicename", "method", Constants.CertificateAPIUserName, "accessToken", "tokenSecret");
     Dictionary<string, string> header = platformAPIHandler.GetHeaderMap();
     string authHeader = header[BaseConstants.PayPalAuthorizationPlatformHeader];
     string[] headers = authHeader.Split(',');
     Assert.AreEqual("token=accessToken", headers[0]);
 }
开发者ID:NikolayGlynchak,项目名称:sdk-core-dotnet,代码行数:8,代码来源:PlatformAPICallPreHandlerTest.cs

示例15: GetBasicPersonalData

 /**
   *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);
 }
开发者ID:israelgoldstein,项目名称:invoice-sdk-dotnet,代码行数:13,代码来源:PermissionsService.cs


注:本文中的PayPal.NVP.PlatformAPICallPreHandler类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。