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