Добрый вечер!
Есть такая форма:
1.
2.
<form action="https://rbkmoney.ru/acceptpurchase.aspx" class="rbkm-payment-form" method="post" target="_blank">
<input class="bttn bttn-218" name="button" type="submit" value="Купить"> <input name="eshopId" type="hidden" value="2000005"> <input name="orderId" type="hidden" value="order ID 333777"> <input name="successUrl" type="hidden" value="http://rbkmoney.ru"> <input name="failUrl" type="hidden" value="http://rbkmoney.ru"> <input name="serviceName" type="hidden" value="T-shirt, black, M size"> <input name="recipientAmount" type="hidden" value="50"> <input name="recipientCurrency" type="hidden" value="RUR"> <input name="user_email" type="hidden" value="example@example.com"></form>
Необходимо перенести отправку этого запроса на сервер
Вот что я делаю:
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
// Create a request using a URL that can receive a post.
var request = (HttpWebRequest)WebRequest.Create("https://rbkmoney.ru/acceptpurchase.aspx");
// Set the Method property of the request to POST.
request.Method = "POST";
// Create POST data and convert it to a byte array.
string postData = "eshopId=2000005&orderId=123&successUrl=http://rbkmoney.ru&failUrl=http://rbkmoney.ru&serviceName=123&recipientAmount=50&recipientCurrency=RUR&user_email=example@example.com";
byte[] byteArray = Encoding.UTF8.GetBytes(postData);
// Set the ContentType property of the WebRequest.
request.ContentType = "application/x-www-form-urlencoded";
// Set the ContentLength property of the WebRequest.
request.ContentLength = byteArray.Length;
// Get the request stream.
Stream dataStream = request.GetRequestStream();
// Write the data to the request stream.
dataStream.Write(byteArray, 0, byteArray.Length);
// Close the Stream object.
dataStream.Close();
// Get the response.
WebResponse response = request.GetResponse();
// Display the status.
Response.Write(((HttpWebResponse)response).StatusDescription);
// Get the stream containing content returned by the server.
dataStream = response.GetResponseStream();
// Open the stream using a StreamReader for easy access.
StreamReader reader = new StreamReader(dataStream);
// Read the content.
string responseFromServer = reader.ReadToEnd();
//Response.Redirect();
// Display the content.
Response.Write(responseFromServer);
// Clean up the streams.
reader.Close();
dataStream.Close();
response.Close();
Ответ открывается у меня на сервере, а мне нужно чтобы он открывался на rbk. Подскажите, пожалуйста, что я не так делаю.