0
我試圖計算支付新支付API的JSON請求的格式。該文件是有限的,我沒有支付寶賬戶,我請求演示。有人可以建議資源ID應該是什麼?請檢查請求,看看它是否正確。支付點新Api支付請求解析
var httpWebRequest = (HttpWebRequest)WebRequest.Create("https://api.mite.paypoint.net:2443/acceptor/rest/transactions/{instId}/{resourceId}/action");
httpWebRequest.ContentType = "text/json";
httpWebRequest.Method = "POST";
using (var streamWriter = new StreamWriter(httpWebRequest.GetRequestStream()))
{
string json = "{\"transaction\": {" +
"\"currency\": \"GBP\"," +
"\"amount\": \"1000.0\"," +
"\"description\": \"Example\"," +
"\"merchantRef\": \"mer_txn_1234557\"," +
"\"commerceType\": \"MOTO\" }}";
streamWriter.Write(json);
streamWriter.Flush();
streamWriter.Close();
}
var httpResponse = (HttpWebResponse)httpWebRequest.GetResponse();
using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
{
var result = streamReader.ReadToEnd();
}