1

Everytime I'm going to this view I'm getting this error in fetching the list of customer from the sandbox ap. I'm using PaysimpleSDK https://github.com/PaySimple/PaySimpleSDK/wiki/Customer-Service

My error

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: PaySimpleSdk.Exceptions.PaySimpleEndpointException: Endpoint Error: MethodNotAllowed:

var customers = await customerService.GetCustomersAsync(CustomerSort.FirstName);

here is my controller

  public async Task<ActionResult> Trial()
    {
        string username = "myusername";
        string apiKey = "apikey";
        string baseUrl = "https://sandbox-api.paysimple.com/v4/customer";
        var settings = new PaySimpleSettings( apiKey, username, baseUrl );
        

        var customerService = new CustomerService(settings);
        var customers = await customerService.GetCustomersAsync();

        return View(customers.ToString());
    }

my view (I can't copy the whole view code,because it have a table)

@model IEnumerable<PaySimpleSdk.Customers.Customer>
@{
ViewBag.Title = "Index";
}

 @Html.DisplayNameFor(model => model.FirstName)
 @foreach (var item in Model)
 @Html.DisplayFor(modelItem => item.FirstName)






   
Community
  • 1
  • 1
Woshooo
  • 250
  • 1
  • 2
  • 18

1 Answers1

0

In mvc i usually get this error when i call the action with http get and the action has been declared to serve only http post or in general when you have action declared for specific verb and you try to get it with the ones not allowed

Ghini Antonio
  • 2,992
  • 2
  • 25
  • 48
  • I don't have a HTTP verb, but I think it is a get, because of the ".GetCustomersAsync" it is in the PaySimpleSDK – Woshooo Feb 28 '17 at 19:15
  • https://github.com/PaySimple/PaySimpleSDK/wiki/Customer-Service I'm just copying the code in here – Woshooo Feb 28 '17 at 19:15