Steps to reproduce error:
1. install and activate the Authorize.Net plugin in Nop 4.0
2. Add items to cart and proceed to checkout (standard checkout, not 1 page)
3. After selecting "credit card" and click next, the next page fails completely.
Error log shows as follows:
Log level: Error
Short message: Incorrect Content-Type:
Full message: System.InvalidOperationException: Incorrect Content-Type:
at Microsoft.AspNetCore.Http.Features.FormFeature.ReadForm()
at Microsoft.AspNetCore.Http.Internal.DefaultHttpRequest.get_Form()
at Nop.Plugin.Payments.AuthorizeNet.Components.AuthorizeNetViewComponent.Invoke()
at lambda_method(Closure , Object , Object[] )
at Microsoft.Extensions.Internal.ObjectMethodExecutor.Execute(Object target, Object[] parameters)
at Microsoft.AspNetCore.Mvc.ViewComponents.DefaultViewComponentInvoker.InvokeSyncCore(ObjectMethodExecutor executor, ViewComponentContext context)
The error message is then followed by an extremely long call stack.
Steps to resolve error:
1. Open the \Plugins\Nop.Plugin.Payments.AuthorizeNet\Components\AuthorizeNetViewComponent.cs file
2. On line 44 change
var form = Request.Form;to
var form = Request.Query;
3. Rebuild and re-deploy the plugin