We are trying to get off the legacy hosted payment form, but every time I click pay I get the error below:
messageCode: "E00001"
messageText: "Unexpected error. Please try again."
The problem is coming when running transactions via the Accept Suite. I am able to use the API Live Console to get reporting data and also get a Accept Hosted Token, but I am unable to process transactions in the sandox at all!?
02-22-2019 07:11 AM
02-27-2019 02:42 AM
02-27-2019 05:19 AM
I created a new MVC Application in Visual Studio using .NET Framework 4.5.2. The code below works if I use nuget pakckage version 1.9.6 if I use 1.9.7 this same payment will fail until I remove the transactionRequest order property.
Global.asax.cs
public class MvcApplication : System.Web.HttpApplication { protected void Application_Start() { ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls; AreaRegistration.RegisterAllAreas(); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); } }
HomeController.cs
public class HomeController : Controller { public ActionResult Index() { var invoiceId = "18448294934052571560"; var custacct = "000000000010"; var custom_data = string.Format("{0}-{1}", invoiceId, custacct); ApiOperationBase<ANetApiRequest, ANetApiResponse>.RunEnvironment = AuthorizeNet.Environment.SANDBOX; ApiOperationBase<ANetApiRequest, ANetApiResponse>.MerchantAuthentication = new merchantAuthenticationType { name = "<LoginID>>", Item = "<TransactionKey>", ItemElementName = ItemChoiceType.transactionKey }; var controller = new getHostedPaymentPageController(new getHostedPaymentPageRequest { hostedPaymentSettings = new settingType[] { new settingType { settingName = "hostedPaymentReturnOptions", settingValue = string.Format(@"{{""showReceipt"":false,""url"":""{0}""}}", "<Ngrok Address for me>/AuthNetTest/Home/Receipt") }, new settingType { settingName = "hostedPaymentButtonOptions", settingValue = "{\"text\":\"Pay\"}" }, new settingType { settingName = "hostedPaymentPaymentOptions", settingValue = string.Format(@"{{""cardCodeRequired"": false, ""showCreditCard"": {0}, ""showBankAccount"": {1}}}", "true", "false") }, new settingType { settingName = "hostedPaymentSecurityOptions", settingValue = "{\"captcha\": false}" }, new settingType { settingName = "hostedPaymentShippingAddressOptions", settingValue = "{\"show\": false, \"required\": false}" }, new settingType { settingName = "hostedPaymentBillingAddressOptions", settingValue = "{\"show\": true, \"required\": false}" }, new settingType { settingName = "hostedPaymentCustomerOptions", settingValue = "{\"showEmail\": true, \"requiredEmail\": false, \"addPaymentProfile\": false}" } }, transactionRequest = new transactionRequestType { amount = 10.00M, transactionType = transactionTypeEnum.authCaptureTransaction.ToString(), order = new orderType { invoiceNumber = invoiceId, description = invoiceId, }, userFields = new userField[] { new userField { name = nameof(custom_data), value = custom_data } } }, }); var hostedPaymentResult = controller.ExecuteWithApiResponse(); ViewBag.Token = hostedPaymentResult.token; return View(); } public ActionResult Receipt() { ViewBag.Message = "Payment Finished"; return View(); }
Index.cshtml
@{ ViewBag.Title = "Home Page"; } <form method="post" action="https://test.authorize.net/payment/payment" id="formAuthorizeNetTestPage" name="formAuthorizeNetTestPage"> <input type="hidden" name="token" value="@(ViewBag.Token)" /> Continue to Authorize.Net to Payment Page <button id="btnContinue">Continue to next page</button> </form>
02-27-2019 06:46 AM
Hello @grantgoodart81
This looks similar to an earlier thread but I don't see a solution yet.
I will escalate this to a support engineer, but I would also suggest raising an issue on GitHub. Doing so will notify the team working on this SDK directly.
Richard
02-27-2019 07:48 AM
@RichardH logged this GitHub Issue
02-27-2019 08:25 AM
Plz help,
Getting error in Sanbox mode, when trying to payment via AuthroziedNet_AccpetHosted
see the Screenshot i have linked
Thanks
11-28-2019 11:21 PM