在“测试”模式下输入测试卡详细信息后,我发送令牌请求。在NotificationURL页面上,我收到状态“ OK”,但其余信息(包括“ Token”)为空。
key =“ sagepay.api.serverTokenRegisterUrl.TEST” value =“ https://test.sagepay.com/gateway/service/token.vsp”
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;
}
提交卡详细信息后,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”,状态,令牌)) ;