Paypoint New Api剖析付款请求

时间:2015-07-10 17:23:15

标签: payment-gateway

我试图计算支付给新Paypoint API的JSON请求的格式。文档是有限的,我没有paypoint帐户,我已经请求了一个演示。有人可以建议资源ID应该是什么?另请检查请求是否正确。

 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();
            }

2 个答案:

答案 0 :(得分:0)

Op是关于Paypoint的,而不是PayPal。paypoint是英国的付款提供商,主要用于pos情况

答案 1 :(得分:-1)

由于您使用的是C#,因此可以使用可用的.NET SDK here来构建请求对象并收集响应。这里有代码示例,几乎可以使用新的Paypal API完成所有操作。