Code Monkey home page Code Monkey logo

accountright_live_api_.net_sdk's People

Contributors

alexdia25 avatar alexeygrantmyob avatar anshumansaurabhmyob avatar damiencap avatar daniel-chambers avatar gitter-badger avatar heydenbevan avatar himanshumalikmyob avatar jaspermondie avatar jordnt avatar keranm avatar michaelk120 avatar myob-developers avatar nicstronell avatar nikhitaa avatar sawilde avatar seanonet avatar shefalibanthiamyob avatar taniaoentaryo avatar xinghangyu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

accountright_live_api_.net_sdk's Issues

2019.2 Updates

Account Right 2019.2 has been released, but the API looks like its at version 2018.1.
Will there be an update to the SDK?

Sample Project

There was a sample project available for download from December 2014 for an old version of the SDK.
We built our integration to MYOB AccountRight using that sample, including support for online databases.

After upgrading to the latest SDK due to apparent requirements to access the databases (they added more multi-currency support), our application can no longer access the data from online databases.

We can access the list of company files and connect to a specific company file, but when trying to download data we get "(401) Unauthorized". We are still sending the applicable tokens like we did before, but it does not help. We did have to update the login window to use the new WebView2 control since the old one no longer works.

We tried to follow the limited directions on the MYOB developer site (Cloud Service) (SDK Services) but it did not help. It did mention that more information was forthcoming.

Is there an updated sample project we can review, or specific documentation that shows what we need to do?

Exception "The supplied Uri is not valid for the current service."

This is thrown when an endpoint in a CompanyFile object does not match that of the URI passed in e.g. mismatch in host-names. This check is to ensure that the app does not try to make requests to the wrong company file see blog - Advanced Warning but it will also kick in if you try to send requests to the default end-point which might not be optimal in a multi-hosted API scenario; which is currently being tested.

This normally happens if the application is using a cached CompanyFile object so the initial recourse on receiving this error should be to refresh all cached CompanyFile objects.

We will look to see if we can throw a better exception (more specific to the issue) and/or ignore the hostname as part of the match as the API will reroute calls but it may not be as optimal for the end user.

cc'ng @keranm @devjack

Cannot insert timesheets

Hi Guys,
I have integrated MYOB AccountRight with our application and currently in the process of integrating Timesheets.

I found that the MYOB.AccountRight.SDK.Services.Payroll.TimesheetService doesn't have an option to insert new timesheets like in other Services. However, it has a method to Update an existing timesheet.

Can somebody please give me an example to create a timesheet with .Net SDK.

Appreciate any help on this regard.

Thanks,
Dinindu

Renew Token Not Working

Hi Team

Unable to get access token from renewtoken function.

It is alway return me

{"error":"invalid_request"}

Request
POST / https://secure.myob.com/oauth2/v1/authorize/

client_id=d777839f2f7-0ef5-47ab-9946-b2e694363192&client_secret=E3bymLRGH25887S4SmQV8258g3fgiU4&refresh_token=bq7R!IAAAAPTFVGdjX_SkUFh2YHkO_Q6t4yLW0_1nSievq6uMm9CXwQAAAAGo8Oh1k0cEc10RKHfNgMHBAgD9w1yCmUBWUP6oIiZo65Q1G5hJLOdrVv5sGP19moEg5xyH0afMI4UPcGtpuky10lxGVL4CFcvdnLKrPDLNiTcVolcmh3JX-hZ&grant_type=refresh_token

Where is the issue

Services should use ApiBaseUrl declared in ApiConfiguration

When using ApiConfiguration to initialize an instance of a service the ApiBaseUrl value provided should be used instead of the URI specified in the Company File. Or, additional details should be added to exceptions to alert users to the mismatch.

Adding an attachment to a service bill fails

Using the following code, adding an attachment to a service bill fails with a 404 not found error.

        BillAttachmentData billAttachmentData = new BillAttachmentData();
        billAttachmentData.OriginalFileName = "test.pdf";
        billAttachmentData.FileBase64Content = Convert.ToBase64String(attachment);

        BillAttachmentWrapper billAttachmentWrapper = new BillAttachmentWrapper();
        billAttachmentWrapper.Attachments = new List<BillAttachmentData>();
        billAttachmentWrapper.Attachments.Add(billAttachmentData);
        BillAttachmentWrapper returnedData = serviceBillAttachmentService.InsertEx(CompanyFile, transaction.UID, billAttachmentWrapper, Credentials);

Migrate to .Net Standard

As title suggest, I would like to see this library migrated to a cross platform compatible solution, .NET Standard.

Cant build the Zip download

Using VS2013 as administrator, When I download the Zip, it will not build as the snk file is missing.
I had to remove signing from the projects and correct the asterix at the end of the version numbers in order to build.

When I do build there are numerous warnings one for example is

This async method lacks 'await' operators and will run synchronously. Consider    using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.  

Problem with EmployeePayrollDetails.gender

I'm trying to create connector from MYOB to SQL Server to share data from each other and i encountered some problem:

  • I'm using AccountRight Plus AU 2015.4.1 program. I'm using "API Sandbox Demo 28" file.
  • I have problem with Card List -> Employee -> Payroll Details -> Gender.

