本文整理汇总了C#中PayPal.DefaultSOAPAPICallHandler.GetPayload方法的典型用法代码示例。如果您正苦于以下问题:C# DefaultSOAPAPICallHandler.GetPayload方法的具体用法?C# DefaultSOAPAPICallHandler.GetPayload怎么用?C# DefaultSOAPAPICallHandler.GetPayload使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PayPal.DefaultSOAPAPICallHandler
的用法示例。
在下文中一共展示了DefaultSOAPAPICallHandler.GetPayload方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DomPayloadTest
public void DomPayloadTest()
{
DefaultSOAPAPICallHandler.XMLNamespaceProvider = new XmlNamespacePrefixProvider();
APIContext api = new APIContext();
api.SOAPHeader = new SampleHeader();
Dictionary<string, string> configurationMap = new Dictionary<string, string>();
configurationMap.Add("service.EndPoint", "https://api-3t.sandbox.paypal.com/2.0");
api.Config = configurationMap;
DefaultSOAPAPICallHandler defHandler = new DefaultSOAPAPICallHandler(new SampleBody(), api, null, "DoDirectPayment");
string payload = defHandler.GetPayload().Trim();
string expectedPayload = "<soapenv:Envelope xmlns:xml=\"http://www.w3.org/XML/1998/namespace\" xmlns:ed=\"urn:ebay:apis:EnhancedDataTypes\" xmlns:cc=\"urn:ebay:apis:CoreComponentTypes\" xmlns:ebl=\"urn:ebay:apis:eBLBaseComponents\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns:wsdlsoap=\"http://schemas.xmlsoap.org/wsdl/soap/\" xmlns:ns=\"urn:ebay:api:PayPalAPI\" xmlns:SOAP-ENC=\"http://schemas.xmlsoap.org/soap/encoding/\" xmlns:wsdl=\"http://schemas.xmlsoap.org/wsdl/\" xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\">" +
"<soapenv:Header>" +
"<ns:RequesterCredentials>" +
"<ebl:Credentials>" +
"<ebl:Username>jb-us-seller_api1.paypal.com</ebl:Username>" +
"</ebl:Credentials>" +
"</ns:RequesterCredentials>" +
"</soapenv:Header>" +
"<soapenv:Body>" +
"<ns:DoDirectPaymentReq>" +
"<ns:DoDirectPaymentRequest>" +
"<ebl:Version>98.0</ebl:Version>" +
"<ebl:DoDirectPaymentRequestDetails>" +
"<ebl:CreditCard>" +
"<ebl:CreditCardType>Visa</ebl:CreditCardType>" +
"<ebl:CreditCardNumber>4202297003827029</ebl:CreditCardNumber>" +
"<ebl:CVV2>962</ebl:CVV2>" +
"</ebl:CreditCard>" +
"</ebl:DoDirectPaymentRequestDetails>" +
"</ns:DoDirectPaymentRequest>" +
"</ns:DoDirectPaymentReq>" +
"</soapenv:Body>" +
"</soapenv:Envelope>";
Assert.AreEqual(expectedPayload, payload);
}
示例2: GetPayloadForEmptyRawPayload
public void GetPayloadForEmptyRawPayload()
{
defaultSOAPHandler = new DefaultSOAPAPICallHandler(ConfigManager.Instance.GetProperties(), string.Empty, string.Empty, string.Empty);
Assert.AreEqual("<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" ><soapenv:Header></soapenv:Header><soapenv:Body></soapenv:Body></soapenv:Envelope>", defaultSOAPHandler.GetPayload());
}
示例3: GetPayloadForEmptyRawPayloadTest
public void GetPayloadForEmptyRawPayloadTest()
{
defaultHandler = new DefaultSOAPAPICallHandler(new Dictionary<string, string>(), string.Empty, string.Empty, string.Empty);
Assert.AreEqual("<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" ><soapenv:Header></soapenv:Header><soapenv:Body></soapenv:Body></soapenv:Envelope>", defaultHandler.GetPayload());
}