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


C# DefaultSOAPAPICallHandler.GetPayload方法代码示例

本文整理汇总了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);
        }
开发者ID:PieterScheffers,项目名称:FotoLab,代码行数:36,代码来源:DefaultSOAPAPICallHandlerTest.cs

示例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());
 }
开发者ID:PieterScheffers,项目名称:FotoLab,代码行数:5,代码来源:DefaultSOAPAPICallHandlerTest.cs

示例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());
 }
开发者ID:PieterScheffers,项目名称:FotoLab,代码行数:5,代码来源:DefaultSOAPAPICallHandlerTest.cs


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