Note that there are some explanatory texts on larger screens.

plurals
  1. POWorld Pay Payment gateway Integration In ASP.Net MVC using C#
    primarykey
    data
    text
    <pre><code>string xml = "&lt;?xml version='1.0'? encoding='UTF-8'?&gt;&lt;!DOCTYPE paymentService PUBLIC '-//WorldPay//DTD WorldPay PaymentService v1//EN''http://dtd.worldpay.com/paymentService_v1.dtd'&gt;&lt;paymentService version='1.4' merchantCode='MYMERCHANTCODE'&gt;&lt;submit&gt;&lt;order orderCode='RecurringOrderCode'&gt;&lt;description&gt;Monthly subscription.&lt;/description&gt;&lt;amount value='1399' currencyCode='EUR' exponent='2' /&gt;&lt;orderContent&gt;Your Original Order Content&lt;/orderContent&gt; &lt;paymentDetails&gt;&lt;VISA-SSL&gt; &lt;cardNumber&gt;4444333322221111&lt;/cardNumber&gt;&lt;expiryDate&gt; &lt;date month='09' year='2019'/&gt; &lt;/expiryDate&gt; &lt;cardHolderName&gt;J. Shopper&lt;/cardHolderName&gt;&lt;cvc&gt;123&lt;/cvc&gt; &lt;cardAddress&gt; &lt;address&gt; &lt;street&gt;47A Queensbridge Rd&lt;/street&gt;&lt;postalCode&gt;CB94BQ&lt;/postalCode&gt;&lt;city&gt;GB&lt;/city&gt;&lt;countryCode&gt;GB&lt;/countryCode&gt;&lt;telephoneNumber&gt;+44&lt;/telephoneNumber&gt; &lt;/address&gt; &lt;/cardAddress&gt; &lt;/VISA-SSL&gt; &lt;session shopperIPAddress='100.100.100.100' id='0215ui8ib1' /&gt; &lt;/paymentDetails&gt;&lt;/order&gt;&lt;/submit&gt;&lt;/paymentService&gt;"; string url = "https://secure-test.worldpay.com/jsp/merchant/xml/paymentService.jsp"; HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url); //string s = "id="+Server.UrlEncode(xml); byte[] requestBytes = System.Text.Encoding.ASCII.GetBytes(xml); req.Method = "POST"; req.ContentType = "text/xml;charset=utf-8"; req.ContentLength = requestBytes.Length; Stream requestStream = req.GetRequestStream(); requestStream.Write(requestBytes, 0, requestBytes.Length); requestStream.Close(); HttpWebResponse res = (HttpWebResponse)req.GetResponse(); StreamReader sr = new StreamReader(res.GetResponseStream(), System.Text.Encoding.Default); string backstr = sr.ReadToEnd(); sr.Close(); res.Close(); return View(); </code></pre> <p>I am using this code to integrate the Worldpay payment gateway API i am getting this error on getting response from line HttpWebResponse res = (HttpWebResponse)req.GetResponse();</p> <p>the error is -401 Authorization Required</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload