Skip to content

Commit

Permalink
feat: update auth for Pricing
Browse files Browse the repository at this point in the history
  • Loading branch information
Tr00d committed Dec 4, 2024
1 parent 0d18216 commit eed0bcb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
10 changes: 6 additions & 4 deletions Vonage.Test/PricingTests.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
using System.Threading.Tasks;
#region
using System.Threading.Tasks;
using Vonage.Pricing;
using Vonage.Request;
using Xunit;
#endregion

namespace Vonage.Test;

Expand All @@ -15,7 +17,7 @@ public async Task GetPricingAllCountriesAsync(bool passCreds)
{
//ARRANGE
var expectedUri =
$"{this.RestUrl}/account/get-pricing/outbound/sms?api_key={this.ApiKey}&api_secret={this.ApiSecret}&";
$"{this.RestUrl}/account/get-pricing/outbound/sms";
var expectedResponse = @"{
""count"": ""243"",
""countries"": [
Expand Down Expand Up @@ -77,7 +79,7 @@ public async Task GetPricingForCountryAsync(bool passCreds)
{
//ARRANGE
var expectedUri =
$"{this.RestUrl}/account/get-pricing/outbound/sms?country=CA&api_key={this.ApiKey}&api_secret={this.ApiSecret}&";
$"{this.RestUrl}/account/get-pricing/outbound/sms?country=CA&";
var expectedResponseContent = @"{
""countryCode"": ""CA"",
""countryName"": ""Canada"",
Expand Down Expand Up @@ -137,7 +139,7 @@ public async Task GetPricingForPrefixAsync(bool passCreds)
{
//ARRANGE
var expectedUri =
$"{this.RestUrl}/account/get-prefix-pricing/outbound/sms?prefix=1&api_key={this.ApiKey}&api_secret={this.ApiSecret}&";
$"{this.RestUrl}/account/get-prefix-pricing/outbound/sms?prefix=1&";
var expectedResponse = @"{
""count"": ""243"",
""countries"": [
Expand Down
8 changes: 5 additions & 3 deletions Vonage/Pricing/PricingClient.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#region
using System.Threading.Tasks;
using Vonage.Common;
using Vonage.Request;
#endregion

namespace Vonage.Pricing;

Expand Down Expand Up @@ -32,7 +34,7 @@ public Task<PricingResult> RetrievePrefixPricingAsync(string type, PricingPrefix
(
ApiRequest.GetBaseUri(ApiRequest.UriType.Rest, this.configuration,
$"/account/get-prefix-pricing/outbound/{type}"),
AuthType.Query,
AuthType.Basic,
request
);

Expand All @@ -43,7 +45,7 @@ public Task<PricingResult> RetrievePricingAllCountriesAsync(string type, Credent
(
ApiRequest.GetBaseUri(ApiRequest.UriType.Rest, this.configuration,
$"/account/get-pricing/outbound/{type}"),
AuthType.Query
AuthType.Basic
);

/// <inheritdoc/>
Expand All @@ -54,7 +56,7 @@ public Task<Country> RetrievePricingCountryAsync(string type, PricingCountryRequ
(
ApiRequest.GetBaseUri(ApiRequest.UriType.Rest, this.configuration,
$"/account/get-pricing/outbound/{type}"),
AuthType.Query,
AuthType.Basic,
request
);

Expand Down

0 comments on commit eed0bcb

Please sign in to comment.