使用表单集成时,调用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}");
        }
    }
}   

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...