cancel
Showing results for 
Search instead for 
Did you mean: 

Could not load type 'AuthorizeNet.DPMFormGenerator' from assembly

Hello,

Created a clean VS2013 using MVC5 project by following from this link http://developer.authorize.net/integration/fifteenminutes/csharp/, but
when running the solution I get this error 

"Could not load type 'AuthorizeNet.DPMFormGenerator' from assembly 'AuthorizeNet, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'."

 

I simply follow the tutorial and NO errors on compile but error on runtime only.

 

Package;

...

<package id="AuthorizeNet" version="1.8.4" targetFramework="net45" />


...

 

MVC View

 

@{
ViewBag.Title = "Index";
}
<h2>Authorize.Net</h2>
<div class="row">
<div class="col-lg-12">
@Html.Action("DPM", "Application1")
</div>
</div>

 

 

 

MVC Controller

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using AuthorizeNet;
namespace Application1.Controllers
{
public class Application1Controller : Controller
{
public ActionResult Index()
{
return View();
}
public ActionResult DPM()
{
String ApiLogin = "sandbox-api";
String TxnKey = "sandbox-key";
String checkoutform = DPMFormGenerator.OpenForm(ApiLogin, TxnKey, 2.25M, "https://YOUR_RELAY_RESPONSE_URL", true);
// Add a credit card number input field
checkoutform = checkoutform + "<p><div style='float:left;width:250px;'><label>Credit Card Number</label><div id = 'CreditCardNumber'><input type='text' size='28' name='x_card_num' value='4111111111111111' id='x_card_num'/></div></div>";
// Add an expiry date input field 
checkoutform = checkoutform + "<div style='float:left;width:70px;'><label>Exp.</label><div id='CreditCardExpiration'><input type='text' size='5' maxlength='5' name='x_exp_date' value='0116' id='x_exp_date'/></div></div>";
// Add a CVV input field
checkoutform = checkoutform + "<div style='float:left;width:70px;'><label>CCV</label><div id='CCV'><input type='text' size='5' maxlength='5' name='x_card_code' id='x_card_code' value='123' /></div></div></p>";
// Add a Submit button
checkoutform = checkoutform + "<div style='clear:both'></div>";
checkoutform = checkoutform + "<p><input type='submit' class='submit' value='Order with DPM!' /></p>";
checkoutform = checkoutform + DPMFormGenerator.EndForm();
return Content("<html>" + checkoutform + "</html>");
}
}
}

 

Any help is much appreciated. Thanks!

allinone
Member
6 REPLIES 6

Hello @allinone

I've reported your issue to the product team for analysis.

I'd recommend subscribing to this topic so that you'll be alerted via email if there are updates. To subscribe, click Topic Options at the top of this thread and then select Subscribe. You'll then receive an email once anyone replies to your post.

Thanks,

Richard

RichardH
Administrator Administrator
Administrator

Hello,

 

May I know if the issue is resolved? I think this is versioning issue don't you think?

 

The error stated version 1.0.0.0 but the package downloaded from Nuget is version  1.8.4.

 

Looking forward.

 

Thanks,

Hello,

 

Is there other tutorials on how to test the Authorize.Net Sandbox implementation besides the 15-minutes guide?

 

We are still stuck in the beginning process but still prefer Authorize.Net on C# MVC to charge users credit cards.

 

Thanks,

 

 

You don't need the SDK. Just read the doc http://developer.authorize.net/api/dpm/

DPM basically is just a form post to an authorize.net url.

Seems like there is no sample code for DPM here http://developer.authorize.net/downloads/samplecode/...only for AIM, SIM, ARB, CIM and MBAPI.

 

Where can I find the sample for for DPM?

 

Thanks!

Start with the SIM sample code, DPM is about 90% the same as SIM, even the DPM doc is just an Appendix in SIM doc.