In AccountRight graphical interface you can choose from 3 options:

  1. Male
  2. Female
  3. Indeterminate
    or leave it blank, but in SDK i have only Male, Female and NotSet(Which is blank)

If I choose 3rd option Indeterminate and try to load it in my connector program it crashes and i get this error:

"Encountered an operation error (https://api.myob.com/accountright/a4dfe6e4-38ee-4773-a536-284be2fbc047/Contact/EmployeePayrollDetails/)"
Inner Exception:
Error converting value "Indeterminate" to type 'System.Nullable`1[MYOB.AccountRight.SDK.Contracts.Version2.Contact.Gender]'. Path 'Items[4].Gender', line 400, position 32.
System.ArgumentException.Message:
Requested value 'Indeterminate' was not found.

Is there any way i can fix this ? If someone going to enter this option in AccountRight 2015.4 my connector will skip this employee and won't update his data.
Thank you
Sincerely
Gintaras

Quarterly PayFrequency causes Serialisation Exception

Version:
MYOB.AccountRight.API.SDK 2022.4.405

Problem:
When an employee in a MYOB company file has a Quarterly pay frequency in their wage information, the SDK does not cater for this value and deserialization fails.

How to reproduce:

  • Find an employee and set their wage to have a quarterly pay frequency.
  • Use an EmployeePayrollDetailsService to retrieve an EmployeePayrollDetails response.
  • Observe deserialisation exception.

Associated Pull Request: #190

Negative values

I am currently having an issue adding a negative invoice line (item sales) into MYOB via SDK.
I have tried adding in the cost of the item and the total of the item as a negative value but when it is pushed to MYOB the values are converted to positive values.
I have also tried putting the item through with a negative quantity which results in a validation error (CommonRules_DecimalMinValue).

What is the recommended way to go about this?

Type mismatch - TaxCode.Rate

I am not sure if you consider this an issue (it can be bypassed with a typecast) but
TaxCode.Rate in the API is a Decimal (8,4) in the API but declared as a double in the SDK

Regards,
John.

DebitSettlementType - "NotSet" - Causes exception

Some company files return a DebitSettlementType value of "NotSet".

API URL: https://ar1.api.myob.com/accountright/[COMPANYFILE]/Purchase/DebitSettlement?$top=1000

It's likely caused by legacy data that doesn't conform to the api spec, and can't be upgraded.

I have been in touch via developer support, and it has been confirmed as a bug.

I will submit a pull request to address the issue, I expect adding "NotSet" to the enum values to be enough to resolve the issue.

There doesn't look to be any tests covering this particular endpoint?

Error converting value "NotSet" to type 'MYOB.AccountRight.SDK.Contracts.Version2.Purchase.DebitSettlementLineType'. Path 'Items[20].Lines[0].Type', line 660, position 26.

   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.EnsureType(JsonReader reader, Object value, CultureInfo culture, JsonContract contract, Type targetType)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
   at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
   at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
   at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)
   at MYOB.AccountRight.SDK.Communication.BaseRequestHandler.ExtractJSonCompressedEntity[TResp](WebResponse response) in c:\projects\accountright-live-api-net-sdk\MYOB.API.SDK\SDK\Communication\BaseRequestHandler.cs:line 172
   at MYOB.AccountRight.SDK.Communication.BaseRequestHandler.ExtractDetails[T](HttpWebResponse response, String& location, HttpStatusCode& statusCode) in c:\projects\accountright-live-api-net-sdk\MYOB.API.SDK\SDK\Communication\BaseRequestHandler.cs:line 152
   at MYOB.AccountRight.SDK.Communication.BaseRequestHandler.HandleResponseCallback[T,TResp](IAsyncResult asynchronousResult) in c:\projects\accountright-live-api-net-sdk\MYOB.API.SDK\SDK\Communication\BaseRequestHandler.cs:line 122

Could not load file or assembly 'Newtonsoft.Json, Version=4.5.0.0 ... or one of its dependencies.

Having built our integration code from a previous .SDK we are receiving the following error when importing from the cloud and attempting to authorise the cloud company file:

System.IO.FileLoadException:
Could not load file or assembly 'Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'
or one of its dependencies.
The located assembly's manifest definition does not match the assembly reference.
(Exception from HRESULT: 0x80131040)

Subsequently we rebuilt our integration code against your latest .SDK (which states it's dependencies as >= 7.0.1: https://www.nuget.org/packages/MYOB.AccountRight.API.SDK) but received a similar version specific error.

Our product currently uses Newtonsoft.Json.dll is version: 9.0.1.19813 and it seems the version (v7) and code in the .SDK does not support later versions despite this being stated. Our developers queried whether you have the "Specific Version" properties setting set to "true" as in the image below, which would have this effect?

image

Could you look to re-issue an .SDK compatible with our JSON version (9.0.1.19813) or re-release the current version with the "Specific Version" set to false? We are hoping you may be able to do this in good time for your forthcoming 2018.1.1 release so we can support our shared clients...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.