square / connect-csharp-sdk

C# client library for the Square Connect APIs
https://docs.connect.squareup.com/
Apache License 2.0
27 stars 25 forks source link

Enum Error #120

Closed jmawebtech closed 5 years ago

jmawebtech commented 5 years ago

Error:

Error converting value "MISC_RETAIL" to type 'System.Nullable`1[Square.Connect.Model.V1Merchant+BusinessTypeEnum]'. Path '[0].business_type', line 1, position 471.

Request:

GET https://connect.squareup.com/v1/me/locations HTTP/1.1 Accept: application/json Square-Version: 2019-05-08 Authorization: Bearer X User-Agent: Square-Connect-CSharp/2.20190508.0 Host: connect.squareup.com Accept-Encoding: gzip, deflate Connection: Keep-Alive

Response:

[{"account_capabilities":["CREDIT_CARD_PROCESSING"],"id":"J6RTV36PHWD9E","name":"Cloud 509 Moses Lake ","email":"margo@cloud509.com","country_code":"US","language_code":"en-US","business_name":"Cloud 509 Moses Lake","business_address":{"address_line_1":"1039 W Broadway Ave","locality":"MOSES LAKE","administrative_district_level_1":"WA","postal_code":"98837","country_code":"US"},"business_phone":{"calling_code":"+1","number":"5098557710"},"business_type":"MISC_RETAIL","shipping_address":{"address_line_1":"706 Penn Ivy St","locality":"Moses Lake","administrative_district_level_1":"WA","postal_code":"98837-2790","country_code":"US"},"account_type":"LOCATION","location_details":{"nickname":"Cloud 509 Moses Lake "},"currency_code":"USD"},{"account_capabilities":["CREDIT_CARD_PROCESSING"],"id":"VTGZQZ0N5PD1T","name":"DGV","email":"margo@cloud509.com","country_code":"US","language_code":"en-US","business_name":"Dr. GoodVape","business_address":{"address_line_1":"4303 W 27th Ave.","address_line_2":"Suite B","locality":"Kennewick","administrative_district_level_1":"WA","postal_code":"99338","country_code":"US"},"business_phone":{"calling_code":"+1","number":"5092406697"},"business_type":"MISC_RETAIL","shipping_address":{"address_line_1":"706 Penn Ivy St","locality":"Moses Lake","administrative_district_level_1":"WA","postal_code":"98837-2790","country_code":"US"},"account_type":"LOCATION","location_details":{"nickname":"DGV"},"currency_code":"USD"}]

StephenJosey commented 5 years ago

Hi @jmawebtech sorry for the delay here. This looks like it has been resolved, at least on the latest version of the SDK. I just did a simple test:

V1LocationsApi locationsApi = new V1LocationsApi();
 List<V1Merchant> locations = locationsApi.ListLocations();
Console.Write(locations[0].BusinessType);

and it printed "MISC_RETAIL" successfully, while using the latest SDK (2.22.2). Please let me know if you continue to run into this issue or have further questions.