我需要将我的 Umbraco 网站连接到我的 Worldpay 帐户。我发现了几篇关于此的文章,但由于这对我来说都是新的,我需要一个简单明了的示例。我关注了这篇文章,但不知道如何将我的用户控件(支付表单)连接到世界支付。
任何帮助将不胜感激。
@Digbyswift:我已经尝试了您的解决方案,但仍然没有成功!如果您能看一下并让我知道我的代码中有什么问题,我将不胜感激:
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="LoadForm.ascx.cs" Inherits="BInstitute.usercontrols.LoadForm" %>
<form action="https://secure-test.worldpay.com/wcc/purchase" name="BuyForm" method="POST" >
<input type="hidden" name="instId" value= "<% = this.instId %>" ><!-- The "instId" value "211616" should be replaced with the Merchant's own installation Id -->
<input type="hidden" name="cartId" value="abc123" ><!-- This is a unique identifier for merchants use. Example: PRODUCT123 -->
<input type="hidden" name="currency" value="GBP" ><!-- Choose appropriate currency that you would like to use -->
<input type="hidden" name="amount" value="<% = this.amount %>">
<input type="hidden" name="desc" value="<% = this.desc %>" >
<input type="hidden" name="testMode" value="100" >
<div id="MembershipForm" runat="server" visible="False">
<table>
<tr>
<td width="25%" >
<asp:Label ID="lblMembershipSurname" runat="server"></asp:Label>
</td>
<td >
<asp:TextBox ID="txtMembershipSurname" runat="server" Class="textblock"></asp:TextBox>
</td>
</tr>
<tr>
<td width="25%" >
<asp:Label ID="lblMembershipAddressLine1" runat="server"></asp:Label>
</td>
<td >
<asp:TextBox ID="txtMembershipAddressLine1" runat="server" Class="textblock"></asp:TextBox>
</td>
</tr>
<tr>
<td width="25%" >
<asp:Label ID="lblMembershipAddressLine2" runat="server"></asp:Label>
</td>
<td >
<asp:TextBox ID="txtMembershipAddressLine2" runat="server" Class="textblock"></asp:TextBox>
</td>
</tr>
<tr>
<td width="25%" >
<asp:Button ID="btnMembershipSubmit" runat="server" PostBackUrl="https://secure-test.worldpay.com/wcc/purchase" Class="btn_submit"/>
</td>
<td >
</td>
</tr>
</table>
</div>
</form>
而后端源码是:
public partial class LoadForm : System.Web.UI.UserControl
{
private string _instId = "288499";
private string _cartId = "Test";
private string _currency = "GBP";
private string _testMode = "100";
private string _amount = "10";
private string _desc = "testDesc";
public string desc
{
get { return _desc; }
set { _desc = value; }
}
public string amount
{
get { return _amount; }
set { _amount = value; }
}
public string instId
{
get { return _instId; }
set { _instId = value; }
}
public string cartId
{
get { return _cartId; }
set { _cartId = value; }
}
public string currency
{
get { return _currency; }
set { _currency = value; }
}
public string testMode
{
get { return _testMode; }
set { _testMode = value; }
}
}