输入卡详细信息后无法获取令牌

时间:2019-07-02 07:34:48

标签: sagepay

在“测试”模式下输入测试卡详细信息后,我发送令牌请求。在NotificationURL页面上,我收到状态“ OK”,但其余信息(包括“ Token”)为空。

web.config:

key =“ sagepay.api.serverTokenRegisterUrl.TEST” value =“ https://test.sagepay.com/gateway/service/token.vsp”

用于令牌注册请求的C#代码:

SagePayServerIntegration objserver = new SagePayServerIntegration(); IServerTokenRegisterRequest objrequest = objserver.ServerTokenRegisterRequest();

objrequest.VpsProtocol = SagePaySettings.ProtocolVersion;

objrequest.TransactionType = TransactionType.TOKEN;

objrequest.Vendor = SagePaySettings.VendorName;

objrequest.Currency = SagePaySettings.Currency;

objrequest.Profile =“ LOW”;

objrequest.VendorTxCode = SagePayFormIntegration.GetNewVendorTxCode();

objrequest.NotificationUrl =“ https://www.tccloud.co.uk/skytaxistest/TokenNotification.aspx”;

IServerTokenRegisterResult结果= objserver.GetServerTokenRegisterRequest(objrequest,SagePaySettings.ServerTokenRegisterUrl);

if(Result.Status == ResponseStatus.OK){

   string url = Result.NextUrl;

   iframe1.Attributes["src"] = url;

}

提交卡详细信息后,

令牌的C#代码在NotificationURL页面上接收:

IServerNotificationRequest serverNotificationRequest = new SagePayServerIntegration()。GetServerNotificationRequest();

字符串令牌= serverNotificationRequest.Token;

字符串状态= serverNotificationRequest.Status;

Response.Write(“ RedirectURL =” + string.Format(“ {0} /SuccessToken.aspx?Status= {1}&Token = {2}”,“ https://www.tccloud.co.uk/skytaxistest”,状态,令牌)) ;

0 个答案:

没有答案