Asp.net cardIdentifier在URL查询字符串中返回,而不是在隐藏字段中返回
我已经将SagePay的“直接付款”集成到测试解决方案中。问题是,当我提交“cardIdentifier”表单时,根据文档,它在URL中作为查询字符串返回,而不是作为隐藏字段返回 一旦客户发起表单提交,付款详细信息将被验证、标记并作为名为cardIdentifier的隐藏字段传递,然后与表单的其余内容一起发布Asp.net cardIdentifier在URL查询字符串中返回,而不是在隐藏字段中返回,asp.net,opayo,Asp.net,Opayo,我已经将SagePay的“直接付款”集成到测试解决方案中。问题是,当我提交“cardIdentifier”表单时,根据文档,它在URL中作为查询字符串返回,而不是作为隐藏字段返回 一旦客户发起表单提交,付款详细信息将被验证、标记并作为名为cardIdentifier的隐藏字段传递,然后与表单的其余内容一起发布 <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CustomPayment.aspx.cs" Async="tru
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CustomPayment.aspx.cs" Async="true" Inherits="SagePayDropInTest.CustomPayment" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script src="https://pi-test.sagepay.com/api/v1/js/sagepay-dropin.js"></script>
</head>
<body>
<div id="main">
<h1>My Test Shop</h1>
<form id ="checkout-form">
<h2>Payment Details</h2>
<div id="payment-details"></div>
<div id="submit-container">
<input type="submit"/>
</div>
</form>
</div>
<script>
sagepayCheckout({
merchantSessionKey: '<%=MerchID%>',
containerSelector: '#payment-details'
}).form({
formSelector: '#checkout-form'
});
</script>
</body>
</html>
它确实返回了cardIdentifier,但只是一个查询字符串,但我更希望它是一个隐藏字段,如文档所示。其余的集成工作如文档所示,正是这一步让我感到困惑
毫无疑问,我遗漏了一些显而易见的东西,任何指导都将不胜感激。尝试更改标记以包含method=post属性。这意味着cardIdentifier将作为已发布字段而不是查询字符串发送。表单的默认方法通常是GET请求,SagePay JS可能不会改变这一点
而且,标签中看起来有一个额外的空间。我建议去掉这个选项,因为一些不太宽容的浏览器可能无法正确解析,从而破坏了JS中的CSS选择器。谢谢,这就解决了问题!p、 s将代码复制到SO中时,必须添加额外的空间,但也感谢您发现了这一点。
namespace SagePayDropInTest
{
public partial class CustomPayment : System.Web.UI.Page
{
public string MerchID = "";
protected void Page_Load(object sender, EventArgs e)
{
MerchID = GetMerchSessionID();
}}}