views:

35

answers:

1

Kentico is a C# / Asp.NET Content Management System that we use and I'm trying to implement authorize.net SIM integration (redirecting the user to the authorize.net servers to make purchase through a form post). Kentico uses master pages so it's proving to be a beast. First issue was getting the form to even post to the authorize.net Servers. I was able to do this using the following.

<script type="text/javascript">
    theForm.action = "https://test.authorize.net/gateway/transact.dll";
</script>

Easy Enough (theForm == the master page form), now the issue lies in the fact that I originally was using code behind to populate the hidden input fields and it changes all of the names of these input fields. This makes it impossible for authorize.net to know what you are doing.

Has anyone done any integration like this before? And if so, what is the most appropriate way to solving this problem.

I have a few ideas but they all involve what I consider extremely dirty methods for getting it to work.

Thanks in advance.

+1  A: 

Hi Nick, you will need to follow these steps to take the names of your input fields under your control:

1) Use your code to set the payment gateway URL

2) Place ASP.NET Literal control on ASPX page, something like: <asp:Literal runat="server" ID="myFields" />

3) Go to code behind and initialize the literal with HTML code of all your input fields. For each input field set its custom identifier. e.g: myFields.Text += "<input type="text" id="carnumber" name="cardnumber" />"; ....

After the button is clicked, user is redirected to the payment gateway URL where the POSTed data from your input fields are available under the required identifiers. I hope you will find it helpful.

Peter