I am new to both MVC and Authorize.net so I apologize in advance for a possible simple question. I am trying to get a version of the 15 minute demo up and runing with an MVC application I have developed. I have written a view that I believe should submit a DPM request to Authorize.net but when I click on the "Process Payment" button nothing happens. No error, no timeout, nothing?
Any advice, recommendations, or identification of a simple mistake will be greatly appreciated.
Here is my view code:
@model TCPA.Models.CCProcessingModel
@using AuthorizeNet;
@{
ViewBag.Title = "Register->Payment";
}
<hgroup class="title">
<h1>@ViewBag.Title.</h1>
<h2>Credit Card Information</h2>
</hgroup>
@DPMFormGenerator.OpenForm("REMOVED API LOGIN", "REMOVED TRANSACTION KEY", 99.99m, "REMOVED RESPONSE URL",true)
{
<fieldset>
<legend>Credit Card Information Form</legend>
<table>
<tr>
<td>
@Html.LabelFor(m => m.x_card_num)
@Html.TextBoxFor(m => m.x_card_num, new { @autofocus = "autofocus" })
@Html.ValidationMessageFor(m => m.x_card_num)
</td>
</tr>
<tr>
<td>
@Html.LabelFor(m => m.x_exp_date)
@Html.TextBoxFor(m => m.x_exp_date)
</td>
</tr>
<tr>
<td>
@Html.LabelFor(m => m.x_card_code)
@Html.TextBoxFor(m => m.x_card_code)
</td>
</tr>
<tr>
<td>
@Html.LabelFor(m => m.AnnualFee)
@Html.TextBoxFor(m => m.AnnualFee)
</td>
</tr>
<tr>
<td>
@Html.LabelFor(m => m.DiscountCode)
@Html.TextBoxFor(m => m.DiscountCode)
@Html.ActionLink("Apply Discount", "CCDiscount", "Account",
new { id = "Model" }, null)
</tr>
<tr>
<td>
<div style="clear:both"></div>
<input type="submit" class="submit "value="Process Payment" />
</td>
</tr>
<tr>
<td>
<h3>Clicking on the "Process Payment" button will charge your credit card in the amount listed as the Annual Fee.</h3>
</td>
</tr>
</table>
</fieldset>
@DPMFormGenerator.EndForm()
}
@section Scripts {
@Scripts.Render("~/bundles/jqueryval")
}
07-21-2015 11:30 AM - edited 07-21-2015 11:31 AM
I tested with the sample code http://developer.authorize.net/downloads/samplecode/
id attribute is use, not the name attribute
07-22-2015 11:24 AM
RaynorC1emem7 - thanks for trying to help!
I was using Razor and MVC and it generated name attributes instead of id. Perhaps this would have solved my problem but I wanted to take advantage of Razor in my view.
After nearly 3 days of struggling with Authorize.net I switched to Stripe.net and was able to get their sample application up and running in less than 2 hours and I had their interface fulling integrated into my application in less than a day. They offered a very nice, fully functioning, sample application that made the entire process very easy to understand and quick to test and implement.
Authorize.net could benefit from looking at what they have done.
Thanks again for trying to help.
07-24-2015 07:58 AM
I think my biggest struggle with Authorize.net was getting any type of meaningful error messages from the interface. Every time I would submit a request I got a message back stating my login id and password were invalid. Needless to say, I spent a huge amount of time trying to figure out why this was the case when if fact my problem clearly (with the benefit of hindsight) had NOTHING to due with the login credentials.
One of the most critical features when developing an interface is to provide meaningful and useful error reporting so the caller of your interface can independently identify the cause of integration errors. Without sufficient error reporting it is impossible to call an interface without support from the publisher of the interface. This is where my experience failed with Authorize.net. I clearly had a problem in how I was calling the interface but the error reporting I was getting back from the call not only didn't provide sufficient information to allow me to fix the problem but even worse it sent me down a path that was ENTIRELY wrong.
07-24-2015 08:09 AM