本文整理汇总了C#中PayPal.Authentication.ICredential类的典型用法代码示例。如果您正苦于以下问题:C# ICredential类的具体用法?C# ICredential怎么用?C# ICredential使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ICredential类属于PayPal.Authentication命名空间,在下文中一共展示了ICredential类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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);
}
示例2: 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);
}
示例3: AddressVerify
/**
*AUTO_GENERATED
*/
public AddressVerifyResponseType AddressVerify(AddressVerifyReq addressVerifyReq, ICredential credential)
{
IAPICallPreHandler apiCallPreHandler = null;
string portName = "PayPalAPI";
setStandardParams(addressVerifyReq.AddressVerifyRequest);
DefaultSOAPAPICallHandler defaultHandler = new DefaultSOAPAPICallHandler(addressVerifyReq.ToXMLString(null, "AddressVerifyReq"), null, null);
apiCallPreHandler = new MerchantAPICallPreHandler(defaultHandler, credential);
((MerchantAPICallPreHandler) apiCallPreHandler).SDKName = SDKName;
((MerchantAPICallPreHandler) apiCallPreHandler).SDKVersion = SDKVersion;
((MerchantAPICallPreHandler) apiCallPreHandler).PortName = portName;
string response = Call(apiCallPreHandler);
XmlDocument xmlDocument = new XmlDocument();
xmlDocument.LoadXml(response);
XmlNode xmlNode = xmlDocument.SelectSingleNode("*[local-name()='Envelope']/*[local-name()='Body']/*[local-name()='AddressVerifyResponse']");
return new AddressVerifyResponseType(xmlNode);
}
示例4: DoReferenceTransaction
/// <summary>
///
/// </summary>
///<param name="doReferenceTransactionReq"></param>
///<param name="credential">An explicit ICredential object that you want to authenticate this call against</param>
public DoReferenceTransactionResponseType DoReferenceTransaction(DoReferenceTransactionReq doReferenceTransactionReq, ICredential credential)
{
setStandardParams(doReferenceTransactionReq.DoReferenceTransactionRequest);
DefaultSOAPAPICallHandler defaultHandler = new DefaultSOAPAPICallHandler(this.config, doReferenceTransactionReq.ToXMLString(null, "DoReferenceTransactionReq"), null, null);
IAPICallPreHandler apiCallPreHandler = new MerchantAPICallPreHandler(this.config, defaultHandler, credential);
((MerchantAPICallPreHandler) apiCallPreHandler).SDKName = SDKName;
((MerchantAPICallPreHandler) apiCallPreHandler).SDKVersion = SDKVersion;
((MerchantAPICallPreHandler) apiCallPreHandler).PortName = "PayPalAPIAA";
XmlDocument xmlDocument = new XmlDocument();
xmlDocument.LoadXml(Call(apiCallPreHandler));
return new DoReferenceTransactionResponseType(
xmlDocument.SelectSingleNode("*[local-name()='Envelope']/*[local-name()='Body']/*[local-name()='DoReferenceTransactionResponse']")
);
}
示例5: CreateRecurringPaymentsProfile
/// <summary>
///
/// </summary>
///<param name="createRecurringPaymentsProfileReq"></param>
///<param name="credential">An explicit ICredential object that you want to authenticate this call against</param>
public CreateRecurringPaymentsProfileResponseType CreateRecurringPaymentsProfile(CreateRecurringPaymentsProfileReq createRecurringPaymentsProfileReq, ICredential credential)
{
setStandardParams(createRecurringPaymentsProfileReq.CreateRecurringPaymentsProfileRequest);
DefaultSOAPAPICallHandler defaultHandler = new DefaultSOAPAPICallHandler(this.config, createRecurringPaymentsProfileReq.ToXMLString(null, "CreateRecurringPaymentsProfileReq"), null, null);
IAPICallPreHandler apiCallPreHandler = new MerchantAPICallPreHandler(this.config, defaultHandler, credential);
((MerchantAPICallPreHandler) apiCallPreHandler).SDKName = SDKName;
((MerchantAPICallPreHandler) apiCallPreHandler).SDKVersion = SDKVersion;
((MerchantAPICallPreHandler) apiCallPreHandler).PortName = "PayPalAPIAA";
XmlDocument xmlDocument = new XmlDocument();
xmlDocument.LoadXml(Call(apiCallPreHandler));
return new CreateRecurringPaymentsProfileResponseType(
xmlDocument.SelectSingleNode("*[local-name()='Envelope']/*[local-name()='Body']/*[local-name()='CreateRecurringPaymentsProfileResponse']")
);
}
示例6: UpdateAccessPermissions
/// <summary>
///
/// </summary>
///<param name="updateAccessPermissionsReq"></param>
///<param name="credential">An explicit ICredential object that you want to authenticate this call against</param>
public UpdateAccessPermissionsResponseType UpdateAccessPermissions(UpdateAccessPermissionsReq updateAccessPermissionsReq, ICredential credential)
{
setStandardParams(updateAccessPermissionsReq.UpdateAccessPermissionsRequest);
DefaultSOAPAPICallHandler defaultHandler = new DefaultSOAPAPICallHandler(this.config, updateAccessPermissionsReq.ToXMLString(null, "UpdateAccessPermissionsReq"), null, null);
IAPICallPreHandler apiCallPreHandler = new MerchantAPICallPreHandler(this.config, defaultHandler, credential);
((MerchantAPICallPreHandler) apiCallPreHandler).SDKName = SDKName;
((MerchantAPICallPreHandler) apiCallPreHandler).SDKVersion = SDKVersion;
((MerchantAPICallPreHandler) apiCallPreHandler).PortName = "PayPalAPIAA";
XmlDocument xmlDocument = new XmlDocument();
xmlDocument.LoadXml(Call(apiCallPreHandler));
return new UpdateAccessPermissionsResponseType(
xmlDocument.SelectSingleNode("*[local-name()='Envelope']/*[local-name()='Body']/*[local-name()='UpdateAccessPermissionsResponse']")
);
}
示例7: SetMobileCheckout
/// <summary>
///
/// </summary>
///<param name="setMobileCheckoutReq"></param>
///<param name="credential">An explicit ICredential object that you want to authenticate this call against</param>
public SetMobileCheckoutResponseType SetMobileCheckout(SetMobileCheckoutReq setMobileCheckoutReq, ICredential credential)
{
setStandardParams(setMobileCheckoutReq.SetMobileCheckoutRequest);
DefaultSOAPAPICallHandler defaultHandler = new DefaultSOAPAPICallHandler(this.config, setMobileCheckoutReq.ToXMLString(null, "SetMobileCheckoutReq"), null, null);
IAPICallPreHandler apiCallPreHandler = new MerchantAPICallPreHandler(this.config, defaultHandler, credential);
((MerchantAPICallPreHandler) apiCallPreHandler).SDKName = SDKName;
((MerchantAPICallPreHandler) apiCallPreHandler).SDKVersion = SDKVersion;
((MerchantAPICallPreHandler) apiCallPreHandler).PortName = "PayPalAPI";
XmlDocument xmlDocument = new XmlDocument();
xmlDocument.LoadXml(Call(apiCallPreHandler));
return new SetMobileCheckoutResponseType(
xmlDocument.SelectSingleNode("*[local-name()='Envelope']/*[local-name()='Body']/*[local-name()='SetMobileCheckoutResponse']")
);
}
示例8: GetBillingAgreementCustomerDetails
/// <summary>
///
/// </summary>
///<param name="getBillingAgreementCustomerDetailsReq"></param>
///<param name="credential">An explicit ICredential object that you want to authenticate this call against</param>
public GetBillingAgreementCustomerDetailsResponseType GetBillingAgreementCustomerDetails(GetBillingAgreementCustomerDetailsReq getBillingAgreementCustomerDetailsReq, ICredential credential)
{
setStandardParams(getBillingAgreementCustomerDetailsReq.GetBillingAgreementCustomerDetailsRequest);
DefaultSOAPAPICallHandler defaultHandler = new DefaultSOAPAPICallHandler(this.config, getBillingAgreementCustomerDetailsReq.ToXMLString(null, "GetBillingAgreementCustomerDetailsReq"), null, null);
IAPICallPreHandler apiCallPreHandler = new MerchantAPICallPreHandler(this.config, defaultHandler, credential);
((MerchantAPICallPreHandler) apiCallPreHandler).SDKName = SDKName;
((MerchantAPICallPreHandler) apiCallPreHandler).SDKVersion = SDKVersion;
((MerchantAPICallPreHandler) apiCallPreHandler).PortName = "PayPalAPIAA";
XmlDocument xmlDocument = new XmlDocument();
xmlDocument.LoadXml(Call(apiCallPreHandler));
return new GetBillingAgreementCustomerDetailsResponseType(
xmlDocument.SelectSingleNode("*[local-name()='Envelope']/*[local-name()='Body']/*[local-name()='GetBillingAgreementCustomerDetailsResponse']")
);
}
示例9: ExternalRememberMeOptOut
/// <summary>
///
/// </summary>
///<param name="externalRememberMeOptOutReq"></param>
///<param name="credential">An explicit ICredential object that you want to authenticate this call against</param>
public ExternalRememberMeOptOutResponseType ExternalRememberMeOptOut(ExternalRememberMeOptOutReq externalRememberMeOptOutReq, ICredential credential)
{
setStandardParams(externalRememberMeOptOutReq.ExternalRememberMeOptOutRequest);
DefaultSOAPAPICallHandler defaultHandler = new DefaultSOAPAPICallHandler(this.config, externalRememberMeOptOutReq.ToXMLString(null, "ExternalRememberMeOptOutReq"), null, null);
IAPICallPreHandler apiCallPreHandler = new MerchantAPICallPreHandler(this.config, defaultHandler, credential);
((MerchantAPICallPreHandler) apiCallPreHandler).SDKName = SDKName;
((MerchantAPICallPreHandler) apiCallPreHandler).SDKVersion = SDKVersion;
((MerchantAPICallPreHandler) apiCallPreHandler).PortName = "PayPalAPIAA";
XmlDocument xmlDocument = new XmlDocument();
xmlDocument.LoadXml(Call(apiCallPreHandler));
return new ExternalRememberMeOptOutResponseType(
xmlDocument.SelectSingleNode("*[local-name()='Envelope']/*[local-name()='Body']/*[local-name()='ExternalRememberMeOptOutResponse']")
);
}
示例10: GetEndpoint
public void GetEndpoint()
{
credential = credentialMngr.GetCredentials(ConfigManager.Instance.GetProperties(), Constants.CertificateAPIUserName);
MerchantAPICallPreHandler soapHandler = new MerchantAPICallPreHandler(ConfigManager.Instance.GetProperties(), defaultSoapHandler, credential);
string endpoint = soapHandler.GetEndpoint();
Assert.AreEqual(Constants.APIEndpointNVP, endpoint);
}
示例11: GetEndPoint
public void GetEndPoint()
{
credential = credentialMngr.GetCredentials(UnitTestConstants.CertificateAPIUserName);
MerchantAPICallPreHandler soapHandler = new MerchantAPICallPreHandler(defaultSoapHandler, credential);
string endpoint = soapHandler.GetEndPoint();
Assert.AreEqual(UnitTestConstants.APIEndpointNVP, endpoint);
}
示例12: GetEndpointForDefaultModeWithoutEndpoint
public void GetEndpointForDefaultModeWithoutEndpoint()
{
Dictionary<string, string> config = new Dictionary<string, string>(accountConfig);
credential = credentialMngr.GetCredentials(config, UnitTestConstants.CertificateAPIUserName);
MerchantAPICallPreHandler soapHandler = new MerchantAPICallPreHandler(config, defaultSoapHandler, credential);
soapHandler.GetEndPoint();
}
示例13: 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]);
}
示例14: GetHeaderMapSignature
public void GetHeaderMapSignature()
{
credential = credentialMngr.GetCredentials(UnitTestConstants.APIUserName);
soapHandler = new MerchantAPICallPreHandler(defaultSoapHandler, credential);
Dictionary<String, String> headers = soapHandler.GetHeaderMap();
Assert.IsNotNull(headers);
Assert.IsTrue(headers.Count > 0);
Assert.AreEqual(UnitTestConstants.APIUserName, headers[BaseConstants.PAYPAL_SECURITY_USERID_HEADER]);
Assert.AreEqual(UnitTestConstants.APIPassword, headers[BaseConstants.PAYPAL_SECURITY_PASSWORD_HEADER]);
Assert.AreEqual(UnitTestConstants.APISignature, headers[BaseConstants.PAYPAL_SECURITY_SIGNATURE_HEADER]);
Assert.AreEqual(BaseConstants.SOAP, headers[BaseConstants.PAYPAL_REQUEST_DATA_FORMAT_HEADER]);
Assert.AreEqual(BaseConstants.SOAP, headers[BaseConstants.PAYPAL_RESPONSE_DATA_FORMAT_HEADER]);
}
示例15: LoadSignatureCredential
public void LoadSignatureCredential()
{
string apiUsername = UnitTestConstants.APIUserName;
credentialMngr = CredentialManager.Instance;
credential = credentialMngr.GetCredentials(apiUsername);
Assert.NotNull(credential);
Assert.IsInstanceOf(typeof(SignatureCredential), credential);
SignatureCredential signCredential = (SignatureCredential) credential;
Assert.AreEqual(apiUsername, signCredential.UserName);
Assert.AreEqual(UnitTestConstants.APIPassword, signCredential.Password);
Assert.AreEqual(UnitTestConstants.APISignature, signCredential.Signature);
Assert.AreEqual(UnitTestConstants.ApplicationID, signCredential.ApplicationID);
}