本文整理汇总了C#中PayPal.SOAP.MerchantAPICallPreHandler类的典型用法代码示例。如果您正苦于以下问题:C# MerchantAPICallPreHandler类的具体用法?C# MerchantAPICallPreHandler怎么用?C# MerchantAPICallPreHandler使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MerchantAPICallPreHandler类属于PayPal.SOAP命名空间,在下文中一共展示了MerchantAPICallPreHandler类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetEndPoint
public void GetEndPoint()
{
credential = credentialMngr.GetCredentials(UnitTestConstants.CertificateAPIUserName);
MerchantAPICallPreHandler soapHandler = new MerchantAPICallPreHandler(defaultSoapHandler, credential);
string endpoint = soapHandler.GetEndPoint();
Assert.AreEqual(UnitTestConstants.APIEndpointNVP, endpoint);
}
示例2: 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);
}
示例3: 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();
}
示例4: 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]);
}
示例5: GetEndpointForDefaultModeWithExplicitEndpoint
public void GetEndpointForDefaultModeWithExplicitEndpoint()
{
Dictionary<string, string> config = new Dictionary<string, string>(accountConfig);
config.Add(BaseConstants.EndpointConfig, Constants.APIEndpointNVP);
credential = credentialMngr.GetCredentials(config, Constants.CertificateAPIUserName);
MerchantAPICallPreHandler soapHandler = new MerchantAPICallPreHandler(config, defaultSoapHandler, credential);
Assert.AreEqual(Constants.APIEndpointNVP, soapHandler.GetEndpoint());
config.Add("PayPalAPI", Constants.APIEndpointSOAP);
credential = credentialMngr.GetCredentials(config, Constants.CertificateAPIUserName);
soapHandler = new MerchantAPICallPreHandler(config, defaultSoapHandler, credential);
soapHandler.PortName = "PayPalAPI";
Assert.AreEqual(Constants.APIEndpointSOAP, soapHandler.GetEndpoint());
}
示例6: AddressVerify
/// <summary>
///
/// </summary>
///<param name="addressVerifyReq"></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 AddressVerifyResponseType AddressVerify(AddressVerifyReq addressVerifyReq, string apiUserName)
{
setStandardParams(addressVerifyReq.AddressVerifyRequest);
DefaultSOAPAPICallHandler defaultHandler = new DefaultSOAPAPICallHandler(this.config, addressVerifyReq.ToXMLString(null, "AddressVerifyReq"), null, null);
IAPICallPreHandler apiCallPreHandler = new MerchantAPICallPreHandler(this.config, defaultHandler, apiUserName, getAccessToken(), getAccessTokenSecret());
((MerchantAPICallPreHandler) apiCallPreHandler).SDKName = SDKName;
((MerchantAPICallPreHandler) apiCallPreHandler).SDKVersion = SDKVersion;
((MerchantAPICallPreHandler) apiCallPreHandler).PortName = "PayPalAPI";
XmlDocument xmlDocument = new XmlDocument();
xmlDocument.LoadXml(Call(apiCallPreHandler));
return new AddressVerifyResponseType(
xmlDocument.SelectSingleNode("*[local-name()='Envelope']/*[local-name()='Body']/*[local-name()='AddressVerifyResponse']")
);
}
示例7: 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);
}
示例8: GetPayLoadForCertificate
public void GetPayLoadForCertificate()
{
credential = credentialMngr.GetCredentials(UnitTestConstants.CertificateAPIUserName);
soapHandler = new MerchantAPICallPreHandler(defaultSoapHandler, credential);
string payload = soapHandler.GetPayLoad();
XmlDocument xmlDoc = GetXmlDocument(payload);
XmlNodeList xmlNodeListUsername = xmlDoc.GetElementsByTagName("Username");
Assert.IsTrue(xmlNodeListUsername.Count > 0);
Assert.AreEqual(UnitTestConstants.CertificateAPIUserName, xmlNodeListUsername[0].InnerXml);
XmlNodeList xmlNodeListPassword = xmlDoc.GetElementsByTagName("Password");
Assert.IsTrue(xmlNodeListPassword.Count > 0);
Assert.AreEqual(UnitTestConstants.CertificateAPIPassword, xmlNodeListPassword[0].InnerXml);
XmlNodeList xmlNodeListRequest = xmlDoc.GetElementsByTagName("Request");
Assert.IsTrue(xmlNodeListRequest.Count > 0);
Assert.AreEqual("test", xmlNodeListRequest[0].InnerXml);
}
示例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: DoUATPExpressCheckoutPayment
/**
*AUTO_GENERATED
*/
public DoUATPExpressCheckoutPaymentResponseType DoUATPExpressCheckoutPayment(DoUATPExpressCheckoutPaymentReq doUATPExpressCheckoutPaymentReq, string apiUserName)
{
IAPICallPreHandler apiCallPreHandler = null;
string portName = "PayPalAPIAA";
setStandardParams(doUATPExpressCheckoutPaymentReq.DoUATPExpressCheckoutPaymentRequest);
DefaultSOAPAPICallHandler defaultHandler = new DefaultSOAPAPICallHandler(doUATPExpressCheckoutPaymentReq.ToXMLString(null, "DoUATPExpressCheckoutPaymentReq"), null, null);
apiCallPreHandler = new MerchantAPICallPreHandler(defaultHandler, apiUserName, getAccessToken(), getAccessTokenSecret());
((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()='DoUATPExpressCheckoutPaymentResponse']");
return new DoUATPExpressCheckoutPaymentResponseType(xmlNode);
}
示例11: UpdateRecurringPaymentsProfile
/**
*AUTO_GENERATED
*/
public UpdateRecurringPaymentsProfileResponseType UpdateRecurringPaymentsProfile(UpdateRecurringPaymentsProfileReq updateRecurringPaymentsProfileReq, ICredential credential)
{
IAPICallPreHandler apiCallPreHandler = null;
string portName = "PayPalAPIAA";
setStandardParams(updateRecurringPaymentsProfileReq.UpdateRecurringPaymentsProfileRequest);
DefaultSOAPAPICallHandler defaultHandler = new DefaultSOAPAPICallHandler(updateRecurringPaymentsProfileReq.ToXMLString(null, "UpdateRecurringPaymentsProfileReq"), 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()='UpdateRecurringPaymentsProfileResponse']");
return new UpdateRecurringPaymentsProfileResponseType(xmlNode);
}
示例12: ManagePendingTransactionStatus
/**
*AUTO_GENERATED
*/
public ManagePendingTransactionStatusResponseType ManagePendingTransactionStatus(ManagePendingTransactionStatusReq managePendingTransactionStatusReq, ICredential credential)
{
IAPICallPreHandler apiCallPreHandler = null;
string portName = "PayPalAPIAA";
setStandardParams(managePendingTransactionStatusReq.ManagePendingTransactionStatusRequest);
DefaultSOAPAPICallHandler defaultHandler = new DefaultSOAPAPICallHandler(managePendingTransactionStatusReq.ToXMLString(null, "ManagePendingTransactionStatusReq"), 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()='ManagePendingTransactionStatusResponse']");
return new ManagePendingTransactionStatusResponseType(xmlNode);
}
示例13: SDKName
public void SDKName()
{
credential = credentialMngr.GetCredentials(ConfigManager.Instance.GetProperties(), UnitTestConstants.CertificateAPIUserName);
MerchantAPICallPreHandler soapHandler = new MerchantAPICallPreHandler(ConfigManager.Instance.GetProperties(), defaultSoapHandler, credential);
soapHandler.SDKName = "testsdk";
Assert.AreEqual("testsdk", soapHandler.SDKName);
}
示例14: GetEndpointForLiveMode
public void GetEndpointForLiveMode()
{
Dictionary<string, string> config = new Dictionary<string, string>(accountConfig);
config.Add(BaseConstants.APPLICATION_MODE_CONFIG, BaseConstants.SANDBOX_MODE);
credential = credentialMngr.GetCredentials(config, UnitTestConstants.CertificateAPIUserName);
MerchantAPICallPreHandler soapHandler = new MerchantAPICallPreHandler(config, defaultSoapHandler, credential);
Assert.AreEqual(BaseConstants.MERCHANT_CERTIFICATE_SANDBOX_ENDPOINT, soapHandler.GetEndPoint());
credential = credentialMngr.GetCredentials(config, UnitTestConstants.APIUserName);
soapHandler = new MerchantAPICallPreHandler(config, defaultSoapHandler, credential);
Assert.AreEqual(BaseConstants.MERCHANT_SIGNATURE_SANDBOX_ENDPOINT, soapHandler.GetEndPoint());
}
示例15: UpdateRecurringPaymentsProfile
/// <summary>
///
/// </summary>
///<param name="updateRecurringPaymentsProfileReq"></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 UpdateRecurringPaymentsProfileResponseType UpdateRecurringPaymentsProfile(UpdateRecurringPaymentsProfileReq updateRecurringPaymentsProfileReq, string apiUserName)
{
setStandardParams(updateRecurringPaymentsProfileReq.UpdateRecurringPaymentsProfileRequest);
DefaultSOAPAPICallHandler defaultHandler = new DefaultSOAPAPICallHandler(this.config, updateRecurringPaymentsProfileReq.ToXMLString(null, "UpdateRecurringPaymentsProfileReq"), null, null);
IAPICallPreHandler apiCallPreHandler = new MerchantAPICallPreHandler(this.config, defaultHandler, apiUserName, getAccessToken(), getAccessTokenSecret());
((MerchantAPICallPreHandler) apiCallPreHandler).SDKName = SDKName;
((MerchantAPICallPreHandler) apiCallPreHandler).SDKVersion = SDKVersion;
((MerchantAPICallPreHandler) apiCallPreHandler).PortName = "PayPalAPIAA";
XmlDocument xmlDocument = new XmlDocument();
xmlDocument.LoadXml(Call(apiCallPreHandler));
return new UpdateRecurringPaymentsProfileResponseType(
xmlDocument.SelectSingleNode("*[local-name()='Envelope']/*[local-name()='Body']/*[local-name()='UpdateRecurringPaymentsProfileResponse']")
);
}