如何解决使用表单集成时,调用repeat.vsp之后的回调URL是什么?
我正在尝试使用Sagepay(现在称为Opayo)中的Form Integration重复付款。
从这里发布的一个较早的问题中,我得到了安全密钥是必需的,但在Form调用中没有返回,因此需要对getTransactionDetails命令进行另一个调用。
我有安全密钥,现在可以拨打https://test.sagepay.com/gateway/service/repeat.vsp来启动重复付款。但是,文档未说明对该调用的响应在哪里。因此,我假设它将使用服务器或直接集成时转到使用付款设置的NotificationURL。由于我使用的是Form,因此未设置。
问题是,如果初始付款是使用表单集成创建的,是否有任何方法可以捕获对https://test.sagepay.com/gateway/service/repeat.vsp调用的响应?
我想第二个问题是,是否有人通过Sagepay Form集成成功完成了重复付款工作?
解决方法
不确定是否对您有帮助,我们也没有重复付款;但是我们正在考虑发放延期付款,我认为这是一种类似的方法。
您如何拨打“ https://test.sagepay.com/gateway/service/repeat.vsp”?
您可以使用“ HttpWebRequest”进行呼叫,然后在“ HttpWebResponse”中捕获直接响应吗?
EG:
private static void DeferredSharedApiCall(Dictionary<string,string> data,string type,string url)
{
string postData = string.Join("&",data.Select(x => $"{x.Key}={HttpUtility.UrlEncode(x.Value)}"));
HttpWebRequest request = WebRequest.CreateHttp(url);
request.Method = "POST";
request.ContentType = "application/x-www-form-urlencoded";
using (TextWriter tw = new StreamWriter(request.GetRequestStream()))
{
tw.Write(postData);
}
HttpWebResponse response = null;
try
{
response = request.GetResponse() as HttpWebResponse;
}
catch (WebException ex)
{
//log.Error($"{type} Error,data: {postData}",ex);
}
catch (Exception ex)
{
//log.Error($"{type} Error,ex);
}
if (response != null)
{
using (TextReader tr = new StreamReader(response.GetResponseStream()))
{
string result = tr.ReadToEnd();
//log.Info($"{type} Response: {Environment.NewLine}{result}");
}
}
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。