當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。