diff --git a/MYOB.API.SDK/SDK.Test/Communication/ApiRequestHandlerTests.cs b/MYOB.API.SDK/SDK.Test/Communication/ApiRequestHandlerTests.cs index dee0afdb..e630c5c4 100644 --- a/MYOB.API.SDK/SDK.Test/Communication/ApiRequestHandlerTests.cs +++ b/MYOB.API.SDK/SDK.Test/Communication/ApiRequestHandlerTests.cs @@ -131,7 +131,6 @@ private static void AssertStandardHeaders(bool supplyCredentials, bool supplyOAu Assert.IsTrue(request.Headers[HttpRequestHeader.AcceptEncoding].Split(new[] {','}).Contains("gzip")); - Assert.AreEqual("<>", request.Headers["x-myobapi-key"]); Assert.AreEqual("v2", request.Headers["x-myobapi-version"]); if (supplyCredentials) @@ -173,7 +172,6 @@ private static void AssertEmptyCredentialsHeaders(bool supplyOAuth, WebRequest r Assert.IsTrue(request.Headers[HttpRequestHeader.AcceptEncoding].Split(new[] { ',' }).Contains("gzip")); - Assert.AreEqual("<>", request.Headers["x-myobapi-key"]); Assert.AreEqual("v2", request.Headers["x-myobapi-version"]); Assert.IsNull(request.Headers["x-myobapi-cftoken"]); } diff --git a/MYOB.API.SDK/SDK/ApiConfiguration.cs b/MYOB.API.SDK/SDK/ApiConfiguration.cs index f1f99971..fa3f015f 100644 --- a/MYOB.API.SDK/SDK/ApiConfiguration.cs +++ b/MYOB.API.SDK/SDK/ApiConfiguration.cs @@ -80,6 +80,11 @@ public ApiConfiguration(string apiBaseUrl) : this(null, null, null, apiBaseUrl) /// public bool GenerateUris { get; private set; } + /// + /// The Api key used for making api request + /// + public string AuthApiKey { get; private set; } + #if !PORTABLE /// /// Gets or sets the cache policy for all requests diff --git a/MYOB.API.SDK/SDK/Communication/ApiRequestHelper.cs b/MYOB.API.SDK/SDK/Communication/ApiRequestHelper.cs index e761c73e..a1f368d1 100644 --- a/MYOB.API.SDK/SDK/Communication/ApiRequestHelper.cs +++ b/MYOB.API.SDK/SDK/Communication/ApiRequestHelper.cs @@ -121,7 +121,7 @@ public void SetStandardHeaders(WebRequest request, IApiConfiguration configurati #endif }); - request.Headers["x-myobapi-key"] = configuration.ClientId; + request.Headers["x-myobapi-key"] = configuration.AuthApiKey; request.Headers["x-myobapi-version"] = "v2"; if ((credentials != null) && (!String.IsNullOrEmpty(credentials.Username))) // password can be empty diff --git a/MYOB.API.SDK/SDK/Contracts/Version2/Sale/Invoice.cs b/MYOB.API.SDK/SDK/Contracts/Version2/Sale/Invoice.cs index 36a6b1e7..bbad972a 100644 --- a/MYOB.API.SDK/SDK/Contracts/Version2/Sale/Invoice.cs +++ b/MYOB.API.SDK/SDK/Contracts/Version2/Sale/Invoice.cs @@ -165,6 +165,11 @@ public Invoice() /// If true, surcharge fee could apply to invoice /// public bool CanApplySurcharge { get; set; } + + /// + /// If true or null, BPay could apply to invoice when OIP enabled + /// + public bool? CanApplyBPay { get; set; } } } diff --git a/MYOB.API.SDK/SDK/IApiConfiguration.cs b/MYOB.API.SDK/SDK/IApiConfiguration.cs index fb41e7bd..6840c7af 100644 --- a/MYOB.API.SDK/SDK/IApiConfiguration.cs +++ b/MYOB.API.SDK/SDK/IApiConfiguration.cs @@ -30,6 +30,11 @@ public interface IApiConfiguration /// string ApiBaseUrl { get; } + /// + /// The Api key used for making api request + /// + string AuthApiKey { get; } + #if !PORTABLE /// /// Gets or sets the cache policy for all requests diff --git a/README.md b/README.md index bc2cbe26..172248bd 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,6 @@ #AccountRight Live API .Net SDK# -[![Join the chat at https://gitter.im/MYOB-Technology/AccountRight_Live_API_.Net_SDK](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/MYOB-Technology/AccountRight_Live_API_.Net_SDK?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) - This is the source repository for the MYOB AccountRight Live .Net SDK. The official release of the SDK can be found on [NUGET](http://www.nuget.org/packages/MYOB.AccountRight.API.SDK/) and can be installed from Visual Studio using the Package Manager console. diff --git a/appveyor.yml b/appveyor.yml index 39a4f41e..6ba48a10 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,4 @@ -version: 2024.4.{build} +version: 2024.5.{build} shallow_clone: true assembly_info: patch: true @@ -23,17 +23,25 @@ artifacts: - path: .\Artefacts\Coverage\output.xml name: Coverage deploy: +- provider: NuGet + api_key: + secure: 93FcjymW95mjyg2lKI8vfBhuuPnAwVCuRBxbhc3QvvLnZorHRHM5K1tOe9AmoZRz + skip_symbols: true + artifact: Release + on: + branch: release +- provider: NuGet + api_key: + secure: 93FcjymW95mjyg2lKI8vfBhuuPnAwVCuRBxbhc3QvvLnZorHRHM5K1tOe9AmoZRz + skip_symbols: true + artifact: Candidate + on: + branch: candidate - provider: NuGet server: https://www.myget.org/F/myob-developers/api/v2 api_key: secure: OGw616WsfGBUWoVi1NZFVekoCyXoqi1f93v8GJJ8Y1DgcH5utdKg0yX2FGkFkXfj artifact: Release -notifications: -- provider: Webhook - url: https://webhooks.gitter.im/e/a5f4ffd724543d128fff - on_build_success: true - on_build_failure: true - on_build_status_changed: true on_success: - cmd: >- .\packages\coveralls.io.1.3.4\tools\coveralls.net.exe --opencover .\Artefacts\Coverage\output.xml \ No newline at end of file