Question

I need to connect my Umbraco website to my Worldpay account. I found few articles about this but as it's all new to me I need a simple and straightforward sample. I followed this Article but yet don't know how to connect my User Controls (payment forms) to world pay.

Any helps would be appreciated.

@Digbyswift: I have tried your solution and still not success! I would be appreciated if you could take a look and let me know what is the problem in my code:

<%@ 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 >
                &nbsp;</td>

        </tr>
        </table>

</div>

</form>

And the backend source code is:

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; }
        }

}
Was it helpful?

Solution

The first thing you should be considering is how would you usually connect WorldPay to a .Net website. The fact that your site is Umbraco-based needn't complicate things.

Find a couple of articles describing integration into a standard .Net website and see if those approaches will work with your website. The only complicating factor might be defining a "callback" page, but then at worst you could just use a hard-coded URL.

Many questions like this assume that Umbraco complicates otherwise well-documented tasks. But generally an Umbraco site is still just user controls and masterpages or views and actions.

If you want to make the Worldpay configuration editable within Umbraco, that is another question completely.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